How jamesmcmahon/monocle-engine works
Monocle is a 2D game runtime framework. Its central workflow is the engine updating input and the current scene; the scene manages entities and their components, while renderers draw visible content and entities use colliders for spatial queries. Supporting branches provide virtual input, graphics and textures, particles, timing/state logic, and developer commands. Relationships reflect the excerpts and SOURCE INDEX references; unsampled subsystems are included where the tree identifies them, but their internal wiring is not asserted.
Main entry points: Engine.cs Engine loop · Scene.cs Scene manager · Entity.cs Entity · Component.cs Component lifecycle
Components 27
Runtime and Scenes
- Engine loop
Monocle/Engine.cs - Scene manager
Monocle/Scene.cs - Entity lists
Monocle/InternalUtilities/EntityList.cs
Entities and Collision
- Entity
Monocle/Entity.cs - Component lifecycle
Monocle/Components/Component.cs - Object tracker
Monocle/Util/Tracker.cs - Collidable component
Monocle/Components/CollidableComponent.cs - Collider shapes
Monocle/Colliders/Collider.cs - Collision queries
Monocle/Colliders/Collide.cs - Hitbox collider
Monocle/Colliders/Hitbox.cs - Grid collider
Monocle/Colliders/Grid.cs - Circle collider
Monocle/Colliders/Circle.cs
Graphics and Rendering
- Renderer base
Monocle/Renderers/Renderer.cs - Tag renderers
Monocle/Renderers/SingleTagRenderer.cs - Camera
Monocle/Util/Camera.cs - Drawing primitives
Monocle/Util/Draw.cs - Texture regions
Monocle/Graphics/MTexture.cs - Texture atlas
Monocle/Graphics/Atlas.cs - Sprite component
Monocle/Components/Graphics/Sprite.cs - Particle system
Monocle/Particles/ParticleSystem.cs - Text graphics
Monocle/Components/Graphics/Text/Text.cs
Input and Utilities
- Input polling
Monocle/Input/MInput.cs - Virtual controls
Monocle/Input/VirtualInput.cs - Command console
Monocle/Util/Commands.cs - Math utilities
Monocle/Util/Calc.cs - Logic components
Monocle/Components/Logic
Other components
- Game host
Connections 31
- Game host → Engine loop: starts
- Engine loop → Input polling: initializes
Monocle/Engine.cs - Engine loop → Command console: creates
Monocle/Engine.cs - Engine loop → Scene manager: updates
Monocle/Engine.cs - Engine loop → Drawing primitives: initializes
Monocle/Engine.cs - Scene manager → Entity lists: manages
Monocle/Scene.cs - Scene manager → Object tracker: creates
Monocle/Scene.cs - Scene manager → Renderer base: manages
Monocle/Scene.cs - Tag renderers → Renderer base: extends
Monocle/Renderers/SingleTagRenderer.cs - Entity lists → Entity: manages
Monocle/InternalUtilities/EntityList.cs - Entity → Component lifecycle: owns
Monocle/Entity.cs - Entity → Collider shapes: uses
Monocle/Entity.cs - Component lifecycle → Object tracker: registers with
Monocle/Components/Component.cs - Collidable component → Component lifecycle: extends
Monocle/Components/CollidableComponent.cs - Collidable component → Collider shapes: uses
Monocle/Components/CollidableComponent.cs - Collider shapes → Collision queries: dispatches to
Monocle/Colliders/Collider.cs - Circle collider → Collision queries: queries
Monocle/Colliders/Circle.cs - Circle collider → Hitbox collider: dispatches to
Monocle/Colliders/Circle.cs - Circle collider → Grid collider: dispatches to
Monocle/Colliders/Circle.cs - Collision queries → Math utilities: uses
Monocle/Colliders/Collide.cs - Input polling → Virtual controls: updates
Monocle/Input/MInput.cs - Command console → Input polling: reads
Monocle/Util/Commands.cs - Sprite component → Texture atlas: loads from
Monocle/Components/Graphics/Sprite.cs - Sprite component → Texture regions: draws with
Monocle/Components/Graphics/Sprite.cs - Texture atlas → Texture regions: creates
Monocle/Graphics/Atlas.cs - Texture regions → Drawing primitives: draws through
Monocle/Graphics/MTexture.cs - Text graphics → Drawing primitives: renders through
Monocle/Components/Graphics/Text/Text.cs - Particle system → Entity: extends
Monocle/Particles/ParticleSystem.cs - Particle system → Math utilities: uses
Monocle/Particles/ParticleSystem.cs - Camera → Engine loop: reads
Monocle/Util/Camera.cs - Logic components → Component lifecycle: extends
Monocle/Components/Logic/Tween.cs