unc.cdva.interactiveitems
Class Target
java.lang.Object
unc.cdva.utils.TaggedObject
unc.cdva.interactiveitems.InteractiveItem
unc.cdva.interactiveitems.AnimatedItem
unc.cdva.interactiveitems.MobileItem
unc.cdva.interactiveitems.Target
- All Implemented Interfaces:
- Taggable
public class Target
- extends MobileItem
Stores state of a target as well as static data, such as
target min/max speed, and min/max scaling.
(note a target is something like a boat, do not confuse it
with a reticle)
- Author:
- Dan Van Atta, Guillaume Conte
Constructor Summary |
Target()
Initializes a target to some offscreen location, the initial
state is stopped, set it to moving to have the target start
moving on screen. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Target
public Target()
- Initializes a target to some offscreen location, the initial
state is stopped, set it to moving to have the target start
moving on screen.
advanceInTime
public void advanceInTime(long delta)
- Advances the target in time, effectively it updates the position
of the boat, when the screen is redrawn it will move.
- Specified by:
advanceInTime
in class MobileItem
- Parameters:
delta
- the amount of time to elapse
sink
public void sink()
- Sets the state of the target to 'sinking.'
explode
public void explode()
- Sets the state of the target to 'exploding.'
isSunk
public boolean isSunk()
- Returns:
- True if the target is in the 'sining' state, false otherwise.
isExploding
public boolean isExploding()
- Returns:
- True if the target is in the 'exploding' state, false otherwise.
getMaxScaling
public static javax.vecmath.Vector3f getMaxScaling()
- Returns:
- Returns the maxScaling.
getMaxSpeed
public static float getMaxSpeed()
- Returns:
- Returns the maxSpeed.
getMinScaling
public static javax.vecmath.Vector3f getMinScaling()
- Returns:
- Returns the minScaling.
getMinSpeed
public static float getMinSpeed()
- Returns:
- Returns the minSpeed.
setMaxScaling
public static void setMaxScaling(javax.vecmath.Vector3f maxScaling)
- Parameters:
maxScaling
- The maxScaling to set.
setMaxSpeed
public static void setMaxSpeed(float maxSpeed)
- Parameters:
maxSpeed
- The maxSpeed to set.
setMinScaling
public static void setMinScaling(javax.vecmath.Vector3f minScaling)
- Parameters:
minScaling
- The minScaling to set.
setMinSpeed
public static void setMinSpeed(float minSpeed)
- Parameters:
minSpeed
- The minSpeed to set.