| Modifier and Type | Field and Description |
|---|---|
| private Game | game
The game in which this entity exists |
| private float | moveSpeed
The vertical speed at which the players shot moves |
| private static final int | TOP_BORDER
Top border at which shots are outside |
| private boolean | used
True if this shot has been "used", i.e. its hit something |
| Access | Constructor and Description |
|---|---|
| public | ShotEntity(Game
The game in which the shot has been created game, String The sprite representing this shot sprite, int The initial x location of the shot x, int The initial y location of the shot y)Create a new shot from the player |
| Modifier and Type | Method and Description |
|---|---|
| public void | collidedWith(Entity
The other entity with which we've collided other)Implements abstract org. |
| public void | move(long
The time that has elapsed since last move delta)Overrides org. |
| public void |
| game | back to summary |
|---|---|
| private Game game The game in which this entity exists | |
| moveSpeed | back to summary |
|---|---|
| private float moveSpeed The vertical speed at which the players shot moves | |
| TOP_BORDER | back to summary |
|---|---|
| private static final int TOP_BORDER Top border at which shots are outside | |
| used | back to summary |
|---|---|
| private boolean used True if this shot has been "used", i.e. its hit something | |
| ShotEntity | back to summary |
|---|---|
| public ShotEntity(Game game, String sprite, int x, int y) Create a new shot from the player | |
| collidedWith | back to summary |
|---|---|
| public void collidedWith(Entity other) Implements abstract org. Notification that this shot has collided with another entity
| |
| move | back to summary |
|---|---|
| public void move(long delta) Overrides org. Request that this shot moved based on time elapsed
| |
| reinitialize | back to summary |
|---|---|
| public void reinitialize(int x, int y) Reinitializes this entity, for reuse
| |