Aego Русский

Aego Script

Aego Script is the gameplay language of Aego. It is statically typed and reads like Go. Scripts attach to nodes, show fields in the Inspector, read and write components, call engine and native functions and talk to each other through signals.

These pages describe the language. Overview walks through one script, an enemy that patrols, and the other pages explain each part. The functions of the engine are listed in the Script API reference.

package demo

import "aego/log"

script Hello {
    @export var Greeting string = "hello from Aego Script"

    var frames int

    func Ready() {
        log.Info(Greeting + " on node " + node.Name())
    }

    func Update(dt float) {
        frames++
        if frames == 60 {
            log.Info("one second of frames: " + string(frames))
        }
    }
}