Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Reusable Snippets (Generated)

This page is generated from validated sources:

  • Sandbox examples exercised by parity checks
  • SDK generated entrypoints emitted by codegen

Rust Sandbox Setup

Source: examples/rust/sandbox/src/main.rs

#![allow(unused)]
fn main() {
    let mut game = GoudGame::with_platform(
        GameConfig::new("GoudEngine Sandbox - Rust", WINDOW_WIDTH, WINDOW_HEIGHT).with_debugger(
            DebuggerConfig {
                enabled: true,
                publish_local_attach: true,
                route_label: Some("sandbox-rust".to_string()),
            },
        ),
}

C# Sandbox Setup

Source: examples/csharp/sandbox/Program.cs

        using var engineConfig = new EngineConfig()
            .SetTitle($"{assets.Title} - C#")
            .SetSize(WindowWidth, WindowHeight)
            .SetDebugger(new DebuggerConfig(true, true, "sandbox-csharp"));
        using var game = engineConfig.Build();
        using var sceneContext = new GoudContext();
        using var network = new NetworkState(assets.Port);
        using var ui = BuildUi();

Python Sandbox Startup

Source: examples/python/sandbox.py

    config = EngineConfig()
    config.set_title("GoudEngine Sandbox - Python")
    config.set_size(WINDOW_WIDTH, WINDOW_HEIGHT)
    config.set_debugger(DebuggerConfig(
        enabled=True,
        publish_local_attach=True,
        route_label="sandbox-python",
    ))

TypeScript Sandbox Asset Loading

Source: examples/typescript/sandbox/sandbox.ts

    const background = await game.loadTexture(config.background);
    const sprite = await game.loadTexture(config.sprite);
    const accentSprite = await game.loadTexture(config.accentSprite);
    const font = await game.loadFont(config.font);
    return new SandboxApp(game, ui, target, config, network, options?.maxRuntimeSec ?? 0, {
      background,
      sprite,
      accentSprite,

Python Generated Public Exports

Source: sdks/python/goudengine/generated/__init__.py

"""This file is AUTO-GENERATED by GoudEngine codegen. DO NOT EDIT."""

from ._types import Color, Vec2, Rect, Transform2D, Sprite, Entity, Transform2DBuilder, SpriteBuilder
from ._keys import BlendMode, BodyType, CoordinateOrigin, DebuggerStepKind, EasingType, EventPayloadType, Key, MouseButton, NetworkProtocol, OverlayCorner, PhysicsBackend2D, PlaybackMode, RenderBackendKind, RpcDirection, ShapeType, TextAlignment, TextDirection, TransitionType, WindowBackendKind
from ._game import GoudGame, GoudContext, PhysicsWorld2D, PhysicsWorld3D, EngineConfig, UiManager
from ._diagnostic import DiagnosticMode

__all__ = [
    "GoudGame",
    "GoudContext",

TypeScript Generated Public Exports

Source: sdks/typescript/src/generated/node/index.g.ts

// This file is AUTO-GENERATED by GoudEngine codegen. DO NOT EDIT.

import type { IGoudGame, IUiManager, IUiStyle, IUiEvent, UiNodeId, IEntity, IColor, IVec2, IVec3, ITransform2DData, ISpriteData, IRenderStats, IContact, IFpsStats, IRenderMetrics, IFramePhaseTimings, IDebuggerConfig, IContextConfig, IMemoryCategoryStats, IMemorySummary, IDebuggerCapture, IDebuggerReplayArtifact, IPhysicsRaycastHit2D, IPhysicsCollisionEvent2D, IAnimationEventData, IPreloadAssetRequest, IPreloadOptions, IPreloadProgress, IRenderCapabilities, IPhysicsCapabilities, IAudioCapabilities, IInputCapabilities, INetworkCapabilities, INetworkStats, INetworkSimulationConfig, IPhysicsWorld2D, IPhysicsWorld3D, IP2pMeshConfig, IRollbackConfig, IBoundingBox3D, ICharacterMoveResult, PreloadAssetInput, PreloadAssetKind, ISpriteCmd, ITextCmd } from '../types/engine.g.js';
import { PhysicsBackend2D, RenderBackendKind, WindowBackendKind } from '../types/input.g.js';
import { Color, Vec2, Vec3 } from '../types/math.g.js';
export { Color, Vec2, Vec3 } from '../types/math.g.js';
export { Key, MouseButton, PhysicsBackend2D, RenderBackendKind, WindowBackendKind } from '../types/input.g.js';
export type { IGoudGame, IUiManager, IUiStyle, IUiEvent, UiNodeId, IEntity, IColor, IVec2, IVec3, ITransform2DData, ISpriteData, IRenderStats, IContact, IFpsStats, IRenderMetrics, IFramePhaseTimings, IDebuggerConfig, IContextConfig, IMemoryCategoryStats, IMemorySummary, IDebuggerCapture, IDebuggerReplayArtifact, IPhysicsRaycastHit2D, IPhysicsCollisionEvent2D, IAnimationEventData, IRenderCapabilities, IPhysicsCapabilities, IAudioCapabilities, IInputCapabilities, INetworkCapabilities, INetworkStats, INetworkSimulationConfig, IPhysicsWorld2D, IPhysicsWorld3D, IP2pMeshConfig, IRollbackConfig, IBoundingBox3D, ICharacterMoveResult } from '../types/engine.g.js';

export interface INetworkConnectResult { handle: number; peerId: number; }
export interface INetworkPacket { peerId: number; data: Uint8Array; }
export interface IGoudContext {
  destroy(): boolean;
  isValid(): boolean;