Let's take Godot for walkies 🦴
Prerequisites
- .NET SDK 8.0 or later
- Godot (.NET) (for importing project assets)
Installation
Prerelease packages are available on NuGet. Supported platforms: win-x64, linux-x64, and osx-arm64.
Your First 2dog Application
Using Templates (Recommended)
The fastest way to get started is using the 2dog project template:
# Install the template (bundled in the main 2dog package)
dotnet new install 2dog
# Create a new project (optionally with xUnit tests)
dotnet new 2dog --tests True -n MyGodotApp
# Navigate into the project
cd MyGodotApp
# Import assets with Godot
godot-mono --path MyGodotApp.Godot --import
# Run tests
dotnet test
# Run the game
dotnet run --project MyGodotApp
# Edit in Godot
godot-mono -e --path MyGodotApp.GodotThis creates a complete project with sample Godot content and everything configured. See Project Templates for details.
Manual Setup
Alternatively, create a new console application manually:
dotnet new console -n MyGodotApp
cd MyGodotApp
dotnet add package 2dog --version 0.1.9-preReplace Program.cs:
using twodog;
// Create engine pointing to your Godot project
using var engine = new Engine("MyGodotApp", "./project");
// Start Godot
using var godot = engine.Start();
// Run the main loop
while (!godot.Iteration())
{
// Your code runs here every frame
// Access the scene tree via engine.Tree
}Project Structure
A minimal 2dog project requires:
MyGodotApp/
├── MyGodotApp.csproj
├── Program.cs
└── project/
└── project.godot # Minimal Godot project fileThe project/ directory must contain at least a project.godot file. You can create one with the Godot editor or use a minimal template:
; project.godot
config_version=5
[application]
config/name="MyGodotApp"Building from Source
If you prefer to build everything locally instead of using the NuGet packages:
- Clone with submodules:
git clone --recursive https://github.com/outfox/2dog
cd 2dog- Build Godot (requires Python with uv):
uv run poe build-godot- Build 2dog platform packages, and the main library and NuGet packages:
uv run poe buildYou can also run
uv run poe build-allto do steps 2 and 3 in one go.
Build Configurations
2dog supports three build configurations for different use cases:
dotnet build -c Debug # Development with debug symbols
dotnet build -c Release # Optimized production build
dotnet build -c Editor # Editor tools with TOOLS_ENABLEDThe Editor configuration enables Godot's full editor toolchain, including:
- Resource import pipeline
- Editor APIs (
EditorInterface,EditorPlugin) - Import plugins for textures, models, audio
- Scene validation and manipulation tools
See Build Configurations for detailed information.
Next Steps
- Use Project Templates to quickly scaffold new projects
- Learn about Core Concepts to understand the architecture
- Explore Build Configurations for Debug, Release, and Editor modes
- Check the API Reference for detailed documentation
- Set up Testing with xUnit for your project