Skip to content

Implement StateManager [WIP]#13

Open
552020 wants to merge 7 commits intomainfrom
552020/client-state-manager
Open

Implement StateManager [WIP]#13
552020 wants to merge 7 commits intomainfrom
552020/client-state-manager

Conversation

@552020
Copy link
Copy Markdown
Collaborator

@552020 552020 commented Dec 5, 2025

From SFML Game Development by Example Cap. V --> https://www.openvisionnetworks.com/dist/SFML%20Game%20Development%20By%20Example.pdf

  • 'Import' new classes: StateManager, StateGame, StateGameOver, StateIntro, StateMainMenu, StateMushroom, StatePaused
  • Fix discrepancy between StateType in EventManager and new StateManager. We add a new Global state (not present in the tutorial), holding all stuff shared by the different states.
  • Replace enum mode with StateType from the StateMaager and gameMode with currentState

- Add EventManager and EventManager.cpp/hpp from sfml project
- Refactor Drawer::onKeyPress into separate EventManager callbacks
- Register movement callbacks (arrow keys and WASD) with EventManager
- Update Drawer to use EventManager for event handling
- Add keys.cfg for key bindings configuration
- Update t_event types to match EventManager EventType enum
- Comment out SFML-specific continuous polling code
- Add EventManager.cpp to Makefile
…handling

- Replace legacy event types (KEY, MOUSE, EXIT) with EventManager types
- Create Vec2i struct to replace sf::Vector2i for graphics-agnostic vectors
- Refactor Drawer to use EventManager callbacks instead of direct event handling
- Register movement, zoom, and mouse callbacks with state-aware EventManager
- Fix key code mappings in graphics libraries to match keys.cfg bindings
- Add zoom key bindings (Key_M/Key_N) to keys.cfg
- Remove SFML dependencies from EventManager for graphics library independence
- Update EventManager to handle t_event instead of sf::Event
- Add BaseState base class for all game states
- Add StateManager to handle state transitions and lifecycle
- Add initial game state implementations (Intro, MainMenu, Game, Paused, GameOver, Mushroom)
- Add assets.cfg for asset configuration
- Update Drawer.hpp to support state management

Initial implementation - work in progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant