object oriented java script game