gameComponents
Class TargetSprite

java.lang.Object
  extended by gameComponents.TargetSprite
All Implemented Interfaces:
Sprite

public class TargetSprite
extends java.lang.Object
implements Sprite


Constructor Summary
TargetSprite(java.awt.Dimension dimensionOfDrawingRegion)
          Constructs a sprite located at the 0,0 position
 
Method Summary
 void explode()
          Causes this sprite to explode.
 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 getPointsValue()
          Returns the points value awards if this target is hit
 int getWidth()
          This method returns the width of the bounding box that contains this sprite
 boolean isCollided(Sprite s)
           
 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

TargetSprite

public TargetSprite(java.awt.Dimension dimensionOfDrawingRegion)
Constructs a sprite located at the 0,0 position

Parameters:
dimensionOfDrawingRegion -
Method Detail

getCurrentX

public int getCurrentX()
Accessor for this sprite's current x position

Returns:
as specified above

getCurrentY

public int getCurrentY()
Accessor for this sprite's current y position

Returns:
as specified above

specifyDrawing

public void specifyDrawing(java.awt.Graphics2D g)
This method takes the passed Graphics2D object and specifies how this sprite should be drawn on it.

Specified by:
specifyDrawing in interface Sprite

getWidth

public int getWidth()
This method returns the width of the bounding box that contains this sprite

Returns:
as described above

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
This method returns a rectangular box that completely encloses this sprite. The bounding box can be assumed to be the smallest bounding box that is possible.

Specified by:
getBounds2D in interface Sprite
Returns:
as described above

getHeight

public int getHeight()
This method returns the height of the bounding box that contains this sprite

Returns:
as described above

isCollided

public boolean isCollided(Sprite s)

explode

public void explode()
Causes this sprite to explode. Presently the explosion is very anti-climatic (it just disappears).


getPointsValue

public int getPointsValue()
Returns the points value awards if this target is hit

Returns: