Class Vehicle

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

public class Vehicle
extends greenfoot.Actor

Vehicle. This is the base class for all vehicles. In addition to the standard Actor methods, it provides the ability to move and turn. Based on the Animal class in the little-crab scenario (written by Michael Kolling).

Version:
1.0
Author:
Adrienne Decker

Constructor Summary
Vehicle()
          Constructor for Animal - nothing to do.
 
Method Summary
 void act()
          Act - empty method.
 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 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, getImage, getIntersectingObjects, getNeighbours, getObjectsAtOffset, getObjectsInRange, getOneIntersectingObject, getOneObjectAtOffset, getRotation, 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

Vehicle

public Vehicle()
Constructor for Animal - nothing to do.

Method Detail

act

public void act()
Act - empty method. Animals have no default action.

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.


canSee

public boolean canSee(java.lang.Class clss)
Return true if we can see an object of class 'clss' right where we are. False if there is no such object here.


move

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


turn

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