|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavoids.BasicSprite
javoids.Sprite
javoids.ShieldedSprite
javoids.Bullet
public final class Bullet
A fired bullet.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javoids.BasicSprite |
---|
BasicSprite.Collision, BasicSprite.Gravity |
Field Summary | |
---|---|
private static int |
DEFAULT_SIZE
The default size for a non-specialized sprite |
protected static int |
MAX_NUMBER
The maximum number of these sprites allowed in the game (36 directions * 5 shots = 180 bullets) |
private static int |
MAX_SIZE
The maximum size for a non-specialized sprite |
private static int |
MIN_SIZE
The minimum size for a non-specialized sprite |
private static long |
serialVersionUID
This is the version used for serializing/deserializing (storing/retrieving) this object |
private boolean |
shielded
is the bullet shielded |
private Item.Type |
weapon
the weapon that shot this bullet |
Fields inherited from class javoids.BasicSprite |
---|
size |
Constructor Summary | |
---|---|
Bullet(BasicSprite _parent,
Health _health,
Move _move,
Item _item)
Constructor |
Method Summary | |
---|---|
int |
getDefaultSize()
|
ImageMap.Name |
getImageNumber()
|
int |
getMaximumSize()
|
int |
getMinimumSize()
|
static int |
getValidSize(int _size)
|
Item.Type |
getWeapon()
|
int |
modifyDamage(int damage)
modify the sprite's damage level |
int |
modifyPoints(int _points)
modify the sprite's point total |
static SpriteVector<Bullet> |
spawn(BasicSprite parent,
int directions,
double initialDirection,
Health health,
Move move,
Item item)
create multiple bullets from a firing wepon |
java.lang.String |
toString()
Provide a String representation of this object. |
Methods inherited from class javoids.ShieldedSprite |
---|
accelerate, collide, collisionDetected, draw, getMass, getShield, move, setDirection, setMove, setRotation, setShield, turn |
Methods inherited from class javoids.Sprite |
---|
getAreas, getColors, getMultiplier, getOriginalImage, getShape, setAreas, setColors, setColors, setImage, setShape, setSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
protected static final int MAX_NUMBER
private static int MAX_SIZE
private static int MIN_SIZE
private static int DEFAULT_SIZE
private boolean shielded
private Item.Type weapon
Constructor Detail |
---|
public Bullet(BasicSprite _parent, Health _health, Move _move, Item _item)
_parent
- this sprite's parent sprite_health
- the health information to use_move
- the movement information to use_item
- the type of item this bullet was created fromMethod Detail |
---|
public int getDefaultSize()
public int getMaximumSize()
public int getMinimumSize()
public static int getValidSize(int _size)
_size
- the size the sprite is desired
public Item.Type getWeapon()
public int modifyPoints(int _points)
BasicSprite
modifyPoints
in class BasicSprite
_points
- the number of points to add to this sprite's point total
public static SpriteVector<Bullet> spawn(BasicSprite parent, int directions, double initialDirection, Health health, Move move, Item item)
parent
- the parent spritedirections
- the number of directions to shoot ininitialDirection
- the initial direction the parent sprite is facinghealth
- the health infromationmove
- the movment informationitem
- the item that created this(these) sprite(s)
public ImageMap.Name getImageNumber()
getImageNumber
in class Sprite
public int modifyDamage(int damage)
BasicSprite
modifyDamage
in class BasicSprite
damage
- the damage amount of damage this sprite sustained
public java.lang.String toString()
toString
in class ShieldedSprite
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |