Coming from Defold#
Note. The command is
venin today's builds and becomesfrostat launch, and so do the names built from it.
Of the engines people come from, Defold is the closest: small games, Lua scripts and messages between objects. Coldwave's scripts are Luau, a descendant of Lua, so most of what you write reads the same. What changes is where state lives and how a game is tested: the engine steps at a fixed rate and every run replays exactly.
Note. There is no importer for Defold projects yet. You move a game over by hand, or with an AI agent working from these pages. Much of your Lua carries over line by line; the calls into the engine change.
What maps to what#
| In Defold | In Coldwave |
|---|---|
| Collection | A scene: a TOML file of named things and their components (scenes) |
| Game object | A thing: a number with an optional name, made of components (things) |
| Component (sprite, collision object, sound) | A component: Sprite, Body and Collider, and sounds played by a script |
Script properties (go.property) | Your own component, declared under [components] in game.toml, or [tuning] numbers |
update(self, dt) and fixed_update | One step(dt), called 60 times a second at a fixed step |
init(self) | on_scene(name), called when a scene has started |
msg.post and on_message | send("hit", thing, 1) in one script, events("hit") in another |
self | Components on the thing, or the script's state table |
go.get_position() and go.set_position() | get(thing, "Transform", "x") and set(thing, "Transform", "x", value) |
| Factory | spawn(...) with the components the new thing starts with |
| Collection proxy | scene.load("level2.toml") |
What carries over#
- Your Lua. Tables, functions, loops and most of your helpers work as they are. Luau adds optional types and a few conveniences such as
+=. - Messages between objects. Events play the same role, and they are part of the replay: a run that sent an event sends it again, at the same step.
- Your art. PNG pictures, glTF models with their animation clips, WAV sounds and OGG music. JPEG pictures are not read yet: convert them to PNG.
What does not#
selfas memory. Keep what the game must remember in components or instate. A plainlocalis a cache: a reload or a replay does not keep it.- One script per game object. Scripts run once a step for the whole game and walk the things they care about with
each. - Vector math on positions. A position is fields of
Transform(x,y, andzin 3D), read and written one at a time.
The same move, before and after#
A thing that slides right at its own speed, in Defold:
go.property("speed", 90)
function update(self, dt)
local p = go.get_position()
p.x = p.x + self.speed * dt
go.set_position(p)
endIn Coldwave, with Slider = { speed = 90.0 } under [components] in game.toml:
function step(dt)
for _, thing in ipairs(each("Slider", "Transform")) do
local x = get(thing, "Transform", "x")
set(thing, "Transform", "x", x + get(thing, "Slider", "speed") * dt)
end
endWhere to go next#
- Install
frost, then make your first game. - Gameplay in Luau: what a script keeps, and how reload works.
- Steps and determinism: why every run replays.