|
|
@ -31,10 +31,10 @@ public class GameManager { |
|
|
|
player.Move(); |
|
|
|
} |
|
|
|
if(time == 300) { |
|
|
|
spawnCherry(); |
|
|
|
spawnFruit(); |
|
|
|
} |
|
|
|
if (time == 600) { |
|
|
|
destroyCherry(); |
|
|
|
destroyFruit(); |
|
|
|
} |
|
|
|
if(ghostIsEdible) { |
|
|
|
if(time == timeStopPillEffect) |
|
|
@ -43,14 +43,20 @@ public class GameManager { |
|
|
|
time++; |
|
|
|
} |
|
|
|
|
|
|
|
public void spawnCherry() { |
|
|
|
map.GetCell(map.playerSpawn).type = "cherry"; |
|
|
|
public void spawnFruit() { |
|
|
|
map.GetCell(map.playerSpawn).type = randomFruit(); |
|
|
|
} |
|
|
|
|
|
|
|
public void destroyCherry() { |
|
|
|
public void destroyFruit() { |
|
|
|
map.GetCell(map.playerSpawn).type = "empty"; |
|
|
|
} |
|
|
|
|
|
|
|
public String randomFruit() { |
|
|
|
String fruitTypes[] = {"cherry"}; |
|
|
|
int randomNumber = (int) (Math. random() * fruitTypes.length); |
|
|
|
return fruitTypes[randomNumber]; |
|
|
|
} |
|
|
|
|
|
|
|
public void ProcessInput(char inputChar) { |
|
|
|
if(inputChar == 27) { |
|
|
|
//todo: escape key pauses game |
|
|
|