game logic class