Skip to content

Asthegor/DinaGameEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dina Game Engine Logo

Dina Game Engine

A visual 2D game editor for C# developers — powered by MonoGame and DinaCSharp

License: MIT .NET MonoGame Version


What is Dina Game Engine?

Dina Game Engine is a WPF-based visual editor that lets you create and manage 2D games built on MonoGame and the DinaCSharp framework.

The goal is simple: get a fully functional game project up and running in seconds, without manually setting up solutions, projects, or boilerplate code. The engine generates clean, readable C# code that you can open, understand, and extend in Visual Studio — no black boxes, no locked files.

Dina Game Engine is designed for C# developers new to MonoGame who want a solid starting point without spending hours on project configuration.


✨ Features

  • One-click project creation — generates a complete, ready-to-run Visual Studio solution built on MonoGame and DinaCSharp
  • Automatic code generationDesigner.cs files managed by the engine, .cs files yours to edit
  • Built-in main menu and options screen — functional from day one
  • Automatic DinaCSharp integration — the engine handles the framework dependency for you
  • Localization support — multi-language projects out of the box (14 languages)
  • Recent projects list — with pinning, grouping by date, and context menu
  • Partial class architecture — engine code and user code clearly separated, never overwritten

🎬 See it in action

From zero to a running game in seconds.

Dina Game Engine Demo


🚀 Getting Started

Prerequisites

Installation

  1. Download the latest release from GitHub Releases
  2. Extract the archive and run DinaGameEngine.exe
  3. Create your first project — the editor handles the rest

🗂️ Generated Project Structure

Every project Dina creates is a standard, fully buildable Visual Studio solution:

MyGame/
├── MyGame.slnx
├── DinaCSharp.dll          ← framework, bundled automatically
├── DinaCSharp.xml          ← IntelliSense documentation
├── MyGame.Core/            ← keys, enums, palette colors, shared constants
├── MyGame.Assets/          ← textures, sprites, sounds, etc.
├── MyGame.Scenes/          ← scene classes (Designer.cs + user .cs pairs)
└── MyGame/                 ← main game entry point

The partial class pattern keeps generated code and your code cleanly separated:

// MyScene.Designer.cs — managed by the engine, never edit manually
// MyScene.cs          — yours entirely, never overwritten (except for the activation function of MenuItems)

partial void OnLoad()                          { }
partial void OnUpdate(GameTime gameTime)       { }
partial void OnDraw(SpriteBatch spriteBatch)   { }

🧩 Components

Components are added to scenes through the editor. Each one generates the corresponding C# code immediately.

Text

Display static or dynamic text in a scene.

Property Description
Font Chosen from the project's font library
Content The text string (localization key or literal)
Color Named color from the project palette
Position World position (X, Y)
Dimensions Optional bounding box
Alignment Horizontal and vertical
Z-Order Rendering layer
Visibility Show/hide at load

MenuManager

A full-featured interactive menu system.

Menu-level properties: item spacing, direction (vertical/horizontal), action key bindings, icon support (left/right icons with alignment and spacing).

Titles — decorative header text above the menu:

Property Description
Font, Content, Color Standard text appearance
Position Explicit position or centered via CenterTitles
Shadow Optional drop shadow with separate color and offset
Z-Order, Visibility Rendering control

Items — interactive menu entries:

Property Description
Font, Content, Color Standard text appearance
State Enable / Disable
Position, Dimensions Layout control
Z-Order, Visibility Rendering control

For each item, the engine generates three partial callback methods ready to implement:

// MyScene.cs
partial MenuItem OnMyMenuItemSelection(MenuItem item)   { return item; }
partial MenuItem OnMyMenuItemDeselection(MenuItem item) { return item; }
partial MenuItem OnMyMenuItemActivation(MenuItem item)  { return item; }

🎨 Color System

Colors are defined once in the editor as a named palette (PaletteColors class) and referenced by key throughout the project. Changing a color in the editor updates every component that uses it.


🔤 Font Management

Add a TrueType font to the project and the engine automatically generates SpriteFont definitions at five resolutions (proportionally scaled from 720p to 2160p). All fonts are accessible in code via the generated FontKeys class.


🏗️ Architecture

Code generation

The engine uses a strategy pattern (IComponentGenerator / ComponentGeneratorRegistry) to handle each component type independently. Adding support for a new component type requires implementing a single interface — nothing else changes.

File modifications use a zone marker system (SectionParser) that surgically inserts and removes code within named regions, making updates safe and idempotent.

Scene Designer.cs files are fully regenerated on each change to guarantee that field declarations, load calls, update calls, and draw calls always appear in the correct order.

Partial class system

File Owner Rule
MyScene.Designer.cs Engine Regenerated automatically — never edit
MyScene.cs Developer Never touched by the engine

Dependency injection

Manual constructor injection throughout — no third-party DI framework.


🗺️ Roadmap

  • Image component
  • Sound component
  • Transition system
  • Additional component types
  • GitHub wiki

📄 License

MIT — see LICENSE for details.


👤 Author

Dominique Lacombe — solo developer, Montreal.
Coding since age 9. Building tools I wish had existed when I started.

About

Dina Game Engine is a visual editor for creating 2D games based on MonoGame and DinaCSharp

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages