Implement basic game logic.