Rust · wgpu · native and web

Ship the jam, not the engine.

Implement init, update and render, and ship. A batched 2D painter (sprites, shapes, text, tilemaps, optional vello vectors) and instanced, depth-tested 3D meshes draw into the same frame, so a 3D scene gets a 2D HUD for free. Native and the browser from the same code.

v0.11.3 EUPL-1.2 unsafe forbidden

Cookie D'oh! title screen: a marquee reading Accept All Cookies over a cookie conveyor, with a cookie consent banner offering Accept All and a greyed-out Reject.

Cookie D'oh! game-toolkit

A C64/Amiga-era arcade game about accepting every cookie the Internet throws at you. A complete game on the toolkit, native and web from the same code.

  • Keyboard play
  • Gamepad / touch supported

01 · Start

From nothing to a window in one command.

Generate a jam from a template with cargo-generate: a minimal game, an asset folder, a web build, and a guide to the whole API for you and your coding agent. Or add the crate to what you have.

terminal
cargo generate --git https://github.com/sunsided/game-toolkit templates/jam --name my-jam
cd my-jam && cargo run
Cargo.toml
[dependencies]
game-toolkit = "0.11"

The guide covers the loop, drawing, input, audio, assets and the web build on one page.

src/main.rs
use game_toolkit::prelude::*;

struct Game1;

impl Game for Game1 {
    fn init(_ctx: &mut Context) -> Result<Self> {
        Ok(Self)
    }

    fn update(&mut self, ctx: &mut Context, _dt: f32) {
        if ctx.input.key_pressed(Key::Escape) {
            ctx.quit();
        }
    }

    fn render(&mut self, ctx: &mut Context, frame: &mut Frame) {
        let mut p = frame.painter(&mut ctx.gfx);
        p.clear([0.1, 0.1, 0.15, 1.0]);
        p.text([24.0, 24.0], "hello, jam", 28.0, [1.0, 1.0, 1.0, 1.0]);
    }
}

fn main() -> Result<()> {
    run::<Game1>(AppConfig {
        title: "my-jam".into(),
        width: 800,
        height: 600,
        ..Default::default()
    })
}

02 · Inside

Everything a jam needs, nothing it does not.

One frame, 2D and 3D

Sprites, SDF shapes, glyphon text and atlas tilemaps through one Painter; instanced meshes with depth testing under it. Draw order is the order you call.

Browser from the same code

wgpu on WebGPU with a WebGL2 fallback, WebAudio, the Gamepad API and touch. Assets preload from a manifest so loading stays synchronous.

Sound that just works

kira playback that degrades to muted without a device, plus synthie chiptune music and effects behind the synth feature.

Pull only what you use

Core, gfx, input, audio, assets, Aseprite, ECS, egui overlays and GPU compute are separate crates behind one umbrella and its features.

Jam templates

cargo generate a 2D or 3D starter with assets, a web build and an agent guide to the whole API already in place.

GPU compute

WGSL kernels over a grid, ping-pong storage buffers, a readback ring that never blocks, storage textures you draw like sprites, and a submitter that keeps simulations off the frame. Behind the compute feature.

Post and palettes

Virtual resolutions, a CRT filter, custom WGSL effects and indexed colour with palette cycling, for the retro look without fighting the GPU.

03 · Add-ons

Built on the toolkit.

Separate crates for the parts of a game that deserve their own: a character that feels right, and the PC hardware of 1981 to 1994, down to the electron beam.

04 · Play

Running in your browser, from the same code.

Every demo is a crate example built for wasm32 at a pinned release. Nothing loads until you press Run.

Scaling a single wall with stick-aimed wall jumps

Moonlit level platformer

The test bench: the Cheesed heroine in a moonlit level, every move and every preset, with a debug overlay.

How it’s made: the whole program →
  • Arrows move
  • F2 cycle presets
  • Gamepad supported
Cheesed! title painting: a caped mouse holds a glowing cheese aloft on a crag, a huge cat lunging behind her and a castle under lightning in the distance.

Cheesed! game-toolkit

A complete game on the toolkit: a thrilling action adventure in DOS-era dress, with procedural music from title-screen metal to a music-box minuet. The Mouse. The Cheese. The Destiny.

All demos →

05 · Also

Honorable mentions.

Not part of the toolkit, from the same workshop, and useful in a game.

  • sillyecs

    A zero-overhead archetype ECS, generated and scheduled at compile time from a YAML schema. The toolkit’s ecs feature builds on it.

  • dramaturge

    Branching dialogue, character memory and narrative state, as pure data for any engine: facts, conditions, memories and consequences.

  • loremaster

    A runtime for interactive fiction and graphical adventures on dramaturge, with live editing and playtesting: every text comes from the world state, and you see when it shows and why.