HitByBulletEvent PropertiesRobocode Robot API for .NET
The HitByBulletEvent type exposes the following members.
Properties

  NameDescription
Public propertyBearing
Returns the bearing to the bullet, relative to your robot's heading, in degrees (-180 < getBearing() <= 180).

If you were to TurnRight(event.Bearing), you would be facing the direction the bullet came from. The calculation used here is: (bullet's heading in degrees + 180) - (your heading in degrees)
Public propertyBearingRadians
Returns the bearing to the bullet, relative to your robot's heading, in radians (-Math.PI < getBearingRadians() <= Math.PI).

If you were to TurnRightRadians(event.BearingRadians), you would be facing the direction the bullet came from. The calculation used here is: (bullet's heading in radians + Math.PI) - (your heading in radians)
Public propertyBullet
Returns the bullet that hit your robot.
Public propertyHeading
Returns the heading of the bullet when it hit you, in degrees (0 <= getHeading() < 360).

Note: This is not relative to the direction you are facing. The robot that fired the bullet was in the opposite direction of getHeading() when it fired the bullet.
Public propertyHeadingRadians
Returns the heading of the bullet when it hit you, in radians (0 <= getHeadingRadians() < 2 * PI).

Note: This is not relative to the direction you are facing. The robot that fired the bullet was in the opposite direction of getHeadingRadians() when it fired the bullet.
Public propertyName
Returns the name of the robot that fired the bullet.
Public propertyPower
Returns the power of this bullet. The damage you take (in fact, already took) is 4 * power, plus 2 * (power-1) if power > 1. The robot that fired the bullet receives 3 * power back.
Public propertyPriority
The priority of this event.

An event priority is a value from 0 - 99. The higher value, the higher priority.

The default priority is 80, but varies depending on the type of event.

(Inherited from Event.)
Public propertyTime
The time when this event occurred.
(Inherited from Event.)
Public propertyVelocity
Returns the velocity of this bullet.
Back to Top
See Also