Variables & types
Values, mutability, primitives and vectors.
Decay is a Rust-inspired, statically typed language made for gameplay. Learn it by building, look up exact syntax when you need it, and get back to your game.
script Player {
@export
var speed: f32 = 220.0;
fn update(dt: f32) {
let direction = Input.axis("move_left", "move_right");
this.transform.position.x += direction * speed * dt;
}
}
Short lessons introduce language features when a game actually needs them. Revolutionary concept, apparently.
Attach behaviour, expose a value, and understand the update loop.
Values, mutability, primitives and vectors.
Turn behaviour into readable, reusable pieces.
Understand where gameplay behaviour lives.
Typed script messages, events and shared state.
Build a small playable system from the pieces.
A Decay script adds gameplay behaviour to an entity. Start with the smallest useful thing: a value you can tune in Sindri and code that runs every frame.
Scripts, exported fields, typed values, functions, update, and why dt exists.
script Player {
@export
var speed: f32 = 220.0;
}
script Player declares a gameplay script type. @export makes speed editable from Sindri instead of burying tuning values in source.
fn update(dt: f32) {
let direction = Input.axis("move_left", "move_right");
this.transform.position.x += direction * speed * dt;
}
The engine calls update while the script is active. Multiplying movement by dt makes speed depend on time rather than frame rate.
One project from empty scene to exported build. No mysterious starter project quietly doing half the work.
Movement, enemies, collisions, health, score, events, shared state, audio, Weave UI and export, introduced because the game needs them.
Answers for when you already know enough Decay and simply need the thing on screen to behave.
Read input and apply frame-rate-independent movement.
Use typed script references instead of property-name strings.
Choose shared state when data belongs to the game rather than one entity.
Language truth comes from Decay. Sindri host API truth comes from Sindri. This site presents it instead of inventing a third version.