Documentation
Script

Script

⚠️

This page is under construction.

⚠️

Beta feature, subject to change.

Script allows you to execute scripts and interact with the game.

scene.action([
    new Script((ctx) => {
        console.log("This script is being executed.");
    })
]);

Public Methods

constructor

  • handler: (ctx: ScriptCtx) => void - When the script is executed, this handler will be called. The handler will receive a ScriptCtx object.
const script = new Script((ctx) => {
    console.log(ctx.gameState);
});