GrayHare.GameEngine
0.8.0
dotnet add package GrayHare.GameEngine --version 0.8.0
NuGet\Install-Package GrayHare.GameEngine -Version 0.8.0
<PackageReference Include="GrayHare.GameEngine" Version="0.8.0" />
<PackageVersion Include="GrayHare.GameEngine" Version="0.8.0" />
<PackageReference Include="GrayHare.GameEngine" />
paket add GrayHare.GameEngine --version 0.8.0
#r "nuget: GrayHare.GameEngine, 0.8.0"
#:package GrayHare.GameEngine@0.8.0
#addin nuget:?package=GrayHare.GameEngine&version=0.8.0
#tool nuget:?package=GrayHare.GameEngine&version=0.8.0
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 -
GameApplicationcreates the SFML window, asset store, audio player, input tracker, ECS world, camera, and scene manager, then exposes them throughGameHost. - Scene stack -
GameSceneBase,SceneManager,ChangeScene,PushScene, andPopScenesupport both full scene changes and overlay scenes. Scene operations are applied at the end of the frame. - Layered rendering - Scenes can compose
ISceneLayerinstances around the scene's ownRenderLayer, making it easy to add HUD, pause, parallax, or overlay layers. - ECS -
Worldmanages entities, typed components, and allocation-friendly queries over component sets. - Input -
InputTrackerandInputSnapshotexpose keyboard, mouse, wheel, and joystick state, whileInputActionMapmaps named actions to keys, buttons, mouse buttons, and axes. - Assets -
AssetStorecaches images, textures, fonts, sound buffers, and GLSL shaders. It supports relative asset paths, system-font fallback, and PPMP3andP6files in addition to formats handled by SFML. - Audio -
AudioPlayersupports 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 -
PathFindersupports BFS, DFS, Dijkstra, A*, and flow fields onPathfindingGrid, whileSpatialGrid<T>handles fast radius-based neighbor lookups for large groups of moving objects. - Diagnostics -
EngineLoggerlets 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
- .NET 10.0 or later
- SFML.Net 3.0.0
License
This project is licensed under the zlib License. See the LICENSE file for details.
| 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
- SFML.Net (>= 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
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.