Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

BotTurn

One of a room bot’s moves, as a scene’s play reads it: its player, what it controls, its input and its messages, so a bot plays a card game with no character as well as a shooter.

Property Type Description
character Entity | null The bot’s character among them, the one with a character’s pose, or null where it controls none, as in a card game.
controlled readonly Entity[] Every entity its player controls, as the room last told the bot, in the order they were spawned.
input BotInput The bot’s input for the ticks to its next move.
moveSeconds number Seconds of the room’s time since the bot’s last move: one of the room’s send intervals, since it moves on each send. A speed read from two moves divides by it.
player Entity | null The bot’s player entity in it: null before the stream brings it.
send (name, payload?, options?) => void Sends the room one of the game’s commands, by its plugin.key name: what a page’s button or key sends, each entity field as the key the dump files the entity under. A command declared entity: true names the entity it acts through in entity, one of controlled, such as its character: a room’s bot knows no declaration, so it sends none it is not given. Its result comes to the bot’s page as any command’s does.
world World The room’s world as the bot’s page stream holds it: every entity the room streams, with the game’s own traits.