public class Grid
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
int |
fruitCounter |
|
int |
x |
|
int |
y |
| Constructor | Description |
|---|---|
Grid() |
Constructor for Board object
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
checkMaze() |
Checks if there are any pellets left for Pacman to eat, and restarts the game on the next board in a
higher difficulty if finished
|
void |
drawMaze(java.awt.Graphics2D g2d) |
Draws the maze that serves as a playing field.
|
int |
getPelletNum() |
Count the number of pellets left for Pacman to eat
|
int |
getPelletNumForMap(int numBoardsCleared) |
Count the number of pellets in each map
|
int |
getPillNum() |
Count the number of power pills left for Pacman to eat
|
void |
incrementFruit(int numBoardsCleared) |
Increment fruit as the pacman is alive
|
void |
levelInit(int numBoardsCleared) |
Initialize level with data containing game object information
|
GridData |
loadLevel(java.lang.String asset_path) |
|
void |
randomBlock() |
A method to set the x and y coordinates to a random number on the board
|
public GridData loadLevel(java.lang.String asset_path)
public boolean checkMaze()
public int getPelletNum()
public int getPillNum()
public int getPelletNumForMap(int numBoardsCleared)
numBoardsCleared - the number of levels that have been clearedpublic void levelInit(int numBoardsCleared)
numBoardsCleared - the number of levels that have been clearedpublic void randomBlock()
public void incrementFruit(int numBoardsCleared)
numBoardsCleared - number of levels clearedpublic void drawMaze(java.awt.Graphics2D g2d)
g2d - a Graphics2D object