# Coming from Godot

Most of what you know from Godot has a direct counterpart here. Scenes are text files,
scripts are Luau or C#, and the engine runs at a fixed step, so every run replays exactly.
There is no importer for Godot projects yet: you rebuild scenes and scripts by hand or with
an AI agent, and your art comes across as files.

## What maps to what

| Godot | Coldwave |
| --- | --- |
| Node | A thing: a number with an optional name, made of components ([things](../concepts/things.md)) |
| Scene (`.tscn`) | A scene: a TOML file of named things and their components ([scenes](../concepts/scenes.md)) |
| Instanced scene | No instancing yet. Spawn the thing from a script, or keep the group in a scene |
| GDScript | Luau, or C# |
| `_ready()` | `on_scene(name)`, called when a scene has started |
| `_process` and `_physics_process` | One `step(dt)`, called 60 times a second at a fixed step |
| Signals | Events: `send("hit", thing, 1)` in one script, `events("hit")` in another |
| `@export` variables | `[tuning]` numbers in `game.toml`, which you can change while the game runs |
| Input Map actions | `[input] actions` and `[input.keys]` in `game.toml`, read with `input.get` |
| Groups | A component per kind of thing (`Moth = {}`), found with `each("Moth")` |
| `change_scene_to_file()` | `scene.load("level2.toml")` |

## Movement

A hero that walks left and right. In Godot:

```gdscript
extends Node2D

@export var speed := 90.0

func _physics_process(delta):
    position.x += Input.get_axis("left", "right") * speed * delta
```

In Coldwave, with `speed = 90` under `[tuning]` and a `move_x` action in `game.toml`:

```lua
function step(dt)
    local hero = find("hero")
    local x = get(hero, "Transform", "x")
    set(hero, "Transform", "x", x + input.get(0, "move_x") * tuning.speed * dt)
end
```

## Signals become events

In Godot, a coin tells the score it was picked up:

```gdscript
signal picked(value)

func _on_body_entered(body):
    picked.emit(5)
```

In Coldwave, one script sends an event and any other reads it in the same step:

```lua
send("picked", coin, 5)

for _, picked in ipairs(events("picked")) do
    state.score += picked.value
end
```

## What carries over

- **Text you can diff.** You already review scene changes in git. Here that covers the
  whole project.
- **A small, dynamic language.** Luau adds optional types; `frost reference --types game.toml`
  writes them for your game.
- **Your art.** PNG pictures, glTF models with their animation clips, WAV sounds and OGG
  music. JPEG is not read yet, so convert those to PNG.

## What changes

- **Behaviour comes from components.** A thing can sit under a parent, but there is no node
  type to inherit from.
- **There is one fixed step.** Every step is 1/60 s of game time, so the same input always
  plays the same game.
- **State lives in components or `state`.** A plain `local` is a cache that a reload or a
  replay does not keep.

## Next

[Your first game](../start/first-game.md) takes about ten minutes.
[Gameplay in Luau](../guides/luau.md) covers what a script keeps and how reload works.
