|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--SpaceInvaders.Score
Maintains and displays the game score.
| Field Summary | |
private int |
oldScore
the previous game score |
private Point |
screenPos
screen position of score display |
private int |
theScore
the current game's score |
| Constructor Summary | |
Score()
Default constructor initializes score to zero and sets the screen position of score display to (10, 10). |
|
Score(int startingScore,
Point onScreen)
Accepts score and screen position. |
|
| Method Summary | |
void |
draw(java.awt.Graphics g)
Draws the score on the screen. |
void |
increment()
Increments the score by 1, the default increment. |
void |
increment(int i)
Increments the score by a specified amount. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private int theScore
private int oldScore
private Point screenPos
| Constructor Detail |
public Score()
public Score(int startingScore,
Point onScreen)
startingScore - the score settingonScreen - the screen position of score display| Method Detail |
public void draw(java.awt.Graphics g)
g - the Graphics contextpublic void increment()
public void increment(int i)
i - score increment
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||