game js logicc