Class Animal

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

public class Animal
extends greenfoot.Actor

Animal. This is the base class for all animals. In addition to the standard Actor methods, it provides the ability to move and turn.

Version:
1.0
Author:
Michael Kolling

Constructor Summary
Animal()
           
 
Method Summary
 void act()
          Do whatever the wombat likes to to just now.
 boolean atWorldEdge()
          Test if we are close to one of the edges of the world.
 CrabWorld getCrabWorld()
          Return the world object.
 void move()
          Move forward in the current direction.
 void turn(int angle)
          Turn 'angle' degrees towards the right (clockwise).
 
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

Animal

public Animal()
Method Detail

act

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

Overrides:
act in class greenfoot.Actor

atWorldEdge

public boolean atWorldEdge()
Test if we are close to one of the edges of the world. Return true is we are.


getCrabWorld

public CrabWorld getCrabWorld()
Return the world object.


move

public void move()
Move forward in the current direction.


turn

public void turn(int angle)
Turn 'angle' degrees towards the right (clockwise).