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 methods to check for being at the edge of the world, as well as seeing and eating other classes.
Constructor Summary | |
---|---|
Animal()
|
Method Summary | |
---|---|
boolean |
atWorldEdge()
Test if we are close to one of the edges of the world. |
boolean |
canSee(java.lang.Class clss)
Return true if we can see an object of class 'clss' right where we are. |
void |
eat(java.lang.Class clss)
Try to eat an object of class 'clss'. |
void |
move()
Move forward in the current direction. |
Methods inherited from class greenfoot.Actor |
---|
act, addedToWorld, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getX, getY, intersects, isTouching, move, removeTouching, setImage, setImage, setLocation, setRotation, turn, turnTowards |
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 move()
public boolean atWorldEdge()
public boolean canSee(java.lang.Class clss)
public void eat(java.lang.Class clss)