{ /** * Act - do whatever the Gammal wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { move(10); //check upper right corner if (getX() >= getWorld() .getWidth()-50 && getY() <= 50 ) { turn(135); } //check lower right corner if (getX() >= getWorld() .getWidth()-50 && getY() >= getWorld() .getHeight()-50 ) { turn (-135); } //check lower left corner if (getX() <= 50 && getY() >= getWorld() .getHeight()-50 ) { turn (-135); } //check upper left corner if (getX() <= 50 && getY() <= 50 ) { turn (135); } } }