data
Class Bonus

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

public class Bonus
extends GameEntity

Author:
Tansel

Field Summary
private  java.util.Random rand
          To generate a randomized bonus.
private  int type
          PangPang game has five different bonuses This integer variable is to determine which kind of bonus will it be. 0: Extra Life 1: Shield 2: Freeze Balloons 3: Duplicate Sting 4: Chain upgrade for Sting
private  boolean used
          If the bonus is already taken, no more collision will occur.
 
Fields inherited from class data.GameEntity
dx, dy, ge, sm, sprite, x, y
 
Constructor Summary
Bonus(GameEngine ge, java.lang.String file, int x, int y, ScreenManager sm)
           
 
Method Summary
 void collidedWith(GameEntity entity)
          When a bonus is taken (collided) by a Player, it will cast the entity to Player and will alter the qualifications of player.
 void move(long delta)
          Overriden method move of GameEntity
 
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

type

private int type
PangPang game has five different bonuses This integer variable is to determine which kind of bonus will it be. 0: Extra Life 1: Shield 2: Freeze Balloons 3: Duplicate Sting 4: Chain upgrade for Sting


rand

private java.util.Random rand
To generate a randomized bonus.


used

private boolean used
If the bonus is already taken, no more collision will occur.

Constructor Detail

Bonus

public Bonus(GameEngine ge,
             java.lang.String file,
             int x,
             int y,
             ScreenManager sm)
Parameters:
ge -
file -
x -
y -
sm -
Method Detail

collidedWith

public void collidedWith(GameEntity entity)
When a bonus is taken (collided) by a Player, it will cast the entity to Player and will alter the qualifications of player.

Specified by:
collidedWith in class GameEntity

move

public void move(long delta)
Overriden method move of GameEntity

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