Implement game logic