|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdata.GameEntity
data.Sting
public class Sting
| 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 |
|---|
private boolean chain
private boolean shot
private long tick
private long life
private Player player
private java.util.Random rand
Balloon is shot.
| Constructor Detail |
|---|
public Sting(GameEngine ge,
java.lang.String file,
int x,
int y,
ScreenManager sm,
boolean type,
Player player)
ge - file - x - y - sm - chain - player - | Method Detail |
|---|
public void collidedWith(GameEntity entity)
collidedWith in class GameEntitypublic void move(long delta)
Obstacle or boundary of screen it will stop moving.
move in class GameEntitydelta - is the amount of time that entity will move.public void vanished()
public void stop()
public boolean isChain()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||