Class SRVector

java.lang.Object
   |
   +----java.util.Vector
           |
           +----SpriteVector
                   |
                   +----SRVector

public class SRVector
extends SpriteVector
This class extends the SpriteVector class and overrides the methods "isPointInside" and "collision". This allows the program to distinguish which Sprite is being clicked (because of z-order it would by default indicate the "gun" Sprite) and eliminate Sprite collision detection. This class is taken directly from the book "Teach yourself Internet Game Programming with Java in 21 days" by Michael Morrison. See chapter 13 for details.


Constructor Index

 o SRVector(Background)

Method Index

 o collision(int, int)
None of the Sprites need collision handling so this method is overridden to do nothing.
 o isPointInside(Point)
This method is necessary to determine when and "Eye" class has been clicked by the mouse otherwise because of the z-ordering of bitmap images the "gun" image would always be returned.

Constructors

 o SRVector
 public SRVector(Background back)

Methods

 o isPointInside
 Sprite isPointInside(Point pt)
This method is necessary to determine when and "Eye" class has been clicked by the mouse otherwise because of the z-ordering of bitmap images the "gun" image would always be returned.

Overrides:
isPointInside in class SpriteVector
 o collision
 protected boolean collision(int i,
                             int iHit)
None of the Sprites need collision handling so this method is overridden to do nothing.

Overrides:
collision in class SpriteVector