The complete API reference¶
The Standard Library¶
- class Direction(enum)¶
- North, South, East, West
- class Coords¶
- x: int¶
- y: int¶
- __init__(x: int, y: int)¶
- is_spawn() bool ¶
- is_hill() bool ¶
Only applies to the “king of the hill” gamemode.
- class ObjType(enum)¶
- Unit, Terrain
- class Obj¶
Anything that can exist within a grid tile.
- id: str¶
- health: int | None¶
These are null if this object is not a unit.
- class State¶
Root class for all game state.
- turn: int¶
- ids_by_team(team) List[str] ¶
- id_by_coords(coords) str | None ¶
- class ActionType(enum)¶
You should never have to worry about this class if you use the
Action
static methods.- Attack, Move
- class Action¶
- __init__(type: ActionType, direction: Direction)¶
- class Debug¶
A class for debugging through the webapp GUI. Available through the global
debug
variable.- inspect(key: str, val: Any) None ¶
Calling this function with a key value pair will create a robot-specific information table. You can inspect it by selecting robots in the map.
- MAP_SIZE: int¶
User-defined functions¶
Python Details¶
Stdlib source here.
You can
import
most of the Python standard library modules.Install the robot-rumble-stdlib package to get autocompletion for your robot. Just put
from rumblelib import *
at the top of your file. example
Implemented with the RustPython project.
Javascript Details¶
Stdlib source here. Every identifier is in camelCase.
Javascript “enums” are implemented using the method proposed by 2ality. In a nutshell, this method leverages static class members to create a Java-like Enum superclass. In practice, the result should feel no different from the Python enums.
console.log
is the only availableconsole
method.You cannot use
import
/require
.Lodash is available under the global
_
variable. Every module is available butString
.
There isn’t yet a package with typescript types on npm, but in the meantime you can use this great boilerplate.
Implemented with the QuickJS project.