|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--robocode.Event | +--robocode.HitByBulletEvent
A HitByBulletEvent is sent to Robot.onHitByBullet(robocode.HitByBulletEvent)
when you are hit by a bullet.
You can use the information contained in this event to determine what to do.
Constructor Summary | |
HitByBulletEvent(double bearing,
Bullet bullet)
Called by the game to create a new HitByBulletEvent. |
Method Summary | |
double |
getBearing()
Returns the bearing to the bullet. |
double |
getBearingRadians()
Returns the bearing to the bullet. |
Bullet |
getBullet()
Returns the Bullet that hit you. |
double |
getHeading()
Returns the direction the bullet was heading when it hit you, in degrees (0 <= getHeading() < 360) This is not relative to the direction you are facing. |
double |
getHeadingDegrees()
Deprecated. use getHeading |
double |
getHeadingRadians()
Returns the direction the bullet was heading when it hit you, in radians (0 <= getHeading() < 2 * PI) This is not relative to the direction you are facing. |
String |
getName()
Returns the name of the robot that fired this bullet |
double |
getPower()
Returns the power of this bullet. |
double |
getVelocity()
Returns the velocity of this bullet. |
Methods inherited from class robocode.Event |
compareTo, getPriority, getTime, setPriority, setTime |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HitByBulletEvent(double bearing, Bullet bullet)
Method Detail |
public double getBearing()
public double getBearingRadians()
public Bullet getBullet()
public double getHeading()
public double getHeadingDegrees()
public double getHeadingRadians()
public String getName()
public double getPower()
public double getVelocity()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |