|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdata.GameEntity
data.Balloon
public class Balloon
| Field Summary | |
|---|---|
private int |
size
Since we have different sizes of balloons, this additional parameter will let us differentiate the balloons from each other. |
| Fields inherited from class data.GameEntity |
|---|
dx, dy, ge, sm, sprite, x, y |
| Constructor Summary | |
|---|---|
Balloon(GameEngine ge,
java.lang.String file,
int x,
int y,
ScreenManager sm,
int size)
Look for GameEntity |
|
Balloon(GameEngine ge,
java.lang.String file,
int x,
int y,
ScreenManager sm,
int size,
boolean reversedWay)
Look for GameEntity |
|
| Method Summary | |
|---|---|
private java.awt.Rectangle |
bottom()
Same as top method. |
void |
collidedWith(GameEntity entity)
This collision method does the necessary processes when collision between an Obstacle and Balloon occurs. |
int |
getSize()
|
int |
getX()
|
int |
getY()
|
void |
move(long delta)
This is the overridden method of actual move method. |
private java.awt.Rectangle |
top()
This new Rectangle is for checking exact collision between obstacle entity and balloon. |
| Methods inherited from class data.GameEntity |
|---|
collidesWith, draw |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int size
| Constructor Detail |
|---|
public Balloon(GameEngine ge,
java.lang.String file,
int x,
int y,
ScreenManager sm,
int size)
GameEntity
ge - file - x - y - sm - size -
public Balloon(GameEngine ge,
java.lang.String file,
int x,
int y,
ScreenManager sm,
int size,
boolean reversedWay)
GameEntity
ge - file - x - y - sm - size - reversedWay - If the balloon should move other direction when created.| Method Detail |
|---|
public void move(long delta)
move in class GameEntitydelta - is the amount of time that entity will move.public void collidedWith(GameEntity entity)
Obstacle and Balloon occurs.
Specifically, a balloon will bounce back.
collidedWith in class GameEntitypublic int getX()
getX in class GameEntitypublic int getY()
getY in class GameEntitypublic int getSize()
private java.awt.Rectangle top()
Rectangle is for checking exact collision between obstacle entity and balloon.
private java.awt.Rectangle bottom()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||