|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.properties.Projectile
Property to turn an object into a missile
Field Summary | |
protected java.lang.String |
baseImage_
|
protected Point |
dest_
|
protected int |
interval_
|
protected int |
range_
|
protected Point |
src_
|
protected boolean |
stopped_
Is set to true when stop() is called, so multiple calls to stop() don't result in duping bugs. |
protected GameObject |
target_
|
protected Timer |
timer_
|
Constructor Summary | |
Projectile(GameObject target)
Create an inactive projectile |
|
Projectile(GameObject target,
Point destination,
int interval,
int range)
Create and start a projectile |
Method Summary | |
protected boolean |
advance()
Advance the projectile in the default direction |
Point |
getDestination()
|
int |
getInterval()
|
int |
getRange()
|
Point |
getSource()
|
GameObject |
getTarget()
|
boolean |
maybeReturnToOwner(Commandable agent)
Returns item to the owner's inventory, if we can find the owner in an "agent" property, and |
void |
revertBitmap()
Reverts the target object's image, if we set it to an in-flight image temporarily. |
void |
setDestination(Point dest)
|
void |
setInFlightImage()
Sets the in-flight image for the target object that we're moving. |
void |
setInterval(int interval)
|
void |
setRange(int range)
|
void |
start()
Starts projectile moving toward its destination. |
void |
stop()
Stops projectile. |
void |
timerExpired()
Time to move the projectile |
java.lang.String |
toString()
Returns debugging string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Point src_
protected Point dest_
protected int interval_
protected int range_
protected Timer timer_
protected GameObject target_
protected java.lang.String baseImage_
protected boolean stopped_
Constructor Detail |
public Projectile(GameObject target)
target
- object to be movedpublic Projectile(GameObject target, Point destination, int interval, int range)
target
- object to be moveddestination
- where the object should gointerval
- how long between stepsrange
- how many steps to makeMethod Detail |
public GameObject getTarget()
public Point getSource()
public Point getDestination()
public void setDestination(Point dest)
public int getRange()
public void setRange(int range)
public int getInterval()
public void setInterval(int interval)
public void start()
public void stop()
public void setInFlightImage()
public void revertBitmap()
public void timerExpired()
timerExpired
in interface Timed
protected boolean advance()
public boolean maybeReturnToOwner(Commandable agent)
agent
- the agent who fired it or threw it - may be null
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |