NeoKolors.Tui.Lifecycle.Game2D
2026.4.0-preview.2
dotnet add package NeoKolors.Tui.Lifecycle.Game2D --version 2026.4.0-preview.2
NuGet\Install-Package NeoKolors.Tui.Lifecycle.Game2D -Version 2026.4.0-preview.2
<PackageReference Include="NeoKolors.Tui.Lifecycle.Game2D" Version="2026.4.0-preview.2" />
<PackageVersion Include="NeoKolors.Tui.Lifecycle.Game2D" Version="2026.4.0-preview.2" />
<PackageReference Include="NeoKolors.Tui.Lifecycle.Game2D" />
paket add NeoKolors.Tui.Lifecycle.Game2D --version 2026.4.0-preview.2
#r "nuget: NeoKolors.Tui.Lifecycle.Game2D, 2026.4.0-preview.2"
#:package NeoKolors.Tui.Lifecycle.Game2D@2026.4.0-preview.2
#addin nuget:?package=NeoKolors.Tui.Lifecycle.Game2D&version=2026.4.0-preview.2&prerelease
#tool nuget:?package=NeoKolors.Tui.Lifecycle.Game2D&version=2026.4.0-preview.2&prerelease
NeoKolors.Tui.Lifecycle.Game2D
NeoKolors.Tui.Lifecycle.Game2D is a dedicated 2D terminal game engine providing fixed-timestep game loops, 2D camera viewport transformations, and modular multi-stage rendering pipelines.
Architecture
┌─────────────────────────┐
│ Game2DLoop │
└────────────┬────────────┘
│
┌───────────────────────┴────────────────────────┐
▼ ▼
┌────────────────────────┐ ┌───────────────────────┐
│ FixedTimestep Tick │ │ Variable Render Tick │
│ - Physics & Logic │ │ - Render2DPipeline │
│ - 60 Hz deterministic │ │ - Camera2D transform │
└────────────────────────┘ └───────────┬───────────┘
│
┌──────────────────────────────┼──────────────────────────────┐
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Background Stage │ │ Entities Stage │ │ HUD Stage │
└──────────────────┘ └──────────────────┘ └──────────────────┘
Core Components
1. Game Loop (Game2DLoop)
Game2DLoop drives the game execution, decoupling physics updates from rendering:
TargetFps: Target render framerate (e.g. 60 or 120 FPS).FixedTicksPerSecond: Fixed simulation rate (default 60 Hz).OnFixedUpdate: Dispatched for fixed physics/logic updates.OnVariableUpdate: Dispatched per render frame with actual delta time.
using NeoKolors.Tui.Core;
using NeoKolors.Tui.Lifecycle.Game2D;
var screen = new NKCharScreen(new Size2D(120, 35));
var camera = new Camera2D(new Rect2D(0, 0, 120, 35));
var pipeline = new Render2DPipeline();
var loop = new Game2DLoop(screen, camera, pipeline) {
TargetFps = 60,
FixedTicksPerSecond = 60
};
loop.OnFixedUpdate += dt => {
// 60 Hz physics update
player.Update(dt);
enemyManager.Update(dt);
};
2. 2D Camera (Camera2D)
Translates world coordinates to terminal character screen cells, supporting viewport scrolling, zooming, and tracking targets:
using NeoKolors.Tui.Lifecycle.Game2D;
var camera = new Camera2D(viewport: new Rect2D(0, 0, 80, 24));
camera.Position = player.Position; // Follow player
// Convert world point to screen coordinates
Point2D screenPos = camera.WorldToScreen(enemy.Position);
3. Modular Rendering Pipeline (Render2DPipeline & IGame2DStage)
Render passes are organized into cleanly isolated stages:
public class WorldEntitiesStage(GameState state) : IGame2DStage {
public void Render(Game2DRenderContext context) {
var screen = context.Screen;
var camera = context.Camera;
foreach (var entity in state.Entities) {
var pos = camera.WorldToScreen(entity.Position);
if (camera.IsVisible(pos)) {
screen.Place(entity.Sprite, pos);
}
}
}
}
// Register stages
pipeline.AddStage(new StarfieldStage());
pipeline.AddStage(new WorldEntitiesStage(gameState));
pipeline.AddStage(new ParticleEffectsStage());
pipeline.AddStage(new HudOverlayStage());
Complete Game Example
Check out Examples/ExampleGame2D.cs for Cosmic Invaders, a complete, playable 2D arcade terminal game built with this engine.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. net11.0 is compatible. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- NeoKolors.Common (>= 2026.4.0-preview.2)
- NeoKolors.Tui.Lifecycle.Core (>= 2026.4.0-preview.2)
-
net10.0
- NeoKolors.Common (>= 2026.4.0-preview.2)
- NeoKolors.Tui.Lifecycle.Core (>= 2026.4.0-preview.2)
-
net11.0
- NeoKolors.Common (>= 2026.4.0-preview.2)
- NeoKolors.Tui.Lifecycle.Core (>= 2026.4.0-preview.2)
-
net5.0
- NeoKolors.Common (>= 2026.4.0-preview.2)
- NeoKolors.Tui.Lifecycle.Core (>= 2026.4.0-preview.2)
-
net8.0
- NeoKolors.Common (>= 2026.4.0-preview.2)
- NeoKolors.Tui.Lifecycle.Core (>= 2026.4.0-preview.2)
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 |
|---|---|---|
| 2026.4.0-preview.2 | 0 | 10/30/2026 |
| 2026.4.0-preview.1 | 59 | 10/23/2026 |