gizmoball.gameworld.gameobjects
Class HomingMissile

java.lang.Object
  extended by gizmoball.gameworld.GameObject
      extended by gizmoball.gameworld.gameobjects.Ball
          extended by gizmoball.gameworld.gameobjects.SimpleBall
              extended by gizmoball.gameworld.gameobjects.HomingMissile

public class HomingMissile
extends SimpleBall

A ball that tracks towards the EnemyShips in the WorldState


Constructor Summary
HomingMissile(Vect3 position, Vect3 velocity, double maxVelocity, double turnRate, WorldState ws, java.util.List<java.lang.Class<? extends Gizmo>> homeTo, java.awt.Color c)
           
 
Method Summary
 GraphicsProperties getGraphicsProperties()
          Returns an object that holds the information necessary for drawing this object.
 void update(double dt)
          This has the GameObject update its internal state, to move forward in time by an amount dt.
 
Methods inherited from class gizmoball.gameworld.gameobjects.SimpleBall
copy, getBoundingBox, getDefaultTriggers, getGravity, getSphere, getXMLString, setFriction, setGravity, setPosition, setVelocity
 
Methods inherited from class gizmoball.gameworld.GameObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HomingMissile

public HomingMissile(Vect3 position,
                     Vect3 velocity,
                     double maxVelocity,
                     double turnRate,
                     WorldState ws,
                     java.util.List<java.lang.Class<? extends Gizmo>> homeTo,
                     java.awt.Color c)
Method Detail

getGraphicsProperties

public GraphicsProperties getGraphicsProperties()
Description copied from class: GameObject
Returns an object that holds the information necessary for drawing this object. Making changes to this object changes the underlying object, so those changes will be reflected in the drawer.

Overrides:
getGraphicsProperties in class SimpleBall
Returns:
all the information needed to draw this object.

update

public void update(double dt)
Description copied from class: GameObject
This has the GameObject update its internal state, to move forward in time by an amount dt. It is very important that the state variables used for this calculation are the same values as available before the calculation. For instance, when a ball is moving under the influence of gravity, update() must first move the ball, then update the velocity. This way if you try to externally calculate where the ball will be in a time dt, this will also be the position of the ball in time dt.

Overrides:
update in class SimpleBall
Parameters:
dt - the amount to move forward in time