Z8E Studios
Games Developer tools

Free · MIT licensed · version 3.1

ASGL2

Build 2D games once in C#, and ship them on Windows and Linux. Documented so your AI coding assistant can build with it too.

C# · .NET 10 · SDL2 · Windows · Linux

> dotnet new console -n MyGame
> cd MyGame
> dotnet add package ASGL2
> dotnet run
Screenshot of the ASGL2 UI demo: buttons, check boxes, labels and tooltips
166public types
1,851public members, documented from the code
11demo games and tools, with source
2 OSesWindows and Linux, one codebase

01 / CROSS-PLATFORM

One codebase. Windows and Linux.

The same game, the same code and the same assets run on both systems. Only the SDL2 libraries arrive differently.

Windows

dotnet run --project PlatformTest

Linux (Ubuntu, Debian, Mint…)

sudo apt install libsdl2-2.0-0 libsdl2-ttf-2.0-0 libsdl2-mixer-2.0-0
dotnet run --project PlatformTest

What ASGL2 handles for you

  • Windows, rendering, resizing and fullscreen through SDL2, at one logical size on any screen
  • Keyboard, mouse and gamepads by SDL scancode, identical on both systems
  • UTF-8 text through SDL2_ttf, sharp at any window scale
  • Sound effects and streamed music: WAV, OGG, MP3 and FLAC
  • Images decoded in managed code, with no System.Drawing
  • No Windows-only API anywhere in the library, so the tools run on Linux too

02 / INSIDE THE LIBRARY

Everything a 2D game needs.

  • Fixed 60 Hz logic, separate render loopGameplay feels the same on any machine, one state class per screen.
  • Sprites, parallax and a follow cameraSprite sheets, scrolling layers, dead zone, look-ahead, shake and, new in 3.1, zoom with render targets.
  • Levels painted, not codedJSON tile maps from the bundled Map Editor: collision layers, animated tiles, isometric maps and spawn markers with their own settings.
  • Input for every playerKeyboard, mouse and gamepads, with per-tick pressed and released edges and rebindable actions.
  • Sound and musicPooled effects with per-play volume, streamed music with fades, and pitch-bent loops.
  • UI, 3D and networkingA widget toolkit with modal dialogs, a software 3D renderer with OBJ models, and TCP server and client.
A large tile map with ladders, platforms and lava, painted in the ASGL2 Map Editor
A 130×200 tile map painted in the bundled Map Editor, which is itself built with ASGL2's UI widgets.

03 / AI-ASSISTED DEVELOPMENT

Written so your AI assistant can build with it.

Claude, Copilot, Cursor or any coding assistant is only as good as what it can read. ASGL2 keeps everything it needs in plain text next to the code.

AGENTS.mdThe repository layout, build and run commands for Windows and Linux, the conventions, and the rules for changing the library without breaking the games.
llms.txtAn index of every documentation page, on the docs site and inside the NuGet package.
Markdown docsThe API reference is generated from the code's own XML comments, so the docs and the code always agree.
One patternEvery demo is built the same way, so there is always working code to copy.

Try it: a prompt for your assistant

Read AGENTS.md and llms.txt. In PlatformTest, add a double jump with its own sound.
Update the demo's README, then build ASGL2.sln and tell me how to test it.
Last Launch title screen

// made with ASGL2

Last Launch, a pixel-art Metroidvania

Rooms painted in the Map Editor, two-player input, streamed music and one self-contained build per system. See the game →

04 / GET STARTED

Start building.

Add the package to a .NET 10 project, then install the SDL2 libraries for your system (the package readme lists them). The docs site has a first game, every guide and the full reference.

dotnet add package ASGL2
Read the docs Browse the demos NuGet package