wyvern.lib.classes.magic
Class BallSpell

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.kernel.commands.AbstractCommandable
              extended bywyvern.lib.classes.magic.Spell
                  extended bywyvern.lib.classes.magic.BallSpell
All Implemented Interfaces:
Broadcaster, Commandable, Dispellable, GameObject, Hookable, MethodHookable, PropertyList, RemoteAudio, Targetable, Timed
Direct Known Subclasses:
Blizzard, Fireball, FrostWave, PoisonCloud

public abstract class BallSpell
extends Spell
implements Timed

Superclass of fireballs, blizzards, etc.

Version:
1.0, Jan 19, 1998
Author:
Steve Yegge

Nested Class Summary
 
Nested classes inherited from class wyvern.lib.classes.magic.Spell
Spell.DamageVisitor, Spell.UsableReagentPredicate
 
Field Summary
static int CONTRACTING
           
static int DEFAULT_BULLET_SPEED
           
static int DEFAULT_CONTRACT_SPEED
           
static int DEFAULT_EXPAND_SPEED
           
protected  boolean dispelled_
           
static int EXPANDING
           
static int LARGE_BALL_SPELL_RADIUS
           
static int MEDIUM_BALL_SPELL_RADIUS
           
static int SMALL_BALL_SPELL_RADIUS
           
static int UNDETONATED
          These constants represent the possible states of the spell.
 
Fields inherited from class wyvern.lib.classes.magic.Spell
AIR, AIR_AND_DEATH, AIR_AND_LIFE, AIR_AND_MIND, AIR_AND_SPIRIT, ART_MANA_REDUCTIONS, bitmaps_, CONJURATION, damager_, DEATH, DEATH_AND_MIND, DEATH_AND_SPIRIT, EARTH, EARTH_AND_AIR, EARTH_AND_DEATH, EARTH_AND_LIFE, EARTH_AND_MIND, EARTH_AND_SPIRIT, ENCHANTMENT, EVOCATION, FIRE, FIRE_AND_AIR, FIRE_AND_DEATH, FIRE_AND_EARTH, FIRE_AND_LIFE, FIRE_AND_MIND, FIRE_AND_SPIRIT, FIRE_AND_WATER, INCANTATION, LIFE, LIFE_AND_DEATH, LIFE_AND_MIND, LIFE_AND_SPIRIT, MIND, MIND_AND_SPIRIT, SELF_DAMAGE_CHANCE, SPIRIT, WATER, WATER_AND_AIR, WATER_AND_DEATH, WATER_AND_EARTH, WATER_AND_LIFE, WATER_AND_MIND, WATER_AND_SPIRIT
 
Fields inherited from class wyvern.kernel.commands.AbstractCommandable
hookList_, queue_, started_
 
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
 
Fields inherited from interface wyvern.common.net.RemoteAudio
DEFAULT_ALERT_GAIN, DEFAULT_ALERT_REPEAT_DELAY, DEFAULT_ALERT_REPEATS, DEFAULT_GAIN, DEFAULT_REPEAT_DELAY, DEFAULT_REPEATS
 
