Movement Method |
void |
setAhead(double distance) Sets the robot to move ahead (forward) by distance measured in pixels when the next execution takes place. |
void |
setBack(double distance) Sets the robot to move back by distance measured in pixels when the next execution takes place. |
double |
getDistanceRemaining() Returns the distance remaining in the robot's current move measured in pixels. |
void |
setStop() This call is identical to Robot.stop(), but returns immediately, and will not execute until you call execute() or take an action that executes. |
void |
setStop(boolean overwrite) This call is identical to Robot.stop(boolean), but returns immediately, and will not execute until you call execute() or take an action that executes. |
void |
setResume() Sets the robot to resume the movement stopped by stop() or setStop(), if any. |
void |
setMaxVelocity(double newMaxVelocity) Sets the maximum velocity of the robot measured in pixels/turn if the robot should move slower than Rules.MAX_VELOCITY (8 pixels/turn). |
void |
setMaxTurnRate(double newMaxTurnRate) Sets the maximum turn rate of the robot measured in degrees if the robot should turn slower than Rules.MAX_TURN_RATE (10 degress/turn). |
void |
setTurnLeft(double degrees) Sets the robot's body to turn left by degrees when the next execution takes place. |
void |
setTurnRight(double degrees) Sets the robot's body to turn right by degrees when the next execution takes place. |
double |
getTurnRemaining() Returns the angle remaining in the robots's turn, in degrees. |
Radar Method |
boolean |
isAdjustRadarForGunTurn() Checks if the radar is set to adjust for the gun turning, i.e. to turn independent from the gun's turn. |
boolean |
isAdjustRadarForRobotTurn() Checks if the radar is set to adjust for the robot turning, i.e. to turn independent from the robot's body turn. |
void |
setTurnRadarLeft(double degrees) Sets the robot's radar to turn left by degrees when the next execution takes place. |
void |
setTurnRadarRight(double degrees) Sets the robot's radar to turn right by degrees when the next execution takes place. |
double |
getRadarTurnRemaining() Returns the angle remaining in the radar's turn, in degrees. |
Gun Method |
void |
setFire(double power) Sets the gun to fire a bullet when the next execution takes place. |
Bullet |
setFireBullet(double power) Sets the gun to fire a bullet when the next execution takes place. |
void |
setTurnGunLeft(double degrees) Sets the robot's gun to turn left by degrees when the next execution takes place. |
void |
setTurnGunRight(double degrees) Sets the robot's gun to turn right by degrees when the next execution takes place. |
double |
getGunTurnRemaining() Returns the angle remaining in the gun's turn, in degrees. |
boolean |
isAdjustGunForRobotTurn() Checks if the gun is set to adjust for the robot turning, i.e. to turn independent from the robot's body turn. |
Event |
Bullet Event |
Vector <BulletHitBulletEvent> |
getBulletHitBulletEvents() Returns a vector containing all BulletHitBulletEvents currently in the robot's queue. |
Vector <BulletHitEvent> |
getBulletHitEvents() Returns a vector containing all BulletHitEvents currently in the robot's queue. |
Vector <BulletMissedEvent> |
getBulletMissedEvents() Returns a vector containing all BulletMissedEvents currently in the robot's queue. |
Vector <HitByBulletEvent> |
getHitByBulletEvents() Returns a vector containing all HitByBulletEvents currently in the robot's queue. |
Hit Event |
Vector <HitRobotEvent> |
getHitRobotEvents() Returns a vector containing all HitRobotEvents currently in the robot's queue. |
Vector <HitWallEvent> |
getHitWallEvents() Returns a vector containing all HitWallEvents currently in the robot's queue. |
Enemy Robot Event |
Vector <RobotDeathEvent> |
getRobotDeathEvents() Returns a vector containing all RobotDeathEvents currently in the robot's queue. |
Vector <ScannedRobotEvent> |
getScannedRobotEvents() Returns a vector containing all ScannedRobotEvents currently in the robot's queue. |
Custom Event |
void |
addCustomEvent(Condition condition) Registers a custom event to be called when a condition is met. |
void |
removeCustomEvent(Condition condition) Removes a custom event (specified by condition). |
void |
onCustomEvent(CustomEvent event) This method is called when a custom condition is met. |
Etc |
void |
onDeath(DeathEvent event) This method is called if your robot dies. |
void |
onSkippedTurn(SkippedTurnEvent event) This method is called if the robot is using too much time between actions. |
int |
getEventPriority(String eventClass) Returns the current priority of a class of events. |
void |
setEventPriority(String eventClass, int priority) Sets the priority of a class of events. |
void |
clearAllEvents() Clears out any pending events immediately. |
Vector <Event> |
getAllEvents() Returns a vector containing all events currently in the robot's queue. |
void |
setInterruptible(boolean interruptible) Call this during an event handler to allow new events of the same priority to restart the event handler. |
void |
setInterruptible(boolean interruptible) Call this during an event handler to allow new events of the same priority to restart the event handler. |
Etc |
void |
execute() Executes any pending actions, or continues executing actions that are in process. |
File |
getDataFile(String filename) Returns a file in your data directory that you can write to using RobocodeFileOutputStream or RobocodeFileWriter. |
File |
getDataDirectory() Returns a file representing a data directory for the robot, which can be written to using RobocodeFileOutputStream or RobocodeFileWriter. |
long |
getDataQuotaAvailable() Returns the data quota available in your data directory, i.e. the amount of bytes left in the data directory for the robot. |
void |
waitFor(Condition condition) Does not return until a Condition.test() returns true. |