Implement game state engine.