How 16byte/patientzero works
Patient Zero is a 2D game with a companion level editor. The principal workflow is: a designer creates grid-based objects and levels, the game loads level JSON and manifests into entities, then a play state advances fixed-timestep gameplay using player input, character controllers, collision physics, and rendering. The sampled code confirms editor serialization, manifest-based instantiation, input assignment, controller movement, and collision resolution; game-entry wiring and several component interactions are inferred only from unsampled tree structure.
Main entry points: LevelManager.cpp Level Manager · main.cpp Editor UI · PhysicsManager.cpp Physics Manager · PlayState.cpp Play State
Components 19
Level Editor
- Editor UI
editor/src/main.cpp - Asset Browser
editor/src/AssetBrowser.cpp - Node Editor
editor/src/NodeEditor.cpp - Level Data
Runtime Flow
- Game Entry
game/src/main.cpp - State Manager
game/src/GameStateManager.cpp - Play State
game/src/states/PlayState.cpp - Level Manager
game/src/LevelManager.cpp - Entity Model
game/src/Entity.cpp
Gameplay Systems
- Gameplay Components
game/include/components - Input Manager
game/src/InputManager.cpp - Character Controller
game/src/components/CharacterController.cpp - Physics Manager
game/src/physics/PhysicsManager.cpp - Collision Resolver
game/include/physics/CollisionResolver.h
Content and Rendering
- Asset Catalog
- Asset Loader
game/src/AssetLoader.cpp - Render Components
game/src/components/SpriteRenderer.cpp
Other components
- Level Designer
- Player
Connections 21
- Level Designer → Editor UI: edits levels
- Editor UI → Asset Browser: loads assets
- Editor UI → Node Editor: edits objects
- Editor UI → Level Data: writes JSON
- Editor UI → Asset Catalog: writes manifests
- Asset Browser → Asset Catalog: reads assets
- Game Entry → State Manager: starts states
- State Manager → Play State: dispatches updates
- Play State → Level Manager: loads level
- Level Manager → Asset Loader: loads manifests
- Level Manager → Level Data: reads JSON
- Level Manager → Entity Model: creates entities
- Level Manager → Gameplay Components: adds components
- Level Manager → Render Components: adds sprites
- Player → Input Manager: provides input
- Input Manager → Character Controller: feeds movement
- Character Controller → Physics Manager: reports collisions
- Physics Manager → Collision Resolver: resolves contacts
- Physics Manager → Character Controller: notifies collision
- Physics Manager → Entity Model: moves transforms
- Play State → Render Components: draws world