Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions RobotPlayer
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,22 @@ public strictfp class RobotPlayer {
}

}

static void runAway() throws GameActionException {
//specific for scouts
//just stay more than seven units away from other robots
RobotInfo[] enemies = rc.senseNearbyRobots(RobotType.SCOUT.sensorRadius, opponentTeam);
int closestRobot = 0;
for(int i = 0; i < enemies.length; i++){
if(rc.getLocation().distanceTo(enemies[i].getLocation()) < closestRobot ){
closestRobot = i;
}
}
if (rc.getLocation().distanceTo(enemies[closestRobot].getLocation()) < 7){
MapLocation newLoc = enemies[closestRobot].getLocation().translate((float)Math.sqrt(7), (float)Math.sqrt(7));
rc.move(newLoc);
}
}

static void reportEnemyArchonsAndGardeners(RobotInfo[] enemies) throws GameActionException {
int i = 0;
Expand Down