Match Flow
Before
Before the match begins, each player is assigned either Player1 or Player2. Both players start with 100 health.
Coordinate/Grid System
The match arena is organized into a 9x9 grid, with coordinates ranging from (-4, -4) in the bottom-left to (4, 4) in the top-right. Each line intersection represents a coordinate point. Both players start in the vertical middle, with Player1 on the left (-4, 0), and Player2 on the right (4, 0).
A NORTH, SOUTH, EAST, WEST direction system is used. NORTH is up (+y), SOUTH is down (-y), EAST is right (+x), and WEST is left (-x). The robots start facing each other, so Player1 starts facing EAST and Player2 starts facing WEST.
Turns
There are 2 types of turns: attack and defense. Player1 always attacks first, and Player2 always defends first. Each turn, the attacker and defender alternate. Starting at Turn 1, all odd turns are Player 1's attack turn and all even turns are Player 1's defense turn (vice versa for Player 2). Each turn, both players can perform 1 significant action (move, attack) and 1 change in direction. Only the player on their attack turn can attack. The defender always goes first, which you need to take into consideration when writing your attack logic.
The game continues like this until one, or both, of the robots reach 0 health. The robot with health remaining is the winner. Or, if this doesn't happen within 20 turns, the match ends in a draw.
ByteBrawl
0