|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdata.GameEntity
data.Bonus
public class Bonus
| 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 |
|---|
private int type
private java.util.Random rand
private boolean used
| Constructor Detail |
|---|
public Bonus(GameEngine ge,
java.lang.String file,
int x,
int y,
ScreenManager sm)
ge - file - x - y - sm - | Method Detail |
|---|
public void collidedWith(GameEntity entity)
Player, it will
cast the entity to Player and will alter the qualifications
of player.
collidedWith in class GameEntitypublic void move(long delta)
GameEntity
move in class GameEntitydelta - is the amount of time that entity will move.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||