|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrobocode.Rules
public final class Rules
Constants and methods that defines the rules of Robocode. Constants are used for rules that will not change. Methods are provided for rules that can be changed between battles or which depends on some other factor.
Field Summary | |
---|---|
static double |
ACCELERATION
The acceleration of a robot, i.e. the increase of velocity when the robot moves forward, which is 1 pixel/turn. |
static double |
DECELERATION
The deceleration of a robot, i.e. the decrease of velocity when the robot moves backwards (or brakes), which is 2 pixels/turn. |
static double |
GUN_TURN_RATE
The turning rate of the gun measured in degrees, which is 20 degrees/turn. |
static double |
GUN_TURN_RATE_RADIANS
The turning rate of the gun measured in radians instead of degrees. |
static double |
MAX_BULLET_POWER
The maximum bullet power, i.e. the maximum amount of energy that can be transferred to a bullet when it is fired, which is 3 energy points. |
static double |
MAX_TURN_RATE
The maximum turning rate of the robot, in degrees, which is 10 degress/turn. |
static double |
MAX_TURN_RATE_RADIANS
The maximum turning rate of the robot measured in radians instead of degrees. |
static double |
MAX_VELOCITY
The maximum velocity of a robot, which is 8 pixels/turn. |
static double |
MIN_BULLET_POWER
The minimum bullet power, i.e the amount of energy required for firing a bullet, which is 0.1 energy points. |
static double |
RADAR_SCAN_RADIUS
The radar scan radius, which is 1200 pixels. |
static double |
RADAR_TURN_RATE
The turning rate of the radar measured in degrees, which is 45 degrees/turn. |
static double |
RADAR_TURN_RATE_RADIANS
The turning rate of the radar measured in radians instead of degrees. |
static double |
ROBOT_HIT_BONUS
The amount of bonus given when a robot moving forward hits an opponent robot (ramming), which is 1.2 energy points. |
static double |
ROBOT_HIT_DAMAGE
The amount of damage taken when a robot hits or is hit by another robot, which is 0.6 energy points. |
Method Summary | |
---|---|
static double |
getBulletDamage(double bulletPower)
Returns the amount of damage of a bullet given a specific bullet power. |
static double |
getBulletHitBonus(double bulletPower)
Returns the amount of bonus given when a robot's bullet hits an opponent robot given a specific bullet power. |
static double |
getBulletSpeed(double bulletPower)
Returns the speed of a bullet given a specific bullet power measured in pixels/turn. |
static double |
getGunHeat(double bulletPower)
Returns the heat produced by firing the gun given a specific bullet power. |
static double |
getTurnRate(double velocity)
Returns the turn rate of a robot given a specific velocity measured in degrees/turn. |
static double |
getTurnRateRadians(double velocity)
Returns the turn rate of a robot given a specific velocity measured in radians/turn. |
static double |
getWallHitDamage(double velocity)
Returns the amount of damage taken when robot hits a wall with a specific velocity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double ACCELERATION
public static final double DECELERATION
public static final double MAX_VELOCITY
public static final double RADAR_SCAN_RADIUS
public static final double MIN_BULLET_POWER
public static final double MAX_BULLET_POWER
public static final double MAX_TURN_RATE
MAX_TURN_RATE_RADIANS
,
getTurnRate(double)
,
getTurnRateRadians(double)
,
Constant Field Valuespublic static final double MAX_TURN_RATE_RADIANS
MAX_TURN_RATE
,
getTurnRate(double)
,
getTurnRateRadians(double)
public static final double GUN_TURN_RATE
GUN_TURN_RATE_RADIANS
,
Robot.setAdjustGunForRobotTurn(boolean)
,
Constant Field Valuespublic static final double GUN_TURN_RATE_RADIANS
GUN_TURN_RATE
public static final double RADAR_TURN_RATE
RADAR_TURN_RATE_RADIANS
,
Robot.setAdjustGunForRobotTurn(boolean)
,
Robot.setAdjustRadarForGunTurn(boolean)
,
Constant Field Valuespublic static final double RADAR_TURN_RATE_RADIANS
RADAR_TURN_RATE
public static final double ROBOT_HIT_DAMAGE
public static final double ROBOT_HIT_BONUS
Method Detail |
---|
public static double getTurnRate(double velocity)
velocity
- the velocity of the robot.
getTurnRateRadians(double)
public static double getTurnRateRadians(double velocity)
velocity
- the velocity of the robot.
getTurnRate(double)
public static double getWallHitDamage(double velocity)
velocity
- the velocity of the robot.
public static double getBulletDamage(double bulletPower)
bulletPower
- the energy power of the bullet.
public static double getBulletHitBonus(double bulletPower)
bulletPower
- the energy power of the bullet.
public static double getBulletSpeed(double bulletPower)
bulletPower
- the energy power of the bullet.
public static double getGunHeat(double bulletPower)
bulletPower
- the energy power of the bullet.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |