public class GhostHouse
extends java.lang.Object
| Constructor | Description |
|---|---|
GhostHouse(Location topLeft,
int width,
int blockSize) |
Constructor for a ghosthouse object
note that location must matched with the level map data that is created
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addGhost(Ghost ghost) |
Method to add a ghost to a ghost house object
Ghosts in ghost house will properly spawn and respawn
|
void |
addGhosts(java.util.List<Ghost> ghosts) |
returns the top left location of the ghost house
Method to add ghosts to a ghost house object
Ghosts in ghost house will properly spawn and respawn
|
java.util.Queue<Ghost> |
getGhosts() |
returns the ghosts list
|
Location |
getTopLeft() |
returns the top left location of the ghost house
|
int |
getWidth() |
returns the width of the ghost house
|
void |
resetTimer() |
Resets the timer on the ghost house
must wait a full time interval before the next ghost is released
|
void |
update() |
This method updates the timer on the ghost house so that ghosts
are released at proper intervals - call this in the logic updating loops
|
public GhostHouse(Location topLeft, int width, int blockSize)
topLeft - Location of the top left corner of the ghost housewidth - how many "blocks" the house encompasses (typically 1 block per ghost)blockSize - the size of each block as defined by the board class (must pass this in)public void addGhost(Ghost ghost)
ghost - the ghost desired to be put into the ghost housepublic void addGhosts(java.util.List<Ghost> ghosts)
ghosts - the ghosts desired to be put into the ghost housepublic Location getTopLeft()
public int getWidth()
public java.util.Queue<Ghost> getGhosts()
public void update()
public void resetTimer()