pushScene(id: string, args: unknown[]): void

Push the current active scene to a stack and then goes to the new scene

paramid- The scene name.

paramargs- The args passed to the scene definition.

scene("mainScene", () => {
    add([
        text("this is the first scene", { size: 32 }),
        pos(center()),
    ]);
});
scene("otherScene", () => {
    add([
        sprite("bean"),
        pos(center()),
    ]);
});

pushScene("mainScene")

sincev3001.1

groupScenes

see