Alpha — GoudEngine is under active development. APIs change frequently. Report issues
Create a new console project and add the NuGet package:
dotnet new console -n MyGame
cd MyGame
dotnet add package GoudEngineOpen MyGame.csproj and add <AllowUnsafeBlocks>true</AllowUnsafeBlocks>. The SDK uses unsafe interop internally.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GoudEngine" Version="0.0.832" />
</ItemGroup>
</Project>Replace Program.cs with a minimal window that closes on Escape:
{{#include ../generated/snippets/csharp/first-project.md}}
BeginFrame clears the screen to the given color and prepares the frame. EndFrame swaps buffers and polls events. DeltaTime gives seconds since the last frame — use it to keep movement frame-rate independent.
Run it:
dotnet runFor 3D rendering, the same game window supports both 2D and 3D rendering. Load a 3D model and render it within the same frame loop:
var model = game.LoadModel("assets/model.gltf");
game.Draw3D(model, transform);Enable debugger mode before creating the windowed game or headless context.
using GoudEngine;
using var ctx = new GoudContext(
new ContextConfig(new DebuggerConfig(true, true, "getting-started-csharp"))
);
ctx.SetDebuggerProfilingEnabled(true);
string snapshotJson = ctx.GetDebuggerSnapshotJson();
string manifestJson = ctx.GetDebuggerManifestJson();For a ready-made headless route, run ./dev.sh --game feature_lab. The example
publishes feature-lab-csharp-headless, confirms manifest and snapshot access,
and prints the manual attach steps:
- start
cargo run -p goudengine-mcp - call
goudengine.list_contexts - call
goudengine.attach_context
Load textures once before the loop. Drawing happens inside the loop between BeginFrame and EndFrame.
{{#include ../generated/snippets/csharp/drawing-a-sprite.md}}
To draw a colored quad without a texture:
game.DrawQuad(x, y, width, height, new Color(1.0f, 0.0f, 0.0f, 1.0f));Put your image files in an assets/ folder next to the project. The path is relative to the working directory when you run dotnet run.
IsKeyPressed returns true every frame the key is held. Use it for movement. For one-shot actions, track state yourself.
{{#include ../generated/snippets/csharp/handling-input.md}}
Mouse input follows the same pattern:
if (game.IsMouseButtonPressed(MouseButton.Left)) { /* click action */ }
float mouseX = game.MouseX;
float mouseY = game.MouseY;The repository includes several complete C# games. Clone and run them directly:
git clone https://github.com/aram-devdocs/GoudEngine.git
cd GoudEngine
./dev.sh --game flappy_goud # Flappy Bird clone
./dev.sh --game sandbox # Full feature sandbox
./dev.sh --game goud_jumper # Platformer
./dev.sh --game 3d_cube # 3D rendering demo
./dev.sh --game isometric_rpg # Isometric RPG
./dev.sh --game hello_ecs # ECS basics
./dev.sh --game feature_lab # Supplemental smoke coveragedev.sh builds the engine and runs the example in one step. Source for each example is in examples/csharp/.
To use a locally built version of the engine instead of the published NuGet package:
./build.sh
./package.sh --local
./dev.sh --game flappy_goud --local- C# SDK README — full API reference
- C# examples source — complete game source code
- Build Your First Game — end-to-end minimal game walkthrough
- Debugger Runtime — local attach, capture, replay, and metrics workflow
- Example Showcase — current cross-language parity matrix
- Cross-Platform Deployment — packaging and release workflow
- FAQ and Troubleshooting — common runtime and build issues
- SDK-first architecture — how the engine layers fit together
- Development guide — building from source, version management, git hooks
- Other getting started guides: Python · TypeScript · Rust · Go · Kotlin · Lua