|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectgameComponents.ScoreTallySprite
public class ScoreTallySprite
This class encapsulates an on-screen sprite that represents a shooter in our asteroids-like video game. This class supports linear translation of the sprite along the x and y dimensions. It does not support rotation yet.
| Constructor Summary | |
|---|---|
ScoreTallySprite(java.awt.Dimension dimensionOfDrawingRegion)
Constructs a sprite located at the 0,0 position |
|
| Method Summary | |
|---|---|
java.awt.geom.Rectangle2D |
getBounds2D()
This method returns a rectangular box that completely encloses this sprite. |
int |
getCurrentX()
Accessor for this sprite's current x position |
int |
getCurrentY()
Accessor for this sprite's current y position |
int |
getHeight()
This method returns the height of the bounding box that contains this sprite |
int |
getWidth()
This method returns the width of the bounding box that contains this sprite |
void |
registerAmmoUsed()
Update the culmulative ammo tally. |
void |
registerHit(gameComponents.TargetSprite theTarget)
|
void |
specifyDrawing(java.awt.Graphics2D g)
This method takes the passed Graphics2D object and specifies how this sprite should be drawn on it. |
| 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 int getCurrentX()
public int getCurrentY()
public void specifyDrawing(java.awt.Graphics2D g)
specifyDrawing in interface gameComponents.Spritepublic int getWidth()
public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D in interface gameComponents.Spritepublic int getHeight()
public void registerHit(gameComponents.TargetSprite theTarget)
theTarget - public void registerAmmoUsed()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||