|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--netwar.game.Projectile
Abstract class representing one shot fired from some weapon.
| Field Summary | |
protected Point3D |
center
The game-space location of the center of the projectile. |
protected int |
damage
The amount of damage the shot will deal if it hits something. |
protected GameObject |
enemy
The object that the shot was intended to hit (in case it is relevant) |
protected int |
life
The number of frames remaining before this projectile must cease existing (it may cease before then) |
protected GameObject |
maker
The object that fired this shot (in case it is relevant) |
protected static Vector |
Projectiles
The vector containing all currently existing Projectiles. |
protected int |
radiusSquared
The square of the radius of explosion for this shot. |
protected Point3D |
velocity
The velocity of the projectile, in game-space units per time-step |
| Constructor Summary | |
Projectile()
|
|
| Method Summary | |
protected boolean |
basicUpdate()
Performs functions which will be needed by most Projectiles during Update(). |
abstract void |
draw(GameViewer v)
Displays this projectile on GameViewer v. |
static void |
DrawAll(GameViewer v)
Draws all projectiles in the game onto GameViewer v |
protected abstract void |
Explode()
Deals damage to nearby GameObjects, makes flashy graphics, and calls Fizzle(). |
protected void |
Fizzle()
Removes this from the game |
protected abstract boolean |
mustExplode()
Return true iff it should detonate when it's life runs out. |
static void |
newProjectile(Projectile add,
Point3D where,
Point3D going,
int power,
int rad2,
int duration,
GameObject origin,
GameObject target)
This method initializes a Projectile. |
protected abstract void |
Update()
Function to perform the processing needed during a single time-step. |
static void |
UpdateAll()
Calls update() on all Projectiles in the Vector. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Point3D center
protected Point3D velocity
protected GameObject maker
protected GameObject enemy
protected int life
protected int damage
protected int radiusSquared
protected static Vector Projectiles
| Constructor Detail |
public Projectile()
| Method Detail |
public static void newProjectile(Projectile add,
Point3D where,
Point3D going,
int power,
int rad2,
int duration,
GameObject origin,
GameObject target)
add - The Projectile to incorporate into the game.where - The initial value of center.going - The initial value of velocity.power - The initial value of damage.rad2 - The initial value of radiusSquared.duration - The initial value of life.origin - The initial value of maker.target - The initial value of enemy.public static void UpdateAll()
protected boolean basicUpdate()
protected abstract void Update()
public static void DrawAll(GameViewer v)
v - The GameViewer seeking to display all the Projectiles.public abstract void draw(GameViewer v)
v - The GameViewer seeking to display this Projectile.protected abstract boolean mustExplode()
protected abstract void Explode()
protected void Fizzle()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||