CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever
1.0.270.1096
dotnet add package CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever --version 1.0.270.1096
NuGet\Install-Package CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever -Version 1.0.270.1096
<PackageReference Include="CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever" Version="1.0.270.1096" />
<PackageVersion Include="CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever" Version="1.0.270.1096" />
<PackageReference Include="CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever" />
paket add CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever --version 1.0.270.1096
#r "nuget: CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever, 1.0.270.1096"
#:package CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever@1.0.270.1096
#addin nuget:?package=CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever&version=1.0.270.1096
#tool nuget:?package=CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever&version=1.0.270.1096
CodeBrix.Platform.GameEngine
A fully managed, cross-platform 2D and 2.5D game engine for .NET. CodeBrix.Platform.GameEngine provides tile maps, sprites, layered scenes, camera/view systems, animation, physics and collision, input handling, audio, and SkiaSharp-based rendering — designed for tile-based worlds and a practical engine architecture.
This repository ships two core libraries, plus optional add-ons:
CodeBrix.Platform.GameEngine— the platform-agnostic engine core. It has no UI-framework dependency and is headless-testable; its rendering seam is SkiaSharpSKImageplus a render-surface-adapter abstraction.CodeBrix.Platform.GameEngine.Host— the host layer that runs the engine on CodeBrix.Platform, across all six heads (Windows Win32-Skia, Windows WPF-Skia, Linux X11, Linux Wayland, Linux Frame Buffer, macOS). It provides the CPU and GPU render-surface adapters, pointer/keyboard input adapters, and a UI dispatcher.CodeBrix.Platform.GameEngine.Sdl2— optional game controller (gamepad) support; see below.CodeBrix.Platform.GameEngine.KenneyAssets— optional Kenney asset bundle support; see below.CodeBrix.Platform.GameEngine.GeneratedMusic— optional generated in-game music; see below.
CodeBrix.Platform.GameEngine is provided as .NET 10 libraries and NuGet packages: CodeBrix.Platform.GameEngine.MitLicenseForever, which bundles both the engine-core (CodeBrix.Platform.GameEngine.dll) and host (CodeBrix.Platform.GameEngine.Host.dll) assemblies, the optional CodeBrix.Platform.GameEngine.Sdl2.ZlibLicenseForever for gamepads, the optional CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever for Kenney asset bundles, and the optional CodeBrix.Platform.GameEngine.GeneratedMusic.MitLicenseForever for generated music.
CodeBrix.Platform.GameEngine supports applications and assemblies that target Microsoft .NET version 10.0 and later. Microsoft .NET version 10.0 is a Long-Term Supported (LTS) version of .NET, and was released on Nov 11, 2025; and will be actively supported by Microsoft until Nov 14, 2028. Please update your C#/.NET code and projects to the latest LTS version of Microsoft .NET.
Installation
dotnet add package CodeBrix.Platform.GameEngine.MitLicenseForever
dotnet add package CodeBrix.Platform.GameEngine.Sdl2.ZlibLicenseForever
dotnet add package CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever
dotnet add package CodeBrix.Platform.GameEngine.GeneratedMusic.MitLicenseForever
Note that the NuGet package IDs and the namespaces are different - there is no package named plain CodeBrix.Platform.GameEngine:
- NuGet package ID:
CodeBrix.Platform.GameEngine.MitLicenseForever- Assemblies and primary namespaces:
CodeBrix.Platform.GameEngineandCodeBrix.Platform.GameEngine.Host- i.e.using CodeBrix.Platform.GameEngine; - One reference gives you both assemblies; there is no separate
.Hostpackage.
- Assemblies and primary namespaces:
- NuGet package ID:
CodeBrix.Platform.GameEngine.Sdl2.ZlibLicenseForever- Assembly and primary namespace:
CodeBrix.Platform.GameEngine.Sdl2- i.e.using CodeBrix.Platform.GameEngine.Sdl2;
- Assembly and primary namespace:
- NuGet package ID:
CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever- Assembly and primary namespace:
CodeBrix.Platform.GameEngine.KenneyAssets- i.e.using CodeBrix.Platform.GameEngine.KenneyAssets;
- Assembly and primary namespace:
- NuGet package ID:
CodeBrix.Platform.GameEngine.GeneratedMusic.MitLicenseForever- Assembly and primary namespace:
CodeBrix.Platform.GameEngine.GeneratedMusic- i.e.using CodeBrix.Platform.GameEngine.GeneratedMusic;
- Assembly and primary namespace:
Which one do I reference? Every game references CodeBrix.Platform.GameEngine.MitLicenseForever. Add CodeBrix.Platform.GameEngine.Sdl2.ZlibLicenseForever only when you want game controller (gamepad) support - it is a separate package precisely so that games which do not want a native SDL2 dependency do not inherit one. Add CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever only when your game loads Kenney asset bundles, and CodeBrix.Platform.GameEngine.GeneratedMusic.MitLicenseForever only when it plays generated music, for the same reason.
XML documentation (IntelliSense) ships alongside the assemblies.
The engine package pulls in the following automatically; no version pinning is needed in the consuming project:
CodeBrix.Platform.ApacheLicenseForever- the UI platformCodeBrix.Platform.SkiaSharp.Views.MitLicenseForever- the XAML canvas the engine renders intoCodeBrix.Platform.Graphics3DGL.ApacheLicenseForever- the GPU render pathCodeBrix.Platform.Svg.ApacheLicenseForeverandCodeBrix.SkiaSvg.MitLicenseForever- SVG drawingSkiaSharp- the rendering engineCodeBrix.Audio.MitLicenseForever- device audio I/OCodeBrix.Compression.MitLicenseForeverandCodeBrix.Json.Extensions.MitLicenseForever- save/loadMicrosoft.Extensions.Configuration(plus.Binderand.Json) andMicrosoft.Extensions.Logging.Console/.Debug
Your game is a CodeBrix.Platform application, so each executable project also adds exactly one CodeBrix.Platform head package - for example CodeBrix.Platform.Runtime.Skia.X11.ApacheLicenseForever for Linux X11 - and that head supplies the SkiaSharp native libraries. Add CodeBrix.Audio.Opus.BsdLicenseForever if you want .opus audio assets.
CodeBrix.Platform.GameEngine supports:
- Tile maps, tilesheets, and layered scenes with camera/view systems — seven tile geometries (orthogonal, two isometric, two hex, oblique-right and oblique-left)
- Pixel layers for games without a tile map: a layer sized in world pixels that carries sprites, particles, health bars and a game's own drawings, with no tile grid to fake
- Wrapping (periodic) scene layers: an endlessly repeating world with no seam, across rendering, collision queries, camera follow and world-space drawings, on every tile geometry
- A logical render resolution that is independent of the window: pick an exact size or a scale factor, and the finished image is fitted, centred and letterboxed — with linear or nearest-neighbour presentation filtering, and pointer input normalized into the same coordinate space
- Sprites, composite sprites, sprite rotation, and frame-based animation cycles, where any frame may hold for its own length of time
- Direct drawing primitives (images, rectangles with pattern and image fills, SVG, text, particles, image-instance layers)
- Draw lists: build a list of images, rectangles, circles, text and clickable regions each frame, publish it as a finished copy, and let one drawing paint it — safe with GPU rendering by construction, because the renderer only ever reads a list the game has finished
- Radial lights and darkness/fog overlays that lights carve holes in
- Display effects over a whole view or layer: fades, wipes, slides, zooms and an earthquake shake
- Ready-made components: a self-disposing splash overlay and a health bar that tracks a sprite or any world-pixel point
- Physics: movement, easing, scripted motion, and collision detection — with named collision profiles, per-tile and per-animation-frame collision shapes and types, all authorable in a
.gtstilesheet definition - Input: keyboard, mouse, gamepad, and touch (with tap, swipe and pinch gestures)
- Input actions: named actions bound to any mix of keys, gamepad buttons, D-pad and stick directions, with swappable control profiles, presses latched so a tap shorter than a game step is never lost, hold-to-repeat, a stick that reads as a clean menu direction, every connected gamepad at once, and the last device used for on-screen prompts
- Audio playback and mixing (via CodeBrix.Audio): master/music/sfx volume buses, a preload-to-PCM sound-effect voice pool, per-clip playback speed, and support for WAV, MP3, Ogg Vorbis and FLAC out of the box (plus any other format registered with CodeBrix.Audio, such as Opus)
- MIDI music rendered live through a sampled instrument — SoundFont, SFZ and Decent Sampler instruments — with per-channel layering, a tempo control that does not change pitch, and MPE
- A music system: fades and equal-power crossfades, reference-counted ducking, stingers (on the music bus, or on the effects bus so a warning cue is heard whatever the music slider says, with a duck held until you release it), playlists, layered adaptive stems (including the stems of a Suno download, loaded straight from the zip or folder), and transitions quantised to the next beat or bar — exactly, through the tempo map, even where the music changes tempo
- Endless streaming music: a provider contract for music that is produced as it plays (generated music, a procedural score), played with one call and handled by the music system like any other track — silence while the provider starts or falls behind is part of the contract, never an error
- Save/load of engine state as JSON (via System.Text.Json + CodeBrix.Json.Extensions), including shared-reference object graphs
- Asset bundles (zip-based, optionally encrypted) loaded from a file or from any readable stream, such as an embedded resource or a packaged app asset
- An opt-in fixed-step update hook for deterministic game logic at a set rate, capped against stalls and frozen across the pause
- A global pause that parks the whole engine at near-zero CPU and shifts every time baseline on resume, so nothing bursts or teleports
- One-call window wiring: pause while minimized, resume when shown, and keyboard focus back to the game whenever the window is activated
- Opening links in the player's browser from any thread, with a plain yes/no answer instead of an exception
- A UI-agnostic core with a render-surface-adapter seam for headless unit testing
Samples
Ten complete games and demos live under samples/, each with Linux X11, Windows Win32-Skia and macOS heads and its own .slnx:
Spot.Brix— the recommended hosting shape end to end: splash overlay, a XAML New Game dialog driving the engine, option persistence and save-on-game-overPlatformer.Brix— a side-view platform game: tile colliders, collision profiles,CollisionAdjustinsets, gravity and jumping, camera follow, stompable enemies, and a pinned 960x576 letterboxed render resolution kept crisp with nearest-neighbour presentation filteringSpaceDuel.Brix— a GPU-tier space duel: rotated sprites, a wrap-around world, parallax star layers, particle explosions, health bars and a splashKenneyAssetsDemo— the Kenney asset reference: bundles registered with one call, a Tiled map imported into scene layers, a pre-rendered 3D character walking in eight directions, atlas sprites, a sound, HUD text in a Kenney font and a rasterised SVG iconSlider,CoordinateTest,ParticleTest,SoftRender,GpuRender,MusicDemo— focused references for the engine-direct hosting path, coordinate systems and layer wrapping, particles, the software-rendered (Mode B) path, GPU rendering and the music system
See EXTRAS-README.txt for what each one demonstrates.
Sample Code
Creating and configuring the engine
using System;
using System.IO;
using CodeBrix.Platform.GameEngine;
using CodeBrix.Platform.GameEngine.Configuration;
// Load engine configuration. The settings live under an "EngineConfig" root key,
// and the default file name is relative to the process working directory — pass
// an absolute path for a predictable location.
var configPath = Path.Combine(AppContext.BaseDirectory, "gameengine.json");
var config = EngineConfigurationFile.Load(configPath, autoSave: true);
// The engine is created and driven by the host layer
// (CodeBrix.Platform.GameEngine.Host) on a CodeBrix.Platform surface.
Gamepad support (optional)
Game controller support ships as a separate NuGet package, so that games which do not want a native SDL2 dependency do not inherit one:
dotnet add package CodeBrix.Platform.GameEngine.Sdl2.ZlibLicenseForever
One call attaches it to the engine, which then polls it every frame:
using CodeBrix.Platform.GameEngine.Sdl2;
var gamepads = Engine.Instance.InitializeSdlGamepadManager();
It works on all six heads — including Frame Buffer — because SDL2 is initialized as a headless joystick backend with no video subsystem. It never throws when SDL2 or a controller is missing; ask gamepads.IsAvailable and gamepads.UnavailableReason instead.
The package carries the SDL2 native binaries for Windows and macOS. On Linux it uses the system SDL2, which is its one prerequisite: sudo apt install libsdl2-2.0-0.
Kenney asset bundles (optional)
Support for the asset bundles published by Kenney ships as a separate NuGet package, so that games which do not load them inherit neither the bundle reader nor its glTF dependency:
dotnet add package CodeBrix.Platform.GameEngine.KenneyAssets.MitLicenseForever
One call registers the bundles a game ships - as downloaded .zip files, as folders extracted from them, or as a folder holding many of those - and every asset in them then has a key the engine resolves:
using CodeBrix.Platform.GameEngine.KenneyAssets;
Engine.Instance.UseKenneyAssets("assets/kenney_puzzle-pack.zip");
var sheet = Engine.Instance.Managers.AssetProviders.LoadTilesheet(
"kenney:puzzle-pack/Spritesheet/spritesheet_default");
var ball = sheet["ballBlue", 0, 0];
Nothing is unpacked, renamed or repacked: the bundles are read where they lie. Images, sprite atlases, audio, fonts, SVG, Tiled maps and glTF models all become ordinary engine objects - tilesheets, audio resources, typefaces, scene layers, and models either as data or as pre-rendered sprite frames a 2D game can draw. It is the first implementation of the engine's asset-provider contract, so it is also the worked example for a provider of your own. Kenney's content is CC0 and is not part of the package.
A game that registers from more than one place can call RegisterKenneyAssets instead, which skips a bundle already registered and reports per bundle what was read, skipped, missing or unreadable. Every pack carries a ready-made credit line (CreditLines for all of them), CheckKeys tells a game's tests which of its hand-written keys do not resolve and what kind each one is, and GetKeyCatalog lists every key by pack - with the frame names inside each sprite atlas - to copy exact spellings from. A key that does not resolve names its closest real keys in the error message.
Generated music (optional)
Endless, model-generated in-game music ships as a separate NuGet package, so that games which do not use it do not inherit the music generation stack:
dotnet add package CodeBrix.Platform.GameEngine.GeneratedMusic.MitLicenseForever
Register an instrument library and, usually, a model package's generator at start-up, and one call starts the music on the engine's music bus - where fades, crossfades, ducking, stingers and the global pause work on it like on any other track:
using CodeBrix.Audio.ModestSynth;
using CodeBrix.Audio.MusicGeneration.SkyTNT;
using CodeBrix.Platform.GameEngine.GeneratedMusic;
GeneralMidiInstrumentLibrary.Register();
SkyTNTModel.Register();
var music = Engine.Instance.UseGeneratedMusic(new GeneratedMusicOptions { Preset = "ClubArrangement" });
music.FollowUp("FourOnTheFloor"); // new music for the next level, at a bar line
The music is generated while the game runs and never ends; silence while a model loads or falls behind is part of the design, never an error. With no model registered a recorded piece plays in its place, and the engine log says so. The package registers no instruments and no model of its own: those are the game's choices, one Register() line each. It is the first implementation of the engine's streaming-music provider contract, so it is also the worked example for a provider of your own. A game's music policy can be unit-tested with no model and no audio device: the provider is an IGeneratedMusicSession, starting one goes through IGeneratedMusicStarter, and the engine's MusicManager is an IMusicManager, so a test hands the game's music code scripted fakes.
Documentation
The NuGet package includes AGENT-README.txt, a complete API reference and usage guide written for AI coding agents - point your agent at that file when it is writing code against this library.
The gamepad package carries its own AGENT-README.txt, covering the controller API and the gotchas worth knowing before wiring a game to it; point your agent at that file as well when the game uses gamepads. The Kenney asset package carries its own AGENT-README.txt too, covering asset keys, the per-kind rules and the limits of its Tiled and model support; and so does the generated-music package, covering its options, follow-ups and degraded paths.
Additional sample code and usage examples are available in the CodeBrix.Platform.GameEngine.Tests project:
https://github.com/ellisnet/CodeBrix.Platform.GameEngine/tree/main/tests/CodeBrix.Platform.GameEngine.Tests
License
CodeBrix.Platform.GameEngine is licensed under the MIT License - see the LICENSE file.
The optional CodeBrix.Platform.GameEngine.Sdl2.ZlibLicenseForever package is licensed MIT AND Zlib, because it redistributes the SDL2 native libraries.
For licensing and provenance information about the open source code included in these packages, see THIRD-PARTY-NOTICES.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- CodeBrix.Graphics3D.Gltf2.MitLicenseForever (>= 1.0.261.293)
- CodeBrix.Platform.GameEngine.MitLicenseForever (>= 1.0.270.1082)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.270.1096 | 40 | 9/27/2026 |
| 1.0.268.235 | 54 | 9/25/2026 |
| 1.0.262.1032 | 81 | 9/19/2026 |