Class Score

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

public class Score
extends greenfoot.Actor

Keeps track of the user's score.

Version:
21/03/2008
Author:
Michael Berry

Constructor Summary
Score()
           
 
Method Summary
 void addedToWorld(greenfoot.World world)
          Called when the object is added to the world
 int getScore()
          Returns the numerical value of the score.
 void updateScore(int x)
          Updates the score.
 
Methods inherited from class greenfoot.Actor
act, 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

Score

public Score()
Method Detail

addedToWorld

public void addedToWorld(greenfoot.World world)
Called when the object is added to the world

Overrides:
addedToWorld in class greenfoot.Actor
Parameters:
world - The world the object was added to.

getScore

public int getScore()
Returns the numerical value of the score.

Returns:
The score.

updateScore

public void updateScore(int x)
Updates the score.

Parameters:
x - The number of points to update the score by. Negative values of x take away points