Add pause and precision controls

This commit is contained in:
asraelite 2018-03-07 16:10:56 +00:00
parent 2959c39da7
commit f91febfd3c
3 changed files with 22 additions and 11 deletions

View file

@ -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) {