Class MotherShip

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

public abstract class MotherShip
extends greenfoot.Actor

This class implements some of the more complicated functionality of the ship, and is provided complete. It does not need to be modified.

Version:
21/03/2008
Author:
Michael Berry

Constructor Summary
MotherShip()
           
 
Method Summary
 void act()
          Act - do whatever the Ship wants to do.
 void addedToWorld(greenfoot.World world)
          Called when the object is added into the world, you can safely ignore this method.
 void fire()
          Fires a shot
 boolean isShot()
          Returns whether the ship is shot
 void moveLeft()
          Move the ship left
 void moveRight()
          Move the ship right
 boolean shotKey()
          Returns whether a shot should be fired.
 void updateScore(int x)
          Updates the score.
 
Methods inherited from class greenfoot.Actor
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

MotherShip

public MotherShip()
Method Detail

act

public void act()
Act - do whatever the Ship wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment.

Overrides:
act in class greenfoot.Actor

addedToWorld

public void addedToWorld(greenfoot.World world)
Called when the object is added into the world, you can safely ignore this method.

Overrides:
addedToWorld in class greenfoot.Actor

fire

public void fire()
Fires a shot


isShot

public boolean isShot()
Returns whether the ship is shot

Returns:
True if the ship has been shot

moveLeft

public void moveLeft()
Move the ship left


moveRight

public void moveRight()
Move the ship right


shotKey

public boolean shotKey()
Returns whether a shot should be fired.

Returns:
true if a shot needs to be fired.

updateScore

public void updateScore(int x)
Updates the score. Calls the update method of score.