basic game logic implementation