|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.rico.adventure.actions.custom.concurrent.AbstractConcurrentAction
de.rico.adventure.actions.custom.concurrent.ConcurrentWalkLoop
public class ConcurrentWalkLoop
A concurrent game action that lets a character walk a path in a looped manner, i.e. if the character reached the end of the path, the path will be walked again from its beginning
Constructor Summary | |
---|---|
ConcurrentWalkLoop(AbstractCharacter c,
Path path,
float speed)
Creates a new walking action with the specified path that provides the waypoints to the target location. |
|
ConcurrentWalkLoop(AbstractCharacter c,
Path path,
float speed,
java.lang.String animName)
Creates a new walking action with the specified path that provides the waypoints to the target location. |
Method Summary | |
---|---|
void |
draw(javax.media.opengl.GL gl)
This method renders the concurrent game action, if needed. |
void |
finishUp()
Implementations of this method hold code that needs to be called before the game action can be removed from the concurrent queue (prematurely) without causing side effects. |
float |
getTargetX()
Returns the x-coordinate of the walking target position |
float |
getTargetZ()
Returns the z-coordinate of the walking target position |
boolean |
hasArrivedAtTarget()
Returns whether the character has arrived at its designated target location. |
void |
update(long elapsedTime)
This method updates the concurrent game action |
Methods inherited from class de.rico.adventure.actions.custom.concurrent.AbstractConcurrentAction |
---|
getEntity |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConcurrentWalkLoop(AbstractCharacter c, Path path, float speed)
c
- the character that walkspath
- path to walk for the characterspeed
- speed factor to use for walkingpublic ConcurrentWalkLoop(AbstractCharacter c, Path path, float speed, java.lang.String animName)
c
- the character that walkspath
- path to walk for the characterspeed
- speed factor to use for walkinganimName
- name of the animation to play while the
action is activeMethod Detail |
---|
public float getTargetX()
public float getTargetZ()
public boolean hasArrivedAtTarget()
public void update(long elapsedTime)
AbstractConcurrentAction
update
in class AbstractConcurrentAction
elapsedTime
- time between two framespublic void draw(javax.media.opengl.GL gl)
AbstractConcurrentAction
draw
in class AbstractConcurrentAction
public void finishUp()
AbstractConcurrentAction
finishUp
in class AbstractConcurrentAction
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |