Module StageControl
The API to be implemented by a stage control program. Defines the settings and behavior of a stage.
Functions
configure (stageBuilder) | Configures the stage settings. |
init (ships, world, admin, gfx) | Initializes the stage. |
run (stageSensors) | Executes stage code each tick. |
Functions
- configure (stageBuilder)
-
Configures the stage settings. Passes a builder object used to define static configuration of the stage, such as dimensions, walls, zones, and starting points.
Parameters
- stageBuilder: The builder used to configure the stage. Can only be used during execution of this function.
See also:
- init (ships, world, admin, gfx)
-
Initializes the stage. Passes references to all ships, the world, and an administrator object used to modify the state of the stage and ships.
Parameters
- ships: A table of all ships loaded for this game.
- world: A userdata object used to query information about the game world, such as stage size, locations of walls and zones, and current time.
- admin: A userdata object used to perform administrative operations only available to the stage program, such as modifying a ship's speed, location, or energy, destroying or reviving ships, ending a round or the game, and deciding on a winner.
- gfx: A userdata object used to draw debug graphics on the screen. Graphics are hidden unless the user checks the checkbox in the stage's output console.
See also:
- run (stageSensors)
-
Executes stage code each tick. Allows the stage to monitor the game, modify the stage and ships, and decide when the game ends and who wins.
Parameters
- stageSensors: A userdata object that can be queried for information on all events that took place this tick.
See also: