A decrease of energy observed in another robot. Because Robocode robots cannot see mid-air bullets, the only way to detect that a bullet was fired is by noticing a change in the opponent's energy level.
How it works
The following events impact a robot's energy level between scans:
- Getting hit by a bullet
- Hitting another bot with a bullet
- Running into another robot
- Running into a wall
- Firing a bullet
- Inactivity energy drop
In a duel, bullet damage (#1), life gained (#2), and robot collisions (#3) can be fully accounted for - i.e., you are made aware of them through other events before
onScannedRobot . Another bot running into a wall (#4) can only be approximated: he can change speed, hit the wall, receive damage based on speed, and come to a stop, without his opponent ever knowing what speed he used. This is largely moot, though, since such wall collisions are rare and gun heat tracking can often prove that no bullet was fired.
Since it is possible to account for nearly every other energy-changing event happening to your opponent, any remaining energy drop is the firepower of a bullet that he fired.