How a battle works
Turns, the arena, energy and who wins.

Turns
A battle moves in turns (ticks): 30 per second. Every turn, each robot receives what its sensors picked up and returns its commands. The game then moves the robots, flies the projectiles, applies damage and fires the scenery events.
In code, a turn ends when the robot calls scan(). See run() and scan().
The arena
The arena can be round or square, small (44), medium (58) or large (90 units). Beyond the edge there is lava, sea, space or a canyon, depending on the scenery: leaving the arena takes the robot out of the battle. Some robots hold on a little off the edge before falling (spider legs, claws).
On maps with terrain, rocks, walls and other obstacles block robots and shots.
Health and energy
Each robot has two bars:
- Health: shots, punches, collisions and scenery events take health. At 0, the robot is destroyed.
- Energy: moving, turning, looking and shooting use energy. With no energy, the robot barely moves and the radar sees no one. To recharge, it has to stop (
recharge()).
With the energy shield, a third bar absorbs shots before health.
Scenery events
Every 5 to 9 seconds the scenery attacks the arena: lava bombs, meteors, lightning, hail… The target shows on the ground before the strike, and an attentive robot gets out of the way. See Scenery events.
Who wins
The last robot standing wins. If time runs out with several survivors, whoever dealt the most damage wins; the tiebreak is the percentage of health left. See How a battle is decided.

