Main game logic