Skip to content

Instantly share code, notes, and snippets.

@mrkschan
Created September 26, 2010 01:20
Show Gist options
  • Save mrkschan/597470 to your computer and use it in GitHub Desktop.
Save mrkschan/597470 to your computer and use it in GitHub Desktop.
public void onStatus(StatusEvent e) {
final RobotStatus s = e.getStatus();
others = peer.getOthers();
energy = Math.max(1, (int) (s.getEnergy() + 0.5));
robotX = (int) (s.getX() + 0.5);
robotY = (int) (s.getY() + 0.5);
heading = (int) (s.getHeading() + 0.5);
gunHeading = (int) (s.getGunHeading() + 0.5);
gunBearing = (int) (Utils.normalRelativeAngle(s.getGunHeading() - s.getHeading()) + 0.5);
//~ heading = (int) (toDegrees(s.getHeading()) + 0.5);
//~ gunHeading = (int) (toDegrees(s.getGunHeading()) + 0.5);
//~ gunBearing = (int) (toDegrees(Utils.normalRelativeAngle(s.getGunHeading() - s.getHeading())) + 0.5);
gunReady = (s.getGunHeat() <= 0);
currentTurn = e.getTime();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment