Greenfoot

Movement

setLocation(x,y)

setLocation(GetX(), GetY())

setLocation(GetX() + 1, GetY())

Change screen resolution to make movement smooth or to make the cells larger and more significant.

setLocation(GetX() , GetY() + 1)

setLocation(GetX() - 1, GetY())

setLocation(GetX() , GetY() - 1)

setRotation(getRotation() + 5)

Move with direction

Helper classes: mover: copy and paste into a new class called mover. set bug to extend mover. Use the move() method to move the bug. Use turn(n) change direction.

if (atWorldEdge() ) {turn (30) }

if (Greenfoot.isKeyDown("right")) {turn(5);}

if (Greenfoot.isKeyDown("left")) {turn(-5);}