|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimulation_MVC_Basic.ScoreTallySprite
public class ScoreTallySprite
This class encapsulates an on-screen score tally.
Constructor Summary | |
---|---|
ScoreTallySprite(java.awt.Dimension dimensionOfDrawingRegion)
Constructs a sprite located in the upper left corner. |
Method Summary | |
---|---|
void |
draw(java.awt.Graphics2D g)
This method takes the passed Graphics2D object and specifies how this sprite should be drawn on it. |
java.awt.geom.Rectangle2D |
getBounds2D()
This method returns a rectangular box that completely encloses this sprite. |
int |
getPointsValue()
Returns the points value that is associated with hitting this sprite with a projectile |
void |
registerAmmoUsed()
Update the cumulative ammo tally by one. |
void |
registerHit(Sprite theTarget)
Registers that a hit was accomplished on the target that is passed as a parameter. |
void |
resetAmmoTally()
Reset the cumulative ammo back to zero. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScoreTallySprite(java.awt.Dimension dimensionOfDrawingRegion)
dimensionOfDrawingRegion
- Method Detail |
---|
public void draw(java.awt.Graphics2D g)
draw
in interface Sprite
public java.awt.geom.Rectangle2D getBounds2D()
Sprite
getBounds2D
in interface Sprite
public void registerHit(Sprite theTarget)
theTarget
- public void registerAmmoUsed()
public void resetAmmoTally()
public int getPointsValue()
Sprite
getPointsValue
in interface Sprite
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |