Hi guys.
Im guessing this is just something to do with the syntax or im missing something of some sort but why does the robot for the following code go diagonal instead of following the steps after the if statement? How would i make the robot follow each command instead? Thanks.
public void act() { if(endItNow()==true) { Greenfoot.stop(); } else { int x = getX(); int y = getY(); setLocation(x+1,y); if(checkBumpers()==true) setLocation(x, y-1); > setLocation(x + 1, y); > setLocation(getX(), getY() - 1); } }