javoids
Class Shield

java.lang.Object
  extended by javoids.BasicSprite
      extended by javoids.Sprite
          extended by javoids.Shield
All Implemented Interfaces:
java.io.Serializable, Sizes

public final class Shield
extends Sprite

A sprite class to provide a shield to another sprite, protecting it from damage.

Author:
mallette
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javoids.BasicSprite
BasicSprite.Collision, BasicSprite.Gravity
 
Field Summary
private static double CHANCE_ROTATE
          the chance the sprite will rotate
protected static int DEFAULT_AGING_RATE
          the default rate that the sprite ages
protected static int DEFAULT_DURATION
          the default duration
private static int DEFAULT_SIZE
          the sprite's default size
protected static int MAX_DEATHS
          the maximum number of lives
protected static int MAX_DURATION
          the maximum duration
protected static int MAX_NUMBER
          The maximum number of these sprites allowed in the game
protected static int MAX_SIZE
          the sprite's maximum size
protected static int MAXIMUM_DAMAGE_CAPACITY
          the maximum damage elvel
protected static int MIN_SIZE
          the sprite's minimum size
private static double ROTATION
          the amount to rotate by
private static long serialVersionUID
          This is the version used for serializing/deserializing (storing/retrieving) this object
 
Fields inherited from class javoids.BasicSprite
size
 
Constructor Summary
Shield(BasicSprite parent, Health health, Move move, int _size, Shapes.Shape shieldShape)
          Constructor
 
Method Summary
 java.util.Vector<java.awt.Color> getColors()
           
 int getDefaultSize()
           
 ImageMap.Name getImageNumber()
           
 int getMaximumSize()
           
 int getMinimumSize()
           
 void setSize(int _size)
          set the sprite's size
 
Methods inherited from class javoids.Sprite
draw, getAreas, getMultiplier, getOriginalImage, getShape, setAreas, setColors, setColors, setImage, setShape, toString
 
Methods inherited from class javoids.BasicSprite
accelerate, age, collide, collisionDetected, expire, explode, getAgingRate, getAreaChecking, getColor, getDamage, getDeaths, getDirection, getDuration, getGravity, getHealth, getMass, getMaxDamage, getMaxDeaths, getMaxDuration, getMaxVelocity, getMove, getPacmanGame, getParent, getPoints, getRelativeVelocity, getRotation, getScreen, getSize, getX, getY, isAlive, isAutomaticMove, isDisplayAreas, isExploded, isGravitySource, isGravityWell, isHoming, isPlayer, isRestorable, kill, modifyDamage, modifyDeaths, modifyDuration, modifyPoints, move, setAgingRate, setAreaChecking, setAutomaticMove, setDamage, setDeaths, setDirection, setDisplayAreas, setDuration, setGravity, setHealth, setHoming, setMaxDamage, setMaxDuration, setMaxLives, setMaxVelocity, setMove, setPacmanGame, setParent, setPlayer, setPoints, setRotation, setScreen, setX, setY, turn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
This is the version used for serializing/deserializing (storing/retrieving) this object

See Also:
Constant Field Values

MAX_NUMBER

protected static final int MAX_NUMBER
The maximum number of these sprites allowed in the game

See Also:
Constant Field Values

MAX_DEATHS

protected static final int MAX_DEATHS
the maximum number of lives

See Also:
Constant Field Values

MAXIMUM_DAMAGE_CAPACITY

protected static final int MAXIMUM_DAMAGE_CAPACITY
the maximum damage elvel

See Also:
Constant Field Values

MAX_DURATION

protected static final int MAX_DURATION
the maximum duration

See Also:
Constant Field Values

DEFAULT_DURATION

protected static final int DEFAULT_DURATION
the default duration

See Also:
Constant Field Values

DEFAULT_AGING_RATE

protected static final int DEFAULT_AGING_RATE
the default rate that the sprite ages

See Also:
Constant Field Values

MAX_SIZE

protected static final int MAX_SIZE
the sprite's maximum size

See Also:
Constant Field Values

MIN_SIZE

protected static final int MIN_SIZE
the sprite's minimum size

See Also:
Constant Field Values

DEFAULT_SIZE

private static final int DEFAULT_SIZE
the sprite's default size

See Also:
Constant Field Values

CHANCE_ROTATE

private static final double CHANCE_ROTATE
the chance the sprite will rotate

See Also:
Constant Field Values

ROTATION

private static final double ROTATION
the amount to rotate by

See Also:
Constant Field Values
Constructor Detail

Shield

public Shield(BasicSprite parent,
              Health health,
              Move move,
              int _size,
              Shapes.Shape shieldShape)
Constructor

Parameters:
parent - the parent of this sprite
health - the health information
move - the movment information
_size - the size this should be
shieldShape - the shield's shape
Method Detail

getMaximumSize

public int getMaximumSize()
Returns:
the maximum size

getMinimumSize

public int getMinimumSize()
Returns:
the minimum size

getDefaultSize

public int getDefaultSize()
Returns:
the default size

setSize

public void setSize(int _size)
Description copied from class: BasicSprite
set the sprite's size

Overrides:
setSize in class Sprite
Parameters:
_size - the size to set the sprite's size to

getColors

public java.util.Vector<java.awt.Color> getColors()
Overrides:
getColors in class Sprite
Returns:
a list of colors to use for drawing the areas that represent the sprite

getImageNumber

public ImageMap.Name getImageNumber()
Specified by:
getImageNumber in class Sprite
Returns:
the image name for the current image