How minecraftbucuo/gameengine works
GameEngine is a C++/SDL3/Box2D framework whose showcased product is a Super Mario game, supporting local single-player and networked multiplayer, plus desktop and Web clients and a headless server. The main flow is launch → engine initialization and scene selection → per-frame scene updates and rendering, or server ticks; scenes coordinate gameplay, physics, and networking. README capabilities are represented using paths from the tree; unsampled subsystem wiring is not asserted beyond documented behavior and visible engine calls.
Main entry points: GameEngine.cpp Game engine · SceneManager.cpp Scene manager · SuperMarioSceneMultiplayer.cpp Multiplayer scene · RendererSDL3.cpp SDL renderer
Components 23
Runtime and scenes
- Program entry
src/main.cpp - Game engine
src/GameEngine.cpp - Scene manager
src/Manager/SceneManager.cpp - Menu scene
src/Scene/MenuScene.cpp - Settings scene
src/Scene/SettingsScene.cpp - Single-player scene
src/Scene/SuperMarioSceneSingle.cpp - Multiplayer scene
src/Scene/SuperMarioSceneMultiplayer.cpp
Gameplay simulation
- Map loading
src/Scene/MapLoader.cpp - Game objects
src/GameObjects/GameObject.cpp - Gameplay components
src/Components/Component.cpp - Mario controls
src/Components/MarioController.cpp - Mario state machine
src/State/StateMachine.cpp - Box2D physics
src/Physics/PhysicsWorld.cpp - Collision system
src/CollisionSystem.cpp
Client presentation
- SDL renderer
src/Render/RendererSDL3.cpp - Asset manager
src/Manager/AssetManager.cpp - Animation frames
src/Manager/FrameManager.cpp
Configuration and networking
- Configuration
src/Manager/ConfigManager.cpp - Network manager
src/Network/NetworkManager.cpp - TCP transport
src/Network/TcpClient.h
Other components
- Player
- Game server
- WebSocket bridge
Connections 31
- Player → Program entry: launches
- Program entry → Game engine: initializes and starts
- Game engine → Configuration: loads
- Game engine → Asset manager: loads resources
- Game engine → Animation frames: loads frames
- Game engine → SDL renderer: creates window
- Game engine → Scene manager: creates and updates
- Scene manager → Menu scene: selects scene
- Scene manager → Settings scene: selects scene
- Scene manager → Single-player scene: selects scene
- Scene manager → Multiplayer scene: selects scene
- Game engine → SDL renderer: polls events; presents frames
- Single-player scene → Map loading: loads level
- Multiplayer scene → Map loading: loads level
- Single-player scene → Game objects: runs gameplay
- Multiplayer scene → Game objects: runs gameplay
- Game objects → Gameplay components: uses
- Gameplay components → Mario controls: includes
- Mario controls → Mario state machine: changes state
- Gameplay components → Box2D physics: simulates bodies
- Box2D physics → Collision system: reports contacts
- Single-player scene → SDL renderer: renders scene
- Multiplayer scene → SDL renderer: renders scene
- SDL renderer → Asset manager: gets textures
- Animation frames → Asset manager: gets texture handles
- Multiplayer scene → Network manager: updates session
- Network manager → TCP transport: sends and receives
- Game server → Network manager: connects by TCP
- Player → Network manager: connects directly
- WebSocket bridge → Game server: forwards WebSocket to TCP
- Settings scene → Configuration: edits settings