Browse Source

added destroyCherry function to GameManager

remotes/origin/player
fdai7910 11 months ago
parent
commit
e060b184fb
  1. 7
      src/main/java/pacmanGame/GameManager.java

7
src/main/java/pacmanGame/GameManager.java

@ -31,6 +31,9 @@ public class GameManager {
if(time == 300) { if(time == 300) {
spawnCherry(); spawnCherry();
} }
if (time == 600) {
destroyCherry();
}
time++; time++;
} }
@ -38,6 +41,10 @@ public class GameManager {
map.GetCell(map.playerSpawn).type = "cherry"; map.GetCell(map.playerSpawn).type = "cherry";
} }
public void destroyCherry() {
map.GetCell(map.playerSpawn).type = "empty";
}
public void ProcessInput(char inputChar) { public void ProcessInput(char inputChar) {
if(inputChar == 27) { if(inputChar == 27) {
//todo: escape key pauses game //todo: escape key pauses game

Loading…
Cancel
Save