java.lang.Objectgreenfoot.Actor
Wombat
public class Wombat
Wombat. Un Wombat si muove in avanti fino a che puņ, dopo di che gira a sinistra. Se un wombat trova una foglia, la mangia.
Constructor Summary | |
---|---|
Wombat()
|
Method Summary | |
---|---|
void |
act()
Do whatever the wombat likes to to just now. |
void |
giraDestra()
Turns towards the left. |
void |
mangiaFoglia()
Eat a leaf. |
boolean |
puoSpostarsi()
Test if we can move forward. |
int |
recuperaFoglieMangiate()
Tell how many leaves we have eaten. |
void |
setDirection(int direzione)
Sets the direction we're facing. |
void |
spostati()
Move one cell forward in the current direction. |
boolean |
trovataFoglia()
Check whether there is a leaf in the same cell as we are. |
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 Wombat()
Method Detail |
---|
public void act()
act
in class greenfoot.Actor
public void giraDestra()
public void mangiaFoglia()
public boolean puoSpostarsi()
public int recuperaFoglieMangiate()
public void setDirection(int direzione)
public void spostati()
public boolean trovataFoglia()