AbstractCreates a new BaseBot with auto-detected configuration from environment variables.
ReadonlyMAX_The maximum number of team messages that can be sent per turn.
ReadonlyTEAM_The maximum size of a team message in bytes (32 KB).
Adds a custom condition that triggers a CustomEvent when met. Returns true if added.
Calculates the bearing from the bot's direction to the given coordinates.
the X coordinate.
the Y coordinate.
the bearing in degrees in the range [-180, 180].
Broadcasts a message to all teammates.
Calculates the bearing (angle) from the bot's direction to the given direction.
the direction to calculate the bearing to.
the bearing in degrees in the range [-180, 180].
Calculates the bullet speed for a given firepower.
Calculates the delta angle between a target angle and a source angle.
the target angle.
the source angle.
the delta angle in degrees in the range [-180, 180].
Calculates the bearing from the gun's direction to the given direction.
the direction to calculate the bearing to.
the bearing in degrees in the range [-180, 180].
Calculates the gun heat for a given firepower.
Calculates the maximum turn rate for a given speed.
Calculates the bearing from the radar's direction to the given direction.
the direction to calculate the bearing to.
the bearing in degrees in the range [-180, 180].
Clears the events for the current turn.
Calculates the direction from the bot to the given coordinates.
the X coordinate.
the Y coordinate.
the direction in degrees in the range [0, 360).
Calculates the distance from the bot to the given coordinates.
the X coordinate.
the Y coordinate.
the distance in units.
Height of the arena measured in units. First available when the game has started.
Width of the arena measured in units. First available when the game has started.
The body color of the bot.
The bullet color of the bot.
The current bullet states.
The driving direction of the bot in degrees.
The number of enemy bots left in the round.
The energy level of the bot.
Gets the event priority for a given event type name.
The events that occurred in the current turn.
The firepower of the last setFire() call.
Game type, e.g. "melee" or "1v1". First available when the game has started.
Returns the graphics object for drawing on the canvas.
The gun color of the bot.
Gun cooling rate. First available when the game has started.
The gun direction of the bot in degrees.
The gun heat of the bot. The gun cannot fire when the gun heat is > 0.
The current gun turn rate in degrees per turn.
The maximum gun turn rate in degrees per turn.
The maximum number of inactive turns allowed before the bot is zapped.
The maximum radar turn rate in degrees per turn.
The maximum speed in units per turn.
The maximum turn rate of the bot in degrees per turn.
Unique id of this bot, available when the game has started.
The number of rounds in a battle. First available when the game has started.
The radar color of the bot.
The radar direction of the bot in degrees.
The current radar turn rate in degrees per turn.
The current round number.
The scan arc color of the bot.
The speed of the bot measured in units per turn.
The target speed in units per turn.
Returns the set of teammate bot IDs.
The number of microseconds left of this turn before the bot will skip the turn.
The tracks color of the bot.
The current turn number.
The current turn rate of the bot in degrees per turn.
The turn timeout in microseconds. First available when the game has started.
The turret color of the bot.
The game variant, which is "Tank Royale".
Game version, e.g. "1.0.0".
The X coordinate of the bot.
The Y coordinate of the bot.
Commits the current commands (actions), finalizing the current turn for the bot. Must be called once per turn before the turn timeout occurs.
Calculates the bearing from the gun's direction to the given coordinates.
the X coordinate.
the Y coordinate.
the bearing in degrees in the range [-180, 180].
Returns whether the gun is set to adjust for the body turn.
Returns whether the radar is set to adjust for the body turn.
Returns whether the radar is set to adjust for the gun turn.
Returns whether debugging is enabled.
Whether the bot is disabled, i.e. has no energy.
Returns whether the bot is stopped.
Returns whether the given bot ID is a teammate.
Normalizes an angle to an absolute angle in the range [0, 360).
the angle to normalize.
the normalized angle.
Normalizes an angle to a relative angle in the range [-180, 180].
the angle to normalize.
the normalized angle.
Calculates the bearing from the radar's direction to the given coordinates.
the X coordinate.
the Y coordinate.
the bearing in degrees in the range [-180, 180].
Sends a message to a specific teammate.
Sets whether the gun should adjust for the body turn.
Sets whether the radar should adjust for the body turn.
Sets whether the radar should adjust for the gun turn.
Sets the event priority for a given event type name.
Sets the gun to fire with the given firepower. Returns true if the gun will fire, false if not. The gun will not fire if the gun is still hot, or the firepower is out of range.
Enables or disables fire assistance.
Sets the gun turn rate in degrees per turn.
Sets whether the current event handler is interruptible.
Sets the maximum gun turn rate in degrees per turn.
Sets the maximum radar turn rate in degrees per turn.
Sets the maximum speed in units per turn.
Sets the maximum turn rate of the bot in degrees per turn.
Sets the radar turn rate in degrees per turn.
Sets the bot to rescan with the radar.
Sets the bot to resume movement after a stop.
Sets the bot to stop all movement.
Sets the bot to stop all movement, optionally overwriting a previous stop.
Sets the target speed in units per turn.
Sets the turn rate of the bot in degrees per turn.
Starts the bot, connecting to the server and running until the game ends.
Abstract base class for bots implementing the IBaseBot interface. Provides all state accessors, rate setters, color management, and math utilities. Subclasses should override the event handler methods to implement bot behavior.