Add crashing

This commit is contained in:
asraelite 2018-03-07 14:51:18 +00:00
parent bd97945e66
commit 60f77c36a9
9 changed files with 67 additions and 10 deletions

View file

@ -32,7 +32,7 @@ function notify(message, time = 80) {
export function tick() {
if (notification === null) return;
if (notLife-- <= 0)
if (notLife-- <= 0 || game.state.gameOver)
notification.text = '';
}
@ -70,6 +70,12 @@ export function launchShip() {
game.state.landed = false;
}
export function crash() {
audio.play('crash');
particle.createCrash(world.playerShip)
game.state.gameOver = true;
}
export function toggleEdit() {
if (game.state.editing) {
endEditing();
@ -122,6 +128,7 @@ export function tilePlacement() {
export function tossItem() {
particle.createItemToss(world.playerShip);
audio.play('toss');
}
export function collectItem(type, id, name) {