com.brackeen.javagamebook.ai
Class Projectile

java.lang.Object
  extended bycom.brackeen.javagamebook.game.GameObject
      extended bycom.brackeen.javagamebook.ai.Projectile

public class Projectile
extends GameObject

The Blast GameObject is a projectile, designed to travel in a straight line for five seconds, then die. Blasts destroy Bots instantly.


Field Summary
 
Fields inherited from class com.brackeen.javagamebook.game.GameObject
STATE_ACTIVE, STATE_DESTROYED, STATE_IDLE
 
Constructor Summary
Projectile(PolygonGroup polygonGroup, Vector3D direction, AIBot sourceBot, int minDamage, int maxDamage)
          Create a new Blast with the specified PolygonGroup and normalized vector direction.
 
Method Summary
 boolean isFlying()
          Checks if this GameObject is currently flying.
 void notifyCeilingCollision()
           
 void notifyFloorCollision()
           
 void notifyObjectCollision(GameObject object)
           
 void notifyWallCollision()
           
 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

Projectile

public Projectile(PolygonGroup polygonGroup,
                  Vector3D direction,
                  AIBot sourceBot,
                  int minDamage,
                  int maxDamage)
Create a new Blast with the specified PolygonGroup and normalized vector direction.

Method Detail

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

notifyObjectCollision

public void notifyObjectCollision(GameObject object)

notifyWallCollision

public void notifyWallCollision()

notifyFloorCollision

public void notifyFloorCollision()

notifyCeilingCollision

public void notifyCeilingCollision()