Skip to content

Home

A code-first 2D game engine for .NET 10.
No editor. No visual tools. Just C#.


What is Brine2D?

Brine2D is a full 2D game engine — not a rendering library. Scenes, entities, audio, input, collision, particles, UI, and dependency injection all ship in a single NuGet package and work out of the box. Everything you'd normally spend the first two weeks wiring up is already here.

There is no built-in editor. Everything is configured in code. For content creation, Brine2D integrates with the tools you likely already use:

  • Aseprite — sprite and animation authoring, imported directly via JSON export
  • Tiled — tile map editor, loaded natively at runtime
  • TexturePacker — sprite atlas packing, supported out of the box

These are best-in-class tools with their own communities and years of polish. You get a better result than any built-in editor would provide, and you don't have to learn a new one. Read more about why Brine2D has no editor.

var builder = GameApplication.CreateBuilder(args);

builder.Configure(options =>
{
    options.Window.Title = "My Game";
    options.Window.Width  = 1280;
    options.Window.Height = 720;
});

builder.AddScene<GameScene>();

await using var game = builder.Build();
await game.RunAsync<GameScene>();
public class GameScene : Scene
{
    protected override void OnRender(GameTime gameTime)
    {
        Renderer.DrawText("Hello, Brine2D!", 100, 100, Color.White);
    }

    protected override void OnUpdate(GameTime gameTime)
    {
        if (Input.IsKeyPressed(Key.Escape))
            Game.RequestExit();
    }
}

That's a window, a game loop, input, and rendering. No boilerplate, no XML, no content pipeline.


Common tasks

I want to... Go here
Create my first game Quickstart
Understand entities, components, and behaviors ECS Overview
Load and play sprite animations Animation
Handle keyboard, mouse, and gamepad input Input
Play audio with spatial sound Audio
Load a Tiled map Tilemaps
Add a UI button or dialog UI
Detect collisions between objects Collision
Switch between scenes Scene Management
Understand the overall architecture Architecture

Features

Feature What it does
GPU Rendering Hardware-accelerated via SDL3 GPU (Vulkan / Metal / D3D12). Sprites, sprite sheets, animations, cameras, line drawing, render targets.
Hybrid ECS Components for data, Behaviors for per-entity logic with DI, Systems for batch processing. One World per scene, cleaned up automatically.
Scene Management Async loading, transitions with fades, loading screens with progress. Register scenes at startup, swap at runtime.
Asset Pipeline Unified IAssetLoader with ref-counted caching. Typed AssetManifest for parallel preloading. Assets release when the scene unloads.
Input Keyboard, mouse, gamepad. Polling and event-driven. Input layers for UI-eats-input patterns.
Spatial Audio Distance attenuation, stereo panning, configurable falloff. Plugs into ECS with audio source/listener components.
Particles GPU-accelerated emitters with configurable lifetime, integrated with ECS.
Collision AABB and circle colliders, spatial queries, collision events.
UI Buttons, sliders, text inputs, dialogs, tabs, scroll views, tooltips, dropdowns.
DI everywhere Built on Microsoft.Extensions.DependencyInjection. Scenes and Behaviors get constructor injection. Framework services come as properties - no wiring needed.

Project structure

One NuGet package. No separate renderer or platform packages.

Brine2D/
├── Assets        # Loading, caching, manifests
├── Audio         # Playback, spatial audio, SDL3 backend
├── Core          # GameTime, Color, math helpers
├── ECS           # Entities, components, behaviors, systems, queries
├── Engine        # Game loop, scenes, transitions, loading screens
├── Hosting       # Builder, options, DI wiring
├── Input         # Keyboard, mouse, gamepad, input layers
├── Rendering     # Sprites, text, cameras, particles, SDL3 GPU backend
└── UI            # Components, layout, input handling

Requirements

  • .NET 10 SDK
  • Windows, macOS, or Linux
  • SDL3 (ships automatically via the SDL3-CS NuGet dependency)

  • Quickstart


    From dotnet new to a running game in five minutes.

    Get Started

  • Tutorials


    Step-by-step: sprites, input, animation, collision.

    Tutorials

  • Fundamentals


    Architecture, scenes, ECS, DI - how it all fits together.

    Fundamentals

  • Feature Demos


    Runnable samples for every major subsystem.

    Samples


MIT licensed. Made with ❤ by CrazyPickle Studios 🥒