Module/Movement/Walls

From Robowiki
< Module‎ | Movement
Revision as of 00:52, 24 March 2008 by Jab (talk | contribs) (Module movement Walls)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
package jab.movement;

import jab.Module;
import jab.Movement;

/**
 * Credits
 * Walls - a sample robot by Mathew Nelson, and maintained by Flemming N. Larsen
 **/
public class Walls extends Movement{
	
	public Walls(Module bot) {
		super(bot);
	}

	public void move() {				
		if (bot.getHeading() % 90 != 0) bot.setTurnLeft(bot.getHeading() % 90);		
		bot.setAhead(Double.POSITIVE_INFINITY);
		if (bot.getVelocity()==0)
			bot.setTurnRight(90);
	}
}