state management for main game