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

Example Games

The Nethercore repository includes 46 working examples organized into 8 categories. Each example is a complete, buildable project (Rust, C, or Zig).

Location

Examples are organized by category:

examples/
├── 1-getting-started/   (4 examples)
├── 2-graphics/          (6 examples)
├── 3-inspectors/        (13 examples)
├── 4-animation/         (6 examples)
├── 5-audio/             (5 examples)
├── 6-assets/            (7 examples)
├── 7-games/             (2 examples)
├── 8-advanced/          (3 examples)
└── examples-common/     (support library)

Learning Path

New to Nethercore? Follow this progression:

  1. hello-world - 2D text and rectangles, basic input
  2. triangle - Your first 3D shape
  3. textured-quad - Loading and applying textures
  4. procedural-shapes - Procedural meshes with texture toggle
  5. paddle - Complete game with the tutorial
  6. platformer - Advanced example with physics, billboards, UI

By Category

1. Getting Started

ExampleDescription
hello-worldBasic 2D drawing, text, input handling
hello-world-cSame example in C (demonstrates C FFI)
hello-world-zigSame example in Zig (demonstrates Zig FFI)
triangleMinimal 3D rendering

2. Graphics & Rendering

ExampleDescription
textured-quadTexture loading and sprite rendering
procedural-shapesBuilt-in mesh generators with texture toggle (B button)
lightingPBR rendering with 4 dynamic lights
billboardGPU-instanced billboards
dither-demoPS1-style dithering effects
material-overridePer-draw material properties

3. Inspectors (Mode & Environment)

ExampleDescription
debug-demoDebug inspection system (F4 panel)
mode0-inspectorInteractive Mode 0 (Lambert) explorer
mode1-inspectorInteractive Mode 1 (Matcap) explorer
mode2-inspectorInteractive Mode 2 (PBR) explorer
mode3-inspectorInteractive Mode 3 (Blinn-Phong) explorer
epu-showcaseCurated preset environments + interactive layer controls (F4)

4. Animation & Skinning

ExampleDescription
skinned-meshGPU skeletal animation basics
animation-demoKeyframe playback from ROM
ik-demoInverse kinematics
multi-skinned-proceduralMultiple animated characters (procedural)
multi-skinned-romMultiple animated characters (ROM data)
skeleton-stress-testPerformance testing with many skeletons

5. Audio

ExampleDescription
audio-demoSound effects, panning, channels, looping
tracker-demo-xmXM tracker music playback
tracker-demo-xm-splitXM tracker music with split sample workflow
tracker-demo-itIT tracker music playback
tracker-demo-it-splitIT tracker demo with separate sample assets

6. Asset Loading

ExampleDescription
datapack-demoFull ROM asset workflow (textures, meshes, sounds)
font-demoCustom font loading with rom_font
level-loaderLevel data loading with rom_data
asset-testPre-converted asset testing (.nczxmesh, .nczxtex)
gltf-testGLTF import pipeline validation (mesh, skeleton, animation)
glb-inlineDirect .glb references with multiple animations
glb-rigidRigid transform animation imported from GLB

7. Complete Games

ExampleDescription
paddleClassic 2-player paddle game with AI and rollback netcode
platformerFull mini-game with 2D gameplay, physics, collision, UI

8. Advanced Rendering

ExampleDescription
stencil-demoAll 4 stencil masking modes
viewport-testSplit-screen rendering (2P, 4P)
rear-mirrorRear-view mirror using viewport

Support Library

LibraryDescription
examples-commonReusable utilities (DebugCamera, StickControl, math helpers)

Building Examples

Many examples include a nether.toml manifest:

cd examples/7-games/paddle
nether build   # Build WASM and create .nczx ROM
nether run     # Build and launch in emulator

Building All Examples (For Nethercore Contributors)

To build and install all examples at once:

# From nethercore repository root
cargo xtask build-examples

This builds the Cargo-based examples and installs them into your Nethercore data directory under games/ (the command prints the exact path).

Example Structure

Most Rust examples follow this pattern:

category/example-name/
├── Cargo.toml       # Project config
├── nether.toml      # Game manifest (optional)
├── src/
│   └── lib.rs       # Game code
└── assets/          # Assets (if needed)

Learning by Reading Code

Each example includes comments explaining key concepts:

#![allow(unused)]
fn main() {
//! Example Name
//!
//! Description of what this example demonstrates.
//!
//! Controls:
//! - ...
//!
//! Note: Rollback state is automatic.
}

Browse the source on GitHub or navigate to examples/ in your local clone.