Constructor Summary
BallSpell()
           
 
Method Summary
 void clearDamageCache()
          Resets the cache of monsters we've damaged this turn.
 void contractBall()
          Contracts the ball in towards the center.
 void coolDown()
          Start contracting the ball.
 void damageMonster(Damageable obj, Spell spell)
          Damages the monster, but only if we haven't
 void damageMonsters()
          Damages all monsters in areas we occupy.
 void decrementCount()
          Decrements the counter on the agent saying they can only have so many ball spells active.
 void dispel()
          Dispels the spell immediately.
 void expandBall()
          Expands the ball out from the center.
 void expandToCell(Point cell, GameMap map, java.util.Set points, java.util.LinkedList turn, Predicate stop, Rectangle bounds)
          Attempts to expand the fireball into the specified cell.
 void explode(Point center)
          Explodes the ball at the given point.
 Rectangle getBounds()
          Returns the bounds of the fireball.
 java.lang.String getBulletBitmap()
          Gets the name of the bitmap to use for the bullet form of the spell.
 Point getCenter()
           
 java.lang.String getCooldownBitmap()
          Gets the bitmap to use when the ball is contracting.
 java.lang.String getDamageType()
          Return the damage type specifier for this spell.
 java.lang.String getExplosionBitmap()
          Gets the bitmap to use when the ball is exploding.
 Predicate getExplosionPredicate()
          Gets the Predicate to use for determining when the spell should explode.
 int[] getImageDescriptors()
          Returns the appearance of the spell, for drawing it to the client.
 int getMaxCasts(Commandable agent)
          Returns max number of concurrent instances of this spell the passed agent is allowed to have at once.
 int getMaxRadius()
          Returns the maximum distance from the center that the spell will expand before starting to shrink.
 int getMaxTravel()
          Returns the maximum distance the ball will travel before detonating on its own.
 java.util.Set getPoints()
          Returns the set of all the points the spell currently occupies.
 Predicate getPropagationPredicate()
          Gets the Predicate to use for determining when the spell should explode.
 int getRadius()
           
 int getSpeed()
          Returns the propagation speed (in millis) of the spell.
 int getState()
          Returns the state of the spell (moving, expanding, contracting).
protected  java.lang.String getTempSpellName()
          Returns the name of a property to set, to keep track of the active spells of this type.
 int getTile(int xloc, int yloc)
          Overrides MapObject.getTile()
 java.util.LinkedList getTurnList()
          Returns the list of "turns" the ball has taken so far.
 void initialize()
          Sets the default properties for this kind of spell.
 void killAnimation()
          Destroys the animation timer, clearing its references.
 void moveBall()
          Moves the undetonated ball in its current direction.
 void setAnimated(boolean animate)
          Gives the object the Animated property with default params.
 void setCenter(Point center)
          Sets the center point for the explosion.
 void setMap(GameMap map, int x, int y)
          Sets the start location.
 void setMaxRadius(int max)
          Sets the maximum radius for the spell.
 void setRadius(int radius)
          Sets the current radius of the spell.
 void setSpeed(int speed)
          This method exists on the off chance that someone wants to set the speed of the spell without knowing (or caring) that it's a BallSpell.
 void setState(int state)
          Sets the state of the spell.
 void start()
          Starts the spell.
 void startTimer()
          Starts the next propagation timer.
 void stop()
          Stops the spell.
 void stopTimer()
          Stops the current propagation timer.
 void timerExpired()
          Propagates the ball spell.
 
Methods inherited from class wyvern.lib.classes.magic.Spell
addReagent, canDamageSelf, canEnter, canEnter, castingOnSelf, cloneSpell, consumeReagents, destroy, ensureAI, ensureDirection, ensureReagents, findTargetObject, findTargetObject, fireDirection, fireLocation, getAgent, getAnimationFrames, getArt, getBlockingPredicate, getCastingDelay, getCommand, getDescString, getElement, getLevel, getLoreCost, getMagicItem, getReagents, getRequiredMana, getSpellArgs, getSpellDescription, getSpellName, getTarget, getTargetName, getTargetPoint, isBlessed, isConjuration, isCursed, isEnchantment, isEvocation, isIncantation, isPotion, logUsage, makeDispellable, reloadSpells, removeFromActiveListIfPresent, setAgent, setLevel, setMagicItem, setSpellArgs, setTarget, setTargetName, setTargetPoint, tellCaster
 
Methods inherited from class wyvern.kernel.commands.AbstractCommandable
addAttack, addHook, addMessageListener, addMethodHook, checkAnimated, command, command, commandNow, ensureEventQueue, fireMessageReceived, getAI, getCapName, getCombatQueue, getEncumbrance, getFiringPoint, getHookList, getHooks, getInventory, getName, getQueue, isCommandable, isStarted, isTelnet, message, message, message, pauseSound, playAlert, playAlert, playDefaultMusic, playPriorityMusic, playPriorityMusic, playSound, playSound, registerCommand, removeAttack, removeHook, removeMessageListener, removeMethodHook, resumeSound, runFailedPostHook, runMethodHook, runPostHook, runPreHook, sendPicture, sendPicture, setAI, setEncumbrance, setMusicGain, setName, setSoundGain, stopAllSounds, stopMusic, stopSound, unregisterCommand
 
