wyvern.lib.classes.games.SideScroller
Class SideScroller

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.lib.classes.Teleporter
              extended bywyvern.lib.classes.Structure
                  extended bywyvern.lib.classes.games.SideScroller.SideScroller
All Implemented Interfaces:
Applyable, Broadcaster, GameObject, HookCallback, MapAddRemoveListener, MethodHookable, PropertyList, WalkNotify

public class SideScroller
extends Structure
implements HookCallback, MapAddRemoveListener

This class implements a SideScroller level, where movement is handled differently.

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

Field Summary
 
Fields inherited from class wyvern.lib.classes.Teleporter
FORCE_PLAYERS, MAX_DISTANCE, PLEASE_WAIT_MSG
 
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
SideScroller()
           
 
Method Summary
 void checkForFall(GameObject obj)
          Checks whether or not the target should start falling.
 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.
 boolean foundLadder(int x, int y)
          Returns true if the selected square has the property Ladder, meaning that it can support a character's weight.
 boolean gotLedge(GameObject agent, int dir)
          Checks whether or not you can step up onto a ledge
 void hookEvent(java.lang.String hookName, CommandEvent eventobj)
          Movement hook handler
 void initialize()
          Sets default properties.
 boolean isOnLadder(GameObject obj)
          Checks whether or not you're on a ladder.
 void landedOnHead(GameObject top, GameObject bottom)
          Handles the weird case where you landed on something that is moving.
 void objectAdded(GameMap map, int x, int y, GameObject obj)
          An object was added to the map - see if it should fall.
 void objectRemoved(GameMap map, int mx, int my, GameObject obj)
          An object was removed from the map - see if anything above it should fall.
 void remove()
          Removes from the map.
 void setMap(GameMap map, int x, int y)
          Puts the SideScroller in the map, turning it into a SideScroller level.
 
Methods inherited from class wyvern.lib.classes.Structure
setSize, toString
 
Methods inherited from class wyvern.lib.classes.Teleporter
apply, checkBounds, checkPerPlayer, checkRelativePath, chooseRandomLocation, getDestination, getDestLoc, getDestMap, getWaitMessage, loadMap, parseDestination, passedClaim, pathOutIsBlocked, printLoadMessage, setDestination, setDestination, startTeleport, steppedOn, teleport, teleport, teleport, teleport, tryForcing, validateLevel
 
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, 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, 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, setMapLink, setQuantity, setShape, 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
 

Constructor Detail

SideScroller

public SideScroller()
Method Detail

initialize

public void initialize()
Sets default properties.

Specified by:
initialize in interface GameObject
Overrides:
initialize in class Structure

setMap

public void setMap(GameMap map,
                   int x,
                   int y)
Puts the SideScroller in the map, turning it into a SideScroller level.

Specified by:
setMap in interface GameObject
Overrides:
setMap in class Teleporter
Parameters:
map - the map
x - map x location
y - map y location

remove

public void remove()
Removes from the map.

Specified by:
remove in interface GameObject
Overrides:
remove in class MapObject

objectAdded

public void objectAdded(GameMap map,
                        int x,
                        int y,
                        GameObject obj)
An object was added to the map - see if it should fall.

Specified by:
objectAdded in interface MapAddRemoveListener
Parameters:
map - the map calling this method
x - the map x location where the object was added
y - the map y location where the object was added
obj - the GameObject being added.

objectRemoved

public void objectRemoved(GameMap map,
                          int mx,
                          int my,
                          GameObject obj)
An object was removed from the map - see if anything above it should fall.

Specified by:
objectRemoved in interface MapAddRemoveListener
Parameters:
map - the map calling this method
mx - the map x location where the object reference was removed
my - the map y location where the object reference was removed
obj - the GameObject reference being removed from this location

hookEvent

public void hookEvent(java.lang.String hookName,
                      CommandEvent eventobj)
Movement hook handler

Specified by:
hookEvent in interface HookCallback
Parameters:
hookName - hook name
eventobj - the CommandEvent encapsulating the event parameters

gotLedge

public boolean gotLedge(GameObject agent,
                        int dir)
Checks whether or not you can step up onto a ledge


isOnLadder

public boolean isOnLadder(GameObject obj)
Checks whether or not you're on a ladder.


checkForFall

public void checkForFall(GameObject obj)
Checks whether or not the target should start falling.


foundLadder

public boolean foundLadder(int x,
                           int y)
Returns true if the selected square has the property Ladder, meaning that it can support a character's weight.

Parameters:
x - map x location
y - map y location

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
y - map y location
me - ignore this object if it's in the list.
inanimate - whether it's a critter or not

landedOnHead

public void landedOnHead(GameObject top,
                         GameObject bottom)
Handles the weird case where you landed on something that is moving.

Parameters:
top - whoever landed on top
bottom - the critter they landed on