com.brackeen.javagamebook.path
Class PathBot

java.lang.Object
  extended bycom.brackeen.javagamebook.game.GameObject
      extended bycom.brackeen.javagamebook.path.PathBot
Direct Known Subclasses:
AIBot

public class PathBot
extends GameObject

A PathBot is a GameObject that follows a path from a PathFinder.


Field Summary
 
Fields inherited from class com.brackeen.javagamebook.game.GameObject
STATE_ACTIVE, STATE_DESTROYED, STATE_IDLE
 
Constructor Summary
PathBot(PolygonGroup polygonGroup)
           
 
Method Summary
 float getFlyHeight()
           
 boolean isFlying()
          Checks if this GameObject is currently flying.
 void notifyEndOfPath()
           
 void notifyObjectCollision(GameObject object)
           
 void notifyWallCollision()
           
 void setFacing(Vector3D facing)
          Sets the location this object should face as it follows the path.
 void setFlyHeight(float flyHeight)
           
 void setPathFinder(PathFinder pathFinder)
          Sets the PathFinder class to use to follow the path.
 void setPathRecalcTime(long pathRecalcTime)
           
 void setSpeed(float speed)
           
 void setTurnSpeed(float turnSpeed)
           
 void update(GameObject player, long elapsedTime)
          If this GameObject is in the active state, this method updates it's PolygonGroup.
 
Methods inherited from class com.brackeen.javagamebook.game.GameObject
addListener, getBounds, getCeilHeight, getFloorHeight, getListener, getLocation, getName, getPolygonGroup, getSpawns, getTransform, getX, getY, getZ, isActive, isDestroyed, isIdle, isJumping, isMakingNoise, makeNoise, removeListener, sendTouchNotifications, setCeilHeight, setFloorHeight, setFlying, setJumping, setState
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathBot

public PathBot(PolygonGroup polygonGroup)
Method Detail

setFacing

public void setFacing(Vector3D facing)
Sets the location this object should face as it follows the path. This value can change. If null, the this object faces the direction it is moving.


setPathFinder

public void setPathFinder(PathFinder pathFinder)
Sets the PathFinder class to use to follow the path.


setPathRecalcTime

public void setPathRecalcTime(long pathRecalcTime)

setSpeed

public void setSpeed(float speed)

setTurnSpeed

public void setTurnSpeed(float turnSpeed)

setFlyHeight

public void setFlyHeight(float flyHeight)

getFlyHeight

public float getFlyHeight()

update

public void update(GameObject player,
                   long elapsedTime)
Description copied from class: GameObject
If this GameObject is in the active state, this method updates it's PolygonGroup. Otherwise, this method does nothing.

Overrides:
update in class GameObject

isFlying

public boolean isFlying()
Description copied from class: GameObject
Checks if this GameObject is currently flying. Flying objects should not has gravity applied to them.

Overrides:
isFlying in class GameObject

notifyEndOfPath

public void notifyEndOfPath()

notifyWallCollision

public void notifyWallCollision()

notifyObjectCollision

public void notifyObjectCollision(GameObject object)