Methods inherited from class wyvern.kernel.maps.MapObject
addContainerChangeListener, addDefaultProperty, addMapChangeListener, addMapMotionListener, addMotionTracker, addObjectTracker, addPrefix, addSuffix, addToMap, bless, broadcast, broadcast, broadcast, broadcast, broadcast, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, ensureListenerList, ensureWeight, externalize, fireContainerEntered, fireContainerExited, fireEnteredMap, fireExitedMap, fireMovedInMap, getAlpha, getAppearance, getArchetype, getBaseName, getBaseWeight, getBitmap, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, getDescription, getDirection, getGenderPossessive, getGenderPronoun, getImage, getImageDescriptor, getLayer, getLocations, getMap, getMapLink, getMaterial, getMaterialDescription, getMover, getOwningPlayer, getParentMap, getPrefixes, getQuantity, getReferenceLoc, getRelativeLocs, getShortDesc, getSuffixes, getTile, getValue, getWeight, groupString, inContainer, initLocs, inMapEditor, invalidate, invalidateImage, invalidateParent, invalidateText, isAnimated, isAttackable, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, remove, removeContainerChangeListener, removeFromMap, removeMapChangeListener, removeMapMotionListener, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, setAlpha, setBitmap, setCategory, setContainer, setDefaultBitmap, setDefaultCategory, setDefaultDesc, setDefaultImage, setDefaultIntProperty, setDefaultLayer, setDefaultMaterial, setDefaultProperty, setDefaultShortDesc, setDirection, setImage, setImage, setLayer, setLocations, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, teleport, toString, 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.GameObject
addContainerChangeListener, addMapChangeListener, addMapMotionListener, addMotionTracker, addObjectTracker, addPrefix, addSuffix, bless, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, externalize, getAlpha, getAppearance, getArchetype, getBaseWeight, getBitmap, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, getDescription, getDirection, getGenderPossessive, getGenderPronoun, getImage, getImageDescriptor, getLayer, getLocations, getMap, getMapLink, getMaterial, getMaterialDescription, getMover, getOwningPlayer, getParentMap, getPrefixes, getQuantity, getReferenceLoc, getRelativeLocs, getShortDesc, getSuffixes, getTile, getValue, getWeight, inContainer, inMapEditor, invalidate, invalidateImage, invalidateParent, invalidateText, isAnimated, isAttackable, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, remove, removeContainerChangeListener, removeMapChangeListener, removeMapMotionListener, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, setAlpha, setBitmap, setCategory, setContainer, setDirection, setImage, setImage, setLayer, setLocations, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, teleport
 
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
 
Methods inherited from interface wyvern.lib.Broadcaster
broadcast, broadcast, broadcast, broadcast, broadcast
 

Field Detail

UNDETONATED

public static final int UNDETONATED
These constants represent the possible states of the spell.

See Also:
Constant Field Values

EXPANDING

public static final int EXPANDING
See Also:
Constant Field Values

CONTRACTING

public static final int CONTRACTING
See Also:
Constant Field Values

SMALL_BALL_SPELL_RADIUS

public static final int SMALL_BALL_SPELL_RADIUS
See Also:
Constant Field Values

MEDIUM_BALL_SPELL_RADIUS

public static final int MEDIUM_BALL_SPELL_RADIUS
See Also:
Constant Field Values

LARGE_BALL_SPELL_RADIUS

public static final int LARGE_BALL_SPELL_RADIUS
See Also:
Constant Field Values

DEFAULT_BULLET_SPEED

public static final int DEFAULT_BULLET_SPEED
See Also:
Constant Field Values

DEFAULT_EXPAND_SPEED

public static final int DEFAULT_EXPAND_SPEED
See Also:
Constant Field Values

DEFAULT_CONTRACT_SPEED

public static final int DEFAULT_CONTRACT_SPEED
See Also:
Constant Field Values

dispelled_

protected boolean dispelled_
Constructor Detail

BallSpell

public BallSpell()
Method Detail

initialize

public void initialize()
Sets the default properties for this kind of spell.

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

setMap

public void setMap(GameMap map,
                   int x,
                   int y)
Sets the start location.

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

