# Scripting

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

The components are reached with `node.Get<T>()`; there is no module to import.

| Component | Methods | Signals |
|---|---|---|
| Motion2D | `Move(x)`, `MoveDir(dir)`, `Jump()`, `JumpReleased()`, `Dash(velocity, seconds)`, `AddVelocity(v)`, `AddDisplacement(offset)`, `Stop()`, `Teleport(position)` | `Landed(speed)`, `LeftGround()`, `Jumped()`, `HitWall(normal)`, `HitCeiling()` |
| Health | `Damage(amount, source) bool`, `Heal(amount)`, `Kill(source)`, `Revive(hp)`, `SetInvulnerable(seconds)` | `Damaged(amount, source)`, `Healed(amount)`, `Died(source)`, `Revived()` |
| Hitbox2D | `Activate()`, `Deactivate()`, `Pulse()` | `Hit(target, damage)` |
| Checkpoint2D | | `Reached(by)` |
| Respawn | `Trigger()`, `SetPoint(position)` | `Respawned()` |
| Pickup2D | | `Collected(by)` |
| StateMachine | `Go(state) bool`, `Is(state) bool`, `TimeIn() float` | `Changed(from, to)` |

A landing shake and a death screen:

    func Ready() {
        landed = node.Get<Motion2D>().Landed.Connect(OnLanded)
        died = node.Get<Health>().Died.Connect(OnDied)
    }

    func OnLanded(speed float) {
        if speed > 8 {
            camera.Shake(0.3)
        }
    }

    func OnDied(source NodeRef) {
        GameOver.SetEnabled(true)
    }

A short name like `Health` picks the project's own component first: a project that already has a `Health` keeps getting it, and `node.Get<gameplay.Health>()` reaches this one by its full name.
