Class Wombat

java.lang.Object
  extended by greenfoot.Actor
      extended by Wombat

public class Wombat
extends greenfoot.Actor

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.

Version:
1.0.1
Author:
Michael Kolling

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

Wombat

public Wombat()
Method Detail

act

public void act()
Do whatever the wombat likes to to just now.

Overrides:
act in class greenfoot.Actor

giraDestra

public void giraDestra()
Turns towards the left.


mangiaFoglia

public void mangiaFoglia()
Eat a leaf.


puoSpostarsi

public boolean puoSpostarsi()
Test if we can move forward. Return true if we can, false otherwise.


recuperaFoglieMangiate

public int recuperaFoglieMangiate()
Tell how many leaves we have eaten.


setDirection

public void setDirection(int direzione)
Sets the direction we're facing.


spostati

public void spostati()
Move one cell forward in the current direction.


trovataFoglia

public boolean trovataFoglia()
Check whether there is a leaf in the same cell as we are.