Add pause and precision controls
This commit is contained in:
parent
2959c39da7
commit
f91febfd3c
3 changed files with 22 additions and 11 deletions
|
@ -32,7 +32,7 @@ function notify(message, time = 80) {
|
|||
|
||||
export function tick() {
|
||||
if (notification === null) return;
|
||||
if (notLife-- <= 0 || game.state.gameOver)
|
||||
if ((notLife-- <= 0 || game.state.gameOver) && !game.state.paused)
|
||||
notification.text = '';
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,12 @@ export function toMenu() {
|
|||
}
|
||||
|
||||
export function togglePause() {
|
||||
console.log(game.state.paused);
|
||||
game.state.paused = !game.state.paused;
|
||||
audio.play('pause');
|
||||
if (game.state.paused) {
|
||||
notify('Paused', 0);
|
||||
}
|
||||
}
|
||||
|
||||
export function landShip(planet) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue