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 Emberware repository includes 28+ example games organized by category. Each example is a complete, buildable project.

Location

emberware/examples/

Learning Path

New to Emberware? 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. cube - Transforms and rotation
  5. paddle - Complete game with the tutorial
  6. platformer - Advanced example with physics, billboards, UI

By Category

Getting Started

ExampleDescription
hello-worldBasic 2D drawing, text, input handling
triangleMinimal 3D rendering
textured-quadTexture loading and binding
cubeRotating textured cube with transforms

Graphics & Rendering

ExampleDescription
lightingPBR rendering with 4 dynamic lights
blinn-phongClassic specular and rim lighting
billboardGPU-instanced billboards
procedural-shapesBuilt-in mesh generators
textured-proceduralTextured procedural meshes
dither-demoPS1-style dithering effects
material-overridePer-draw material properties

Render Mode Inspectors

ExampleDescription
mode0-inspectorInteractive Mode 0 (Unlit) explorer
mode1-inspectorInteractive Mode 1 (Matcap) explorer
mode2-inspectorInteractive Mode 2 (PBR) explorer
mode3-inspectorInteractive Mode 3 (Hybrid) explorer

Animation & Skinning

ExampleDescription
skinned-meshGPU skeletal animation basics
animation-demoKeyframe playback from ROM
ik-demoInverse kinematics
multi-skinned-proceduralMultiple animated characters
multi-skinned-romROM-based animation data
skeleton-stress-testPerformance testing

Complete Games

ExampleDescription
paddleClassic 2-player game with AI
platformerFull mini-game with physics, UI, multiplayer

Audio

ExampleDescription
audio-demoSound effects, panning, channels

Asset Loading

ExampleDescription
datapack-demoROM asset workflow
font-demoCustom font loading
level-loaderLevel data from ROM
asset-testPre-converted asset testing

Development Tools

ExampleDescription
debug-demoDebug inspection system

Shared Libraries

ExampleDescription
examples-commonReusable utilities (DebugCamera, math helpers)

Building Examples

Each example is a standalone Cargo project:

cd examples/paddle
cargo build --target wasm32-unknown-unknown --release
ember run target/wasm32-unknown-unknown/release/paddle.wasm

Or build all examples:

cargo xtask build-examples

Example Structure

All examples follow this pattern:

example-name/
├── Cargo.toml      # Project config
├── ember.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 read locally in your clone.