A modular MonoGame 3.8 (DesktopGL) framework built on .NET 8, designed for building scalable 2D games with clean architectural separation.
It provides a reusable engine-style foundation supporting both Entity Component System (ECS) and Object-Oriented (scene-based) design, allowing developers to choose or combine paradigms depending on project needs.
Provides reusable engine components and services. Architecture-agnostic.
- Built on .NET 8
- Uses MonoGame 3.8 DesktopGL
- Clean separation between engine library and game projects
- Shared reusable game framework (
MonoGameLibrary) - Content Pipeline integration (
.mgcb) - Input abstraction layer (keyboard, mouse, gamepad)
- 2D rendering utilities (sprites, animation, tilemaps)
- Lightweight scene system (OOP + ECS support)
- Audio support (SFX + music via MonoGame MediaPlayer)
- Ready-to-run game architecture
This is the reusable โengine layerโ used by both OOP and ECS templates.
- Game lifecycle abstraction (
GameContext) - Graphics abstraction (
SpriteBatch, rendering helpers) - Input system abstraction (keyboard, mouse, gamepad)
- Scene management foundation (
Scene,IEcsScene) - Sprite system:
- Static sprites
- Animated sprites
- Tilemap rendering system
- Basic collision primitives (Circle, Rectangle helpers)
- ECS foundation (EntityManager, SystemManager, components)
- OOP Template โ
- ECS Template โ
A traditional game architecture using scene-based OOP design.
- Scene-driven architecture (
IScene) - Direct entity/state management
- Manual game loop logic per scene
- Built-in support for:
- Sprite animation
- Tilemaps
- Input handling (WASD / Arrow keys)
- Sound effects
- Background music
- Simple collision handling (rectangle & circle-based)
- Immediate feedback loop design (ideal for prototyping)
- Game jams
- Small to medium 2D games
- Rapid prototyping
- Learning MonoGame fundamentals
A data-driven architecture using ECS principles.
- Entity Component System (ECS) architecture
- Component-based design:
- Position / Velocity
- Sprite / Bounds
- Tags (Player, Enemy)
- Audio components (SoundEffect-based)
- System-driven logic:
- InputSystem
- MovementSystem
- BounceSystem
- CollisionSystem (event-based optional mode)
- RenderSystem
- World bounds constraint system
- Collision event pipeline (
ICollisionEventScene) - Decoupled gameplay logic via systems
- Scalable architecture for complex simulations
- Separation of data and behaviour
- Highly reusable systems
- Easier scaling for large entity counts
- Clear gameplay pipeline (Input โ Movement โ Physics โ Collision โ Render)
- Simulation-heavy games
- Large-scale entity systems
- Long-term scalable projects
- Experimentation with engine architecture
| Component | OOP Template | ECS Template |
|---|---|---|
| Core | Yes | Yes |
| GameContext | Optional | Yes |
| Graphics | Yes | Yes |
| Input | Yes | Yes |
| Models | Yes | Yes |
| Scene System | Yes | Yes (ECS version) |
| IGameSystem | No | Yes |
| SystemManager | No | Yes |
| EntityManager | Optional | Yes |
MonoGameFramework.Net8/
โโ
โโโ MonoGameEntry.ECS/
โ โโโ Content/
โ โ โโโ Audio/
โ โ โโโ Fonts/
โ โ โโโ Maps/
โ โ โโโ Content.mgcb
โ โโโ ECS/
โ โ โโโ Components/
โ โ โโโ Systems/
โ โโโ Game/
โ โ โโโ Bootstrap/
โ โ โโโ Scenes/
โ โ โโโ Game1.cs
โ โโโ MonoGameEntry.ECS.csproj
โ
โโโ MonoGameEntry.OOP/
โ โโโ Content/
โ โ โโโ Audio/
โ โ โโโ Fonts/
โ โ โโโ Maps/
โ โ โโโ Content.mgcb
โ โโโ Entities/
โ โโโ Game/
โ โ โโโ Bootstrap/
โ โ โโโ Scenes/
โ โ โโโ Game1.cs
โ โโโ Services/
โ โโโ MonoGameEntry.OOP.csproj
โ
โโโ MonoGameLibrary/
โ โโโ Bootstrap/
โ โโโ ECS/
โ โ โโโ Interfaces/
โ โ โโโ Systems/
โ โ โโโ ComponentStore.cs/
โ โ โโโ Entity.cs/
โ โ โโโ EntityManager.cs/
โ โโโ Graphics/
โ โโโ Input/
โ โโโ Models/
โ โโโ Scenes/
โ โโโ Core.cs
โ โโโ GameContext.cs
โ โโโ MonoGameLibrary.csproj
โ
โโโ MonoGameFramework.sln
Install the following:
- .NET 8 SDK
- MonoGame templates/tools
- OpenGL-compatible graphics drivers
git clone https://github.com/CatFortman/MonoGameFramework.Net8.git
cd MonoGameEntry.OOP
or
cd MonoGameEntry.ECS
dotnet restore
dotnet tool restore
dotnet build
dotnet run
This project includes support for the MonoGame Content Pipeline.
Example asset folders:
Content/
โโโ Audio/
โโโ Sprites/
โโโ Fonts/
โโโ Maps/
Assets can be managed via:
dotnet mgcb-editor ./Content/Content.mgcb
Potential additions:
- Animation system
- Audio manager
- Shader/effects support
- Save/load system
- Additional Scenes
This project is built using MonoGame and is inspired by the tutorial series created by Aristurtle.
Portions of the architecture and learning structure were derived from public educational content.
Credit is also due to u/JustARandomDude112 for architectural ideas and design discussions that helped shape parts of this framework.