|
@ -9,12 +9,14 @@ public class GameManager { |
|
|
public int score = 0; |
|
|
public int score = 0; |
|
|
public boolean ghostIsEdible = false; |
|
|
public boolean ghostIsEdible = false; |
|
|
public int timeStopPillEffect; |
|
|
public int timeStopPillEffect; |
|
|
|
|
|
public int moveSpeed = 5; |
|
|
|
|
|
|
|
|
public GameManager() { |
|
|
public GameManager() { |
|
|
setupGame(); |
|
|
setupGame(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void setupGame(){ |
|
|
public void setupGame(){ |
|
|
|
|
|
time = 0; |
|
|
map = new Map(Map.mapClassic,this); |
|
|
map = new Map(Map.mapClassic,this); |
|
|
visualizer = new VisualizerPlainText(this); |
|
|
visualizer = new VisualizerPlainText(this); |
|
|
player = new Player(this); |
|
|
player = new Player(this); |
|
@ -27,7 +29,7 @@ public class GameManager { |
|
|
|
|
|
|
|
|
public void Update() { |
|
|
public void Update() { |
|
|
visualizer.Update(); |
|
|
visualizer.Update(); |
|
|
if(time%5 == 0) { |
|
|
|
|
|
|
|
|
if(time%moveSpeed == 0) { |
|
|
player.Move(); |
|
|
player.Move(); |
|
|
} |
|
|
} |
|
|
if(time == 300) { |
|
|
if(time == 300) { |
|
@ -61,7 +63,7 @@ public class GameManager { |
|
|
if(inputChar == 27) { |
|
|
if(inputChar == 27) { |
|
|
//todo: escape key pauses game |
|
|
//todo: escape key pauses game |
|
|
} |
|
|
} |
|
|
else if (inputChar == 'w' || inputChar == 's' || inputChar == 'd' || inputChar == 'a') { |
|
|
|
|
|
|
|
|
else if (inputChar == 'w' || inputChar == 's' || inputChar == 'd' || inputChar == 'a' || inputChar == 'r') { |
|
|
player.processInput(inputChar); |
|
|
player.processInput(inputChar); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|