java.lang.Objectgreenfoot.Actor
Animal
public class Animal
Animal. This is the base class for all animals. In addition to the standard Actor methods, it provides the ability to move and turn.
Constructor Summary | |
---|---|
Animal()
|
Method Summary | |
---|---|
void |
act()
Do whatever the wombat likes to to just now. |
boolean |
atWorldEdge()
Test if we are close to one of the edges of the world. |
CrabWorld |
getCrabWorld()
Return the world object. |
void |
move()
Move forward in the current direction. |
void |
turn(int angle)
Turn 'angle' degrees towards the right (clockwise). |
Methods inherited from class greenfoot.Actor |
---|
addedToWorld, getHeight, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWidth, getWorld, getX, getY, intersects, setImage, setImage, setLocation, setRotation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Animal()
Method Detail |
---|
public void act()
act
in class greenfoot.Actor
public boolean atWorldEdge()
public CrabWorld getCrabWorld()
public void move()
public void turn(int angle)