Skip to content

Commit

Permalink
LAst commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joukestoel committed Mar 22, 2013
1 parent c5ceca4 commit 7efd57b
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions your_code_here/src/nl/ordina/nerdingout/round_3/WalTal.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
package nl.ordina.nerdingout.round_3;

import java.awt.Color;

import robocode.AdvancedRobot;
import robocode.HitRobotEvent;
import robocode.HitWallEvent;
import robocode.ScannedRobotEvent;
import static robocode.util.Utils.*;

public class WalTal extends AdvancedRobot {
@Override
public void run() {
while(true) {
// start your engines for round 3!
}
}
@Override
public void run() {
setTurnLeft(Math.random() * 90);
setAdjustRadarForRobotTurn(true);
setColors(Color.CYAN, Color.YELLOW, Color.MAGENTA);
turnLeft(getHeading());
setAhead(1000);
while (true) {
turnRadarLeft(90);
}

}

@Override
public void onHitWall(HitWallEvent event) {
turnRight(90);
setAhead(100000);
}

@Override
public void onScannedRobot(ScannedRobotEvent event) {
if (event.getDistance() < 300) {
turnGunRight(normalRelativeAngleDegrees(((getHeading() -
getGunHeading()) + event.getBearing())));
setFire(3);
}
}

@Override
public void onHitRobot(HitRobotEvent event) {
setAhead(100000);
}
}

0 comments on commit 7efd57b

Please sign in to comment.