java.lang.Objectgreenfoot.Actor
Score
public class Score
Keeps track of the user's score.
| 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 |
|---|
public Score()
| Method Detail |
|---|
public void addedToWorld(greenfoot.World world)
addedToWorld in class greenfoot.Actorworld - The world the object was added to.public int getScore()
public void updateScore(int x)
x - The number of points to update the score by. Negative values of x take away points