Build game logic.
Keep Rust underneath.
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; }}Learn by making things happen.
Short lessons introduce language features when a game actually needs them. Revolutionary concept, apparently.
Make a complete game.
One project from empty scene to exported build. No mysterious starter project quietly doing half the work.
Build a tiny arena game
Movement, enemies, collisions, health, score, events, shared state, audio, Weave UI and export, introduced because the game needs them.
Knowledgebase foundation in progressHow do I…?
Answers for when you already know enough Decay and simply need the thing on screen to behave.
Make a camera follow the player
Follow a gameplay target with a dead zone, smoothing, confinement, and optional camera shake.
Read →RecipeFrame-rate independent movement
Apply speed using the update delta.
Read →Talk to another script
Use typed script references instead of property-name strings.
SoonExact answers, quickly.
Language truth comes from Decay. Sindri host API truth comes from Sindri. This site presents it instead of inventing a third version.
Language
decay/LANGUAGE.mdscriptGameplay script declarationstateTyped shared project stateeventProject-wide typed eventsVec2Two-dimensional vector valueSindri API
decay-api.jsonInputEvery way the player reaches the game, in one place. Start with Input.Action, which works the same whatever the player holds; Input.Pointer, Input.Stick and Input.Gesture for mouse and touch; Input.Keyboard, Input.Touch and Input.Gamepad for one device read directly. The calls directly on Input are the keyboard, kept for older scripts: prefer Input.Keyboard.WorldFinding, creating and removing the objects in a game. Every object in a scene (a player, an enemy, a button) is an entity.Physics2D physics: moving objects with speed and pushes, and finding out what this script's object bumped into.AudioPlaying sound effects and music. Every sound goes through a bus — "effects", "music", or any other name — and every bus through "master", so a settings screen can turn each down.