Skip to content

OOP refactor: state machine, Level, and Audio - #1

Open
Ansel7 wants to merge 4 commits into
mainfrom
oop-refactor
Open

Ansel7 wants to merge 4 commits into
mainfrom
oop-refactor

Conversation

@Ansel7

@Ansel7 Ansel7 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Restores the deleted Game.cpp and rewrites the project as a real object-oriented loop.

What changed

  • Game is now a five-state machine: MainMenu, Instructions, Playing, Paused, GameOver.
  • Each frame is handleInput()update()render() instead of one 500-line run().
  • New Level class owns BSP load, FPS camera, collision, and chair picking.
  • New Audio class owns a single IrrKlang engine (the old code created two).
  • HUD widgets are created once and updated, not rebuilt every frame.
  • Shared Ids.h for pick flags and GUI button IDs.
  • Game.vcxproj lists Audio.cpp and Level.cpp.

Gameplay and assets are unchanged: find the chair 10 times before the 30-second timer hits zero.

Review notes are in REVIEW.md.

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