data
Class Sting

java.lang.Object
  extended by data.GameEntity
      extended by data.Sting

public class Sting
extends GameEntity

Author:
Tansel

Field Summary
private  boolean chain
          This boolean holds the chain of Sting false -> Rope true -> Chain
private  long life
          This long will determine when the chain type of variable
private  Player player
          This variable holds the current player that shot this sting
private  java.util.Random rand
          To determine if a bonus will be created when a Balloon is shot.
private  boolean shot
          This boolean will prevent from double shooting with one Default Sting
private  long tick
          This long will hold the time and prevent double collision checking for Chaint type of stings, thus prevent from GameEngine to miscalculate the number of Balloons
 
Fields inherited from class data.GameEntity
dx, dy, ge, sm, sprite, x, y
 
Constructor Summary
Sting(GameEngine ge, java.lang.String file, int x, int y, ScreenManager sm, boolean type, Player player)
           
 
Method Summary
 void collidedWith(GameEntity entity)
          This function will check the collision with only balloons and obstacles since the only things it can shoot is them
 boolean isChain()
           
 void move(long delta)
          When a chain reaches an Obstacle or boundary of screen it will stop moving.
 void stop()
           
 void vanished()
          If a sting vanishes, player can now shoot another sting.
 
Methods inherited from class data.GameEntity
collidesWith, draw, getX, getY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chain

private boolean chain
This boolean holds the chain of Sting false -> Rope true -> Chain


shot

private boolean shot
This boolean will prevent from double shooting with one Default Sting


tick

private long tick
This long will hold the time and prevent double collision checking for Chaint type of stings, thus prevent from GameEngine to miscalculate the number of Balloons


life

private long life
This long will determine when the chain type of variable


player

private Player player
This variable holds the current player that shot this sting


rand

private java.util.Random rand
To determine if a bonus will be created when a Balloon is shot.

Constructor Detail

Sting

public Sting(GameEngine ge,
             java.lang.String file,
             int x,
             int y,
             ScreenManager sm,
             boolean type,
             Player player)
Parameters:
ge -
file -
x -
y -
sm -
chain -
player -
Method Detail

collidedWith

public void collidedWith(GameEntity entity)
This function will check the collision with only balloons and obstacles since the only things it can shoot is them

Specified by:
collidedWith in class GameEntity

move

public void move(long delta)
When a chain reaches an Obstacle or boundary of screen it will stop moving.

Overrides:
move in class GameEntity
Parameters:
delta - is the amount of time that entity will move.

vanished

public void vanished()
If a sting vanishes, player can now shoot another sting.


stop

public void stop()

isChain

public boolean isChain()