Example programs
One directory per example under examples/. Screenshot-capable examples take -seconds N and -shot file.png for headless verification. The window smoke test requires a desktop. Every example has a walkthrough that explains its source section by section.
- Animation — keyframe clips on 2D sprites and 3D transforms, a flipbook, crossfades driven by Finished events, and three skeletal arms showing an animation event, two-bone IK and a blend space
- Assets — a directory of images loaded on worker goroutines behind a progress bar, reloaded when they change on disk, packed into a pack file, with settings that persist between runs
- Audio — positional voices orbiting a listener with Doppler, occlusion and a binaural head model, reverb and low-pass on sliders, fades, pitch, voice stealing, a synthesised music stream and microphone capture
- Autotile — terrain that picks its own tiles: a 47-tile blob set expanded from a six-tile template, a 16-tile edge set for walls, a corner Wang set whose shorelines curve, and a 64-tile hexagonal edge set in the strip below
- Clear — the renderer's smoke test: a window cleared to a cycling colour, with one frame written to a PNG
- Gallery — every widget in the interface package, the built-in themes, a texture skin, menus, modals, drag and drop, tables, scalable text and a live particle editor
- Inputs — everything the input package reports, drawn live: keys, mouse, wheel, capture, fullscreen, typed text with IME composition, and four gamepads
- Lighting — skinned meshes bent by joint matrices under cascaded shadows, two lamps with cube shadow maps over a field of 160 clustered point lights, a procedural sky that thins to orbit, image-based lighting, and every post-processing setting on a slider including temporal anti-aliasing, depth of field, motion blur, god rays and the lens effects
- Materials — every material feature on a row of spheres and a few props: clearcoat, sheen, subsurface, glass, iridescence, anisotropy, a specular tint, fur, alpha cutout, vertex colours, a scrolling texture, a decal, an outline, an x-ray tint and a stencil mask
- Network — a chat room over TCP with pointer positions over UDP, turn-based and asleep until a message arrives, with reliable UDP and its round trip and loss
- Particles — a campfire of fire and smoke, instanced rain, sparks on click and confetti on Space, with a panel that retunes the fire while it burns
- Pathfinding — A*, Dijkstra maps, field of view, flood fill and lines on a grid painted with the mouse, saved and loaded through the save package
- Physics lab — capsules, hulls and boxes on a mesh terrain, a hinge chain, a motorised paddle wheel, a ragdoll and a character controller on stairs
- Physics 2D — balls, boxes and triangles falling into a pit with a ramp, a kinematic paddle, a car on sprung wheel joints, a trigger zone and a raycast
- Physics 3D — five hundred textured cubes of wood, plastic, metal, gold, car paint, velvet, glass and glowing material falling into a concrete pen
- Probes — a reflection probe baked inside a glowing room, a grid of light probes that colours the matte balls by the wall they stand near, and screen-space reflections on a polished floor, each on a checkbox
- Roguelike — a turn-based dungeon crawl with generated rooms, line of sight, chasing goblins and a message log, running in the engine's turn-based mode
- Shaders — game-written WGSL compiled to SPIR-V in Go, as 2D sprite shaders and mesh surface and vertex hooks, with uniforms driven by sliders
- Soft bodies — a cloth flag flapping on a pole, a jelly cube that drops and can be kicked beside a rigid crate, and a tank of 2D fluid breaking around a post
- Solar system — the entity component system driving a 3D scene loaded from a scene document, with a prefab, a parent-child hierarchy, an instanced asteroid belt, picking and a render-texture minimap
- Space — a ship under gravity in a fictional star system on exact Kepler orbits, with a floating origin, orbit prediction and a slider panel
- Sprites — a few hundred textured sprites bouncing over a grid, a lit brick floor where a circling lamp throws shadows from three crates, and a key that runs the 2D frame through the post pass
- Terrain — a chunked terrain with levels of detail and a splat map, impostors, billboards, point and spot lights, fog, world text and live edits
- Tetris — a complete game on the entity component system, with components, resources, events, systems, timers, tweens, sound and a panel
- Shaped text — HarfBuzz shaping, bidirectional and vertical text, fallback fonts, wrapping, hyphenation in the text's own language, rich text, colour glyphs and distance-field text
- Tiled maps — a map from the Tiled editor, embedded as a .tmj, built into tilemaps with animated and flipped tiles and outlined objects
- Tiles — a sprite sheet, a culled tilemap, a following 2D camera, a walk cycle, layers, timers, tweens and a nine-slice HUD
- Vector paths — filled and stroked paths, fill rules, curves, caps and joins, textured fills, blend modes and the transform stack
- Model viewer — an orbit camera over a generated 3D scene, or a glTF model loaded from disk, with lights, shadows and ambient occlusion
- Window — the platform layer's smoke test, opening a native window and presenting cleared frames without the engine