netwar.game.projectile
Class ProjectileDefault

java.lang.Object
  |
  +--netwar.game.Projectile
        |
        +--netwar.game.projectile.ProjectileDefault

public class ProjectileDefault
extends Projectile

This projectile flies straight. When it passes the target, it explodes. If it lasts out its duration, it explodes.

Author:
Group N2 - Project Netwar, Daniel Grund

Fields inherited from class netwar.game.Projectile
center, damage, enemy, life, maker, Projectiles, radiusSquared, velocity
 
Constructor Summary
ProjectileDefault()
          Creates a new instance of ProjectileDefault
 
Method Summary
 void draw(GameViewer v)
          Draw self onto v.
protected  void Explode()
          Deal damage to the target, if it is in range.
protected  boolean mustExplode()
          Projectile default will simply fizzle if its life runs out (highly unlikely)
protected  void Update()
          Move forward.
 
Methods inherited from class netwar.game.Projectile
basicUpdate, DrawAll, Fizzle, newProjectile, UpdateAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectileDefault

public ProjectileDefault()
Creates a new instance of ProjectileDefault
Method Detail

Explode

protected void Explode()
Deal damage to the target, if it is in range.
Overrides:
Explode in class Projectile

Update

protected void Update()
Move forward. Explode if it passes the enemies midpoint
Overrides:
Update in class Projectile

draw

public void draw(GameViewer v)
Draw self onto v. Drawn as a single green line segment. The line segment extends from where the projectile is to where it was last frame.
Overrides:
draw in class Projectile
Following copied from class: netwar.game.Projectile
Parameters:
v - The GameViewer seeking to display this Projectile.

mustExplode

protected boolean mustExplode()
Projectile default will simply fizzle if its life runs out (highly unlikely)
Overrides:
mustExplode in class Projectile
Returns:
false