wyvern.lib.properties
Class FallingDown

java.lang.Object
  extended bywyvern.lib.properties.FallingDown
All Implemented Interfaces:
Timed

public class FallingDown
extends java.lang.Object
implements Timed

Property to make a player "fall" towards the bottom of the screen... or some other direction.

Version:
1.0, Aug 13, 2002
Author:
Frank Sronce

Field Summary
protected  int currentDir_
           
protected  java.util.List dirs_
           
protected  int distanceFallen_
           
protected  int interval_
           
protected  boolean jumping_
           
protected  int size_
           
protected  Point src_
           
protected  GameObject target_
           
protected  Timer timer_
           
 
Constructor Summary
FallingDown(GameObject target, java.util.List directions, int interval, boolean jumping)
          Make someone or something start moving.
 
Method Summary
protected  boolean advance()
          Advance them in the default direction
 java.util.List getDirections()
           
 int getInterval()
           
 Point getSource()
           
 GameObject getTarget()
           
 void setDirections(java.util.List dirs)
           
 void setInterval(int interval)
           
 void start()
          Starts them moving in the desired direction.
 void stop()
          Stop falling.
 void timerExpired()
          Time to move them
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

src_

protected Point src_

interval_

protected int interval_

timer_

protected Timer timer_

target_

protected GameObject target_

dirs_

protected java.util.List dirs_

currentDir_

protected int currentDir_

size_

protected int size_

jumping_

protected boolean jumping_

distanceFallen_

protected int distanceFallen_
Constructor Detail

FallingDown

public FallingDown(GameObject target,
                   java.util.List directions,
                   int interval,
                   boolean jumping)
Make someone or something start moving.

Parameters:
target - object to be moved
directions - a list of directions to move. the last one keeps going until you hit something.
interval - how long between steps
Method Detail

getTarget

public GameObject getTarget()

getSource

public Point getSource()

getDirections

public java.util.List getDirections()

setDirections

public void setDirections(java.util.List dirs)

getInterval

public int getInterval()

setInterval

public void setInterval(int interval)

start

public void start()
Starts them moving in the desired direction.


stop

public void stop()
Stop falling.


timerExpired

public void timerExpired()
Time to move them

Specified by:
timerExpired in interface Timed

advance

protected boolean advance()
Advance them in the default direction

Returns:
true if we should continue moving, false otherwise