public class Animal
extends greenfoot.Actor
| Constructor and Description |
|---|
Animal() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
act, addedToWorld, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, getWorld, getWorldOfType, getX, getY, intersects, isAtEdge, isTouching, move, removeTouching, setImage, setImage, setLocation, setRotation, turn, turnTowardspublic void move()
public boolean atWorldEdge()
public boolean canSee(java.lang.Class clss)
public void eat(java.lang.Class clss)