getImageDescriptors

public int[] getImageDescriptors()
Returns the appearance of the spell, for drawing it to the client.

Many of the objects in the game are rectangular and have a single bitmap that covers all the map locations they occupy. For this reason, MapObject.getImageDescriptors() assumes the object is rectangular (to save most objects a bunch of work), but spells and the like need to override it. If exploding, we return a list of bitmaps to draw, one for each location the spell occupies. (Every object is asked only once for its appearance, NOT once for every time it's found in the map. This is part of the design for making it easy in the general case).

Specified by:
getImageDescriptors in interface GameObject
Overrides:
getImageDescriptors in class MapObject
Returns:
an int array of (x, y, database bitmap number) triples.

getTile

public int getTile(int xloc,
                   int yloc)
Overrides MapObject.getTile()

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

setAnimated

public void setAnimated(boolean animate)
Gives the object the Animated property with default params.

Specified by:
setAnimated in interface GameObject
Overrides:
setAnimated in class MapObject
Parameters:
animate - true to animate the object, false to remove animation

start

public void start()
Starts the spell. Ensures we have a valid direction and map, and aborts the spell if we can't get both.

Specified by:
start in interface Commandable
Overrides:
start in class Spell

stop

public void stop()
Stops the spell.

Specified by:
stop in interface Commandable
Overrides:
stop in class AbstractCommandable

decrementCount

public void decrementCount()
Decrements the counter on the agent saying they can only have so many ball spells active.


startTimer

public void startTimer()
Starts the next propagation timer.


stopTimer

public void stopTimer()
Stops the current propagation timer.


dispel

public void dispel()
Dispels the spell immediately.

Specified by:
dispel in interface Dispellable
Overrides:
dispel in class Spell

killAnimation

public void killAnimation()
Destroys the animation timer, clearing its references. Be careful about calling this before the spell is actually finished, because calling destroy() on the AnimationParams calls stop() on the spell, which has bad side-effects if the spell is actually continuing. (E.g. it decrements the active-spell counter more than once).


getState

public int getState()
Returns the state of the spell (moving, expanding, contracting).

Returns:
the spell state

setState

public void setState(int state)
Sets the state of the spell.

Parameters:
state - the new state (UNDETONATED, EXPANDING, CONTRACTING).

getCenter

public Point getCenter()

getRadius

public int getRadius()

getMaxRadius

public int getMaxRadius()
Returns the maximum distance from the center that the spell will expand before starting to shrink.


setRadius

public void setRadius(int radius)
Sets the current radius of the spell. Should only be called by the AI running the spell.

Parameters:
radius - the new radius of the expanding or contracting ball

setMaxRadius

public void setMaxRadius(int max)
Sets the maximum radius for the spell.

Parameters:
max - the radius when the spell is completely expanded. The diameter of the spell will be (2 * max) + 1; that is, the radius is the number of squares around the center point in any direction.

setCenter

public void setCenter(Point center)
Sets the center point for the explosion. Contrast this with the start location, which is where the spell originated (in bullet form).

Parameters:
center - the center for the explosion. Set only once.
Throws:
java.lang.IllegalStateException - if the center is already set

getTurnList

public java.util.LinkedList getTurnList()
Returns the list of "turns" the ball has taken so far. Each time the ball expands into its neighboring squares, the new neighbors are added to the list for that turn.

Returns:
a LinkedList of LinkedLists. Each sub-list is a list of Points that the spell moved into on that turn. Returns null if the spell hasn't exploded yet. On the first turn (when the ball occupies only one square) the list will have one sub-list with one point in it.

getPoints

public java.util.Set getPoints()
Returns the set of all the points the spell currently occupies.

Overrides:
getPoints in class Spell
Returns:
all points we currently occupy; null if the spell is undetonated.

getBounds

public Rectangle getBounds()
Returns the bounds of the fireball. This is important for getting the map to update properly. The map will only push updates to the client if the bounds of the fireball overlap the client's viewport.

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

getDamageType

public java.lang.String getDamageType()
Return the damage type specifier for this spell.


getBulletBitmap

public java.lang.String getBulletBitmap()
Gets the name of the bitmap to use for the bullet form of the spell.

Returns:
the name of the bitmap to use, in the spells directory

getExplosionBitmap

public java.lang.String getExplosionBitmap()
Gets the bitmap to use when the ball is exploding.


getCooldownBitmap

public java.lang.String getCooldownBitmap()
Gets the bitmap to use when the ball is contracting.


getMaxTravel

public int getMaxTravel()
Returns the maximum distance the ball will travel before detonating on its own.


getSpeed

public int getSpeed()
Returns the propagation speed (in millis) of the spell. The speed is dependent on the spell's state.

Overrides:
getSpeed in class Spell
Returns:
the propagation speed, in millis

setSpeed

public void setSpeed(int speed)
This method exists on the off chance that someone wants to set the speed of the spell without knowing (or caring) that it's a BallSpell. Most spells don't have distinct phases, so Spell.class has a setSpeed() method that we must override.

Overrides:
setSpeed in class Spell
Parameters:
speed - the new propagation speed, in millis. Depending on the state of the spell, the bullet speed, expansion speed or contraction speed will be set.

getExplosionPredicate

public Predicate getExplosionPredicate()
Gets the Predicate to use for determining when the spell should explode.

Returns:
a wyvern.lib.Predicate object

getPropagationPredicate

public Predicate getPropagationPredicate()
Gets the Predicate to use for determining when the spell should explode.

Returns:
a wyvern.lib.Predicate object

getTempSpellName

protected java.lang.String getTempSpellName()
Returns the name of a property to set, to keep track of the active spells of this type. Defaults to the short name plus "-spell".


getMaxCasts

public int getMaxCasts(Commandable agent)
Returns max number of concurrent instances of this spell the passed agent is allowed to have at once.


explode

public void explode(Point center)
Explodes the ball at the given point. Call no more than once.

Parameters:
center - the place where the ball exploded (set by AI)

coolDown

public void coolDown()
Start contracting the ball.


damageMonster

public void damageMonster(Damageable obj,
                          Spell spell)
Damages the monster, but only if we haven't

Overrides:
damageMonster in class Spell
Parameters:
obj - the monster to damage
spell - the spell doing the damage (in case this needs to be used as a utility by another spell). If the spell has the property "show-defender-msg", the DamageEvent generated will show normal damage-messages (depending on the damage type) to the monster; otherwise it will be silent.

damageMonsters

public void damageMonsters()
Damages all monsters in areas we occupy.

Overrides:
damageMonsters in class Spell

clearDamageCache

public void clearDamageCache()
Resets the cache of monsters we've damaged this turn.


timerExpired

public void timerExpired()
Propagates the ball spell.

Specified by:
timerExpired in interface Timed

moveBall

public void moveBall()
Moves the undetonated ball in its current direction.


expandBall

public void expandBall()
Expands the ball out from the center.

Here's how it's done: we keep a hash-set of all points that we currently occupy. Also keep the subset of the points that were added on the last turn. Update it each turn. For each point in the last-turn subset, find each of the 8 neighboring squares. If we occupy it, continue. If it's blocked, continue. Otherwise put a reference there and add it to the set of points for the current turn. At the end of the turn, add the turn's set to the list for backtracking.

This is basically a floodfill algorithm, where we compute the next step in the fill on each turn. We probably want to re-check the neighbors for ALL locations we occupy, just in case something that was blocking has moved since the last turn. In fact, we should check every square we currently occupy in case a blocking object has moved onto us, so we can squelch it.

To shrink the ball, we need to know how many "steps" from the center each new location is. That means we need to save each turn's set of new points, so we can backtrack.


expandToCell

public void expandToCell(Point cell,
                         GameMap map,
                         java.util.Set points,
                         java.util.LinkedList turn,
                         Predicate stop,
                         Rectangle bounds)
Attempts to expand the fireball into the specified cell.

Parameters:
cell - the map location to expand into
map - the map the spell is expanding in
points - the list of points occupied by the cell
turn - the list of points added during this expansion turn
stop - the predicate to use for deciding whether to expand into the cell. If the predicate returns TRUE, don't expand into the cell.
bounds - the map bounds

contractBall

public void contractBall()
Contracts the ball in towards the center.