java.lang.Objectgreenfoot.Actor
Animal
Crab
public class Crab
This class defines a crab. Crabs live on the beach. They like sand worms (very yummy, especially the green ones). Version: 3 In this version, the crab is controlled by the keyboard. It still eats worms if it finds any, of course.
Constructor Summary | |
---|---|
Crab()
|
Method Summary | |
---|---|
void |
act()
Act - do whatever the crab wants to do. |
void |
lookForWorm()
Try to eat a worm. |
Methods inherited from class Animal |
---|
atWorldEdge, getCrabWorld, move, turn |
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 Crab()
Method Detail |
---|
public void act()
act
in class Animal
public void lookForWorm()