Skip to content

CatFortman/MonoGameFramework.Net8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MonoGameFramework.Net8

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.


Purpose

Provides reusable engine components and services. Architecture-agnostic.


Core Features (High Level)

  • 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

Project Breakdown

๐Ÿงฑ MonoGameLibrary (Engine Core)

This is the reusable โ€œengine layerโ€ used by both OOP and ECS templates.

Features

  • 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)

Used by

  • OOP Template โœ”
  • ECS Template โœ”

๐ŸŽฎ MonoGameEntry.OOP (Object-Oriented Template)

A traditional game architecture using scene-based OOP design.

Features

  • 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)

Best suited for

  • Game jams
  • Small to medium 2D games
  • Rapid prototyping
  • Learning MonoGame fundamentals

โš™๏ธ MonoGameEntry.ECS (Entity Component System Template)

A data-driven architecture using ECS principles.

Features

  • 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

Key ECS advantages

  • Separation of data and behaviour
  • Highly reusable systems
  • Easier scaling for large entity counts
  • Clear gameplay pipeline (Input โ†’ Movement โ†’ Physics โ†’ Collision โ†’ Render)

Best suited for

  • Simulation-heavy games
  • Large-scale entity systems
  • Long-term scalable projects
  • Experimentation with engine architecture

Mapping: Who Uses What

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

Solution Structure

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

Getting Started

Prerequisites

Install the following:

  • .NET 8 SDK
  • MonoGame templates/tools
  • OpenGL-compatible graphics drivers

Clone the Repository

git clone https://github.com/CatFortman/MonoGameFramework.Net8.git

Select Entry Project

cd MonoGameEntry.OOP     

or

cd MonoGameEntry.ECS     

Restore Dependencies

dotnet restore

Restore .NET Tools

dotnet tool restore

Build the Project

dotnet build

Run the Project

dotnet run

Content Pipeline

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

Future Improvements

Potential additions:

  • Animation system
  • Audio manager
  • Shader/effects support
  • Save/load system
  • Additional Scenes

Acknowledgements

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.

About

Modular MonoGame 3.8 framework with ECS + OOP architecture support and reusable engine systems for 2D game development.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages