wyvern.lib.classes.games.SideScroller
Class FallingDown

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.lib.classes.games.SideScroller.FallingDown
All Implemented Interfaces:
Broadcaster, GameObject, MethodHookable, PropertyList, Timed

public class FallingDown
extends MapObject
implements Timed

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

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  boolean LOG
           
protected  GameObject scroller_
           
protected  boolean stopAfterMove_
           
protected  GameObject target_
           
protected  Timer timer_
           
protected  java.lang.String toString_
           
 
Fields inherited from class wyvern.kernel.maps.MapObject
IN_MAP_EDITOR, listenerList_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Constructor Summary
FallingDown(GameObject target, java.util.List directions, int interval, boolean jumping, GameObject scroller)
          Make someone or something start moving.
 
Method Summary
protected  boolean advance()
          Advance them in the default direction
 boolean doesSupport(int x, int y, GameObject me, boolean inanimate)
          Returns true if the selected square has the properties "blocking" or "ladder", meaning that it can support a character's weight.
 java.util.List getDirections()
          Returns the list of directions to move.
 int getInterval()
          Returns the speed at which we're falling or moving.
 GameObject getTarget()
          Returns the target we're moving.
 boolean keepFalling(GameObject obj)
          Checks whether or not the target should keep falling
 void setDirections(java.util.List dirs)
          Reset the list of directions.
 void setInterval(int interval)
          Sets the speed at which we're moving.
 void start()
          Starts them moving in the desired direction.
 void stop()
          Stop falling.
 void timerExpired()
          Time to move them.
 java.lang.String toString()
          Returns debugging string.
 
Methods inherited from class wyvern.kernel.maps.MapObject
addContainerChangeListener, addDefaultProperty, addMapChangeListener, addMapMotionListener, addMethodHook, addMotionTracker, addObjectTracker, addPrefix, addSuffix, addToMap, bless, broadcast, broadcast, broadcast, broadcast, broadcast, canEnter, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, destroy, ensureListenerList, ensureWeight, externalize, fireContainerEntered, fireContainerExited, fireEnteredMap, fireExitedMap, fireMovedInMap, getAlpha, getAppearance, getArchetype, getBaseName, getBaseWeight, getBitmap, getBounds, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, getDescription, getDirection, getGenderPossessive, getGenderPronoun, getImage, getImageDescriptor, getImageDescriptors, getLayer, getLocations, getMap, getMapLink, getMaterial, getMaterialDescription, getMover, getOwningPlayer, getParentMap, getPrefixes, getQuantity, getReferenceLoc, getRelativeLocs, getShortDesc, getSuffixes, getTile, getTile, getValue, getWeight, groupString, inContainer, initialize, initLocs, inMapEditor, invalidate, invalidateImage, invalidateParent, invalidateText, isAnimated, isAttackable, isBlessed, isCommandable, isCursed, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, remove, removeContainerChangeListener, removeFromMap, removeMapChangeListener, removeMapMotionListener, removeMethodHook, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, runMethodHook, setAlpha, setAnimated, setBitmap, setCategory, setContainer, setDefaultBitmap, setDefaultCategory, setDefaultDesc, setDefaultImage, setDefaultIntProperty, setDefaultLayer, setDefaultMaterial, setDefaultProperty, setDefaultShortDesc, setDirection, setImage, setImage, setLayer, setLocations, setMap, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, teleport, updateMapLocation
 
Methods inherited from class wyvern.kernel.properties.PList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wyvern.lib.PropertyList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, getDoubleProperty, getInheritedProperty, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 

Field Detail

interval_

protected int interval_

timer_

protected Timer timer_

target_

protected GameObject target_

dirs_

protected java.util.List dirs_

currentDir_

protected int currentDir_

jumping_

protected boolean jumping_

distanceFallen_

protected int distanceFallen_

stopAfterMove_

protected boolean stopAfterMove_

scroller_

protected GameObject scroller_

LOG

protected boolean LOG

toString_

protected java.lang.String toString_
Constructor Detail

FallingDown

public FallingDown(GameObject target,
                   java.util.List directions,
                   int interval,
                   boolean jumping,
                   GameObject scroller)
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 (millis)
Method Detail

getTarget

public GameObject getTarget()
Returns the target we're moving.


getDirections

public java.util.List getDirections()
Returns the list of directions to move.


setDirections

public void setDirections(java.util.List dirs)
Reset the list of directions.


getInterval

public int getInterval()
Returns the speed at which we're falling or moving.


setInterval

public void setInterval(int interval)
Sets the speed at which we're moving.


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

keepFalling

public boolean keepFalling(GameObject obj)
Checks whether or not the target should keep falling


doesSupport

public boolean doesSupport(int x,
                           int y,
                           GameObject me,
                           boolean inanimate)
Returns true if the selected square has the properties "blocking" or "ladder", meaning that it can support a character's weight. Ignores a particular object. Use this when the agent is actually IN location (x,y), but we need to check anyway.

Parameters:
x - map x location to check
y - map y location to check
me - ignore this object if it's in the list.
inanimate - whether it's a critter or not (false if critter)

toString

public java.lang.String toString()
Returns debugging string.

Overrides:
toString in class MapObject
Returns:
a short String describing this object. If the object represents a group of items, such as coins, the returned description will be a modified version of the description that includes quantity information.