|
@ -35,8 +35,8 @@ public class GameManager { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void ProcessInput(char inputChar) { |
|
|
public void ProcessInput(char inputChar) { |
|
|
if(inputChar == 27) { |
|
|
|
|
|
//todo: escape key pauses game |
|
|
|
|
|
|
|
|
if(inputChar == 27) {// 27 = ESC |
|
|
|
|
|
TogglePause(); |
|
|
} |
|
|
} |
|
|
else if (inputChar == 'w' || inputChar == 's' || inputChar == 'd' || inputChar == 'a') { |
|
|
else if (inputChar == 'w' || inputChar == 's' || inputChar == 'd' || inputChar == 'a') { |
|
|
player.processInput(inputChar); |
|
|
player.processInput(inputChar); |
|
@ -68,5 +68,12 @@ public class GameManager { |
|
|
public void Unpause() { |
|
|
public void Unpause() { |
|
|
isPaused = false; |
|
|
isPaused = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void TogglePause() { |
|
|
|
|
|
if(isPaused) { |
|
|
|
|
|
Unpause(); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
Pause(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |