GrayHare.GameEngine 0.8.0

dotnet add package GrayHare.GameEngine --version 0.8.0
                    
NuGet\Install-Package GrayHare.GameEngine -Version 0.8.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GrayHare.GameEngine" Version="0.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GrayHare.GameEngine" Version="0.8.0" />
                    
Directory.Packages.props
<PackageReference Include="GrayHare.GameEngine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GrayHare.GameEngine --version 0.8.0
                    
#r "nuget: GrayHare.GameEngine, 0.8.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GrayHare.GameEngine@0.8.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GrayHare.GameEngine&version=0.8.0
                    
Install as a Cake Addin
#tool nuget:?package=GrayHare.GameEngine&version=0.8.0
                    
Install as a Cake Tool

GrayHare.GameEngine

Overview

GrayHare.GameEngine is a lightweight cross-platform 2D game engine built on SFML.Net 3.0.0 for .NET applications. It provides a small runtime centered around GameApplication, GameHost, GameSceneBase, and World, so you can build scene-driven games with cached assets, audio, input, camera control, animation, steering behaviors, spatial queries, and grid pathfinding without a large framework. It has been tested on Windows and Linux Mint.

Installation

Install the NuGet package:

dotnet add package GrayHare.GameEngine

Running the DemoHub

To start the example hub from the repository root, run:

dotnet run --project .\examples\GrayHare.GameEngine.DemoHub\GrayHare.GameEngine.DemoHub.csproj

The DemoHub creates its demo assets automatically on first run.

Core capabilities

  • Application runtime - GameApplication creates the SFML window, asset store, audio player, input tracker, ECS world, camera, and scene manager, then exposes them through GameHost.
  • Scene stack - GameSceneBase, SceneManager, ChangeScene, PushScene, and PopScene support both full scene changes and overlay scenes. Scene operations are applied at the end of the frame.
  • Layered rendering - Scenes can compose ISceneLayer instances around the scene's own RenderLayer, making it easy to add HUD, pause, parallax, or overlay layers.
  • ECS - World manages entities, typed components, and allocation-friendly queries over component sets.
  • Input - InputTracker and InputSnapshot expose keyboard, mouse, wheel, and joystick state, while InputActionMap maps named actions to keys, buttons, mouse buttons, and axes.
  • Assets - AssetStore caches images, textures, fonts, sound buffers, and GLSL shaders. It supports relative asset paths, system-font fallback, and PPM P3 and P6 files in addition to formats handled by SFML.
  • Audio - AudioPlayer supports pooled sound playback, streamed music, mute/stateful volume control, and per-category volume settings.
  • Animation and rendering helpers - AnimationClip, AnimationPlayer, Camera2D, and extension helpers cover sprite-strip animation, smooth camera follow, zoom, rotation, shake, and common rendering utilities.
  • AI and movement - Steering and movement helpers cover rotation, drifting, steering-force composition, and debug drawing for steering behavior tuning.
  • Navigation and queries - PathFinder supports BFS, DFS, Dijkstra, A*, and flow fields on PathfindingGrid, while SpatialGrid<T> handles fast radius-based neighbor lookups for large groups of moving objects.
  • Diagnostics - EngineLogger lets a game supply its own log handler for runtime diagnostics.

Documentation

Additional documentation is available in docs\README.md.

A step-by-step guide for building a basic Tetris game is available in docs\how-to-tetris.md.

Requirements

License

This project is licensed under the zlib License. See the LICENSE file for details.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.8.0 94 5/11/2026
0.7.0 110 5/2/2026
0.6.2 92 4/28/2026
0.6.1 97 4/24/2026

First public release. Includes the GameApplication and GameHost runtime, scene stack and layers, ECS, input and action mapping, cached assets and GLSL shaders, audio, camera and animation helpers, steering behaviors, spatial queries, and grid pathfinding.