robocode
Class Bullet
- Mathew A. Nelson (original)
Bullet(robocode.peer.BulletPeer peer) - Called by the game to create a new
Bullet object
|
double | getHeading() - Returns the direction the bullet is/was heading, in degrees
(0 <= getHeading() <32360).
|
double | getHeadingRadians() - Returns the direction the bullet is/was heading, in radians
(0 <= getHeadingRadians() <322 * Math.PI).
|
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.
|
String | getVictim() - Returns the name of the robot that this bullet hit, or
null if
the bullet has not hit a robot.
|
double | getX() - Returns the X position of the bullet.
|
double | getY() - Returns the Y position of the bullet.
|
boolean | isActive() - Checks if this bullet is still active on the battlefield.
|
Bullet
public Bullet(robocode.peer.BulletPeer peer)
Called by the game to create a new Bullet
object
peer
- the bullet peer of the Bullet
getHeading
public double getHeading()
Returns the direction the bullet is/was heading, in degrees
(0 <= getHeading() <32360). This is not relative to the direction you are
facing.
- the direction the bullet is/was heading, in degrees
getHeadingRadians
public double getHeadingRadians()
Returns the direction the bullet is/was heading, in radians
(0 <= getHeadingRadians() <322 * Math.PI). This is not relative to the
direction you are facing.
- the direction the bullet is/was heading, in radians
getName
public String getName()
Returns the name of the robot that fired this bullet.
- the name of the robot that fired this bullet
getPower
public double getPower()
Returns the power of this bullet.
The bullet will do (4 * power) damage if it hits another robot.
If power is greater than 1, it will do an additional 2 * (power - 1)
damage. You will get (3 * power) back if you hit the other robot.
getVelocity
public double getVelocity()
Returns the velocity of this bullet. The velocity of the bullet is
constant once it has been fired.
- the velocity of the bullet
getVictim
public String getVictim()
Returns the name of the robot that this bullet hit, or null
if
the bullet has not hit a robot.
- the name of the robot that this bullet hit, or
null
if
the bullet has not hit a robot.
getX
public double getX()
Returns the X position of the bullet.
- the X position of the bullet
getY
public double getY()
Returns the Y position of the bullet.
- the Y position of the bullet
isActive
public boolean isActive()
Checks if this bullet is still active on the battlefield.
true
if the bullet is still active on the battlefield;
false
otherwise