Explorar el Código

improved things

master
mort hace 8 años
padre
commit
ed54f63abb
Se han modificado 3 ficheros con 12 adiciones y 5 borrados
  1. 1
    1
      es/game.js
  2. 6
    1
      es/script.js
  3. 5
    3
      index.html

+ 1
- 1
es/game.js Ver fichero

@@ -392,7 +392,7 @@ class Player extends Entity {
this.thrustAnim.loop = false;
this.game.playSound(PlayerSounds.despawn, this.pos);
if (this.thrustSound)
this.thrustSound.stop();
this.thrustSound.pause();
}
}


+ 6
- 1
es/script.js Ver fichero

@@ -20,10 +20,15 @@ function startGame(name) {
game.onloss = () => view("game-over");
}

document.querySelector("#startGameBtn").addEventListener("click", startGame);
document.querySelector("#startForm").addEventListener("submit", (evt) => {
evt.preventDefault();
startGame();
});

document.querySelector("#restartGameBtn").addEventListener("click", () => {
location.reload();
});

document.querySelector("#storyBtn").addEventListener("click", () => {
location.hash = "";
location.reload();

+ 5
- 3
index.html Ver fichero

@@ -68,9 +68,11 @@
<p>Umbreosylians are a fickle race. At the first sign of danger, of course, everyone you knew flew away to migrate to a safe place. Except you. You overslept, missed the ships, and are now abandoned.</p>

<p>You barely managed to enter your ship, lift off, and get to a somewhat safe distance from the planet, before The Deathers destroyed Umbreosyl. You're currently sitting in your space ship, blood boiling, watching the debris from your beloved home planet encounter you from behind, and ships from The Deathers from ahead.</p>
<input id="playerName" placeholder="Name"></input>
<button id="startGameBtn">Start</button>

<form id="startForm">
<input id="playerName" placeholder="Name"></input>
<button type="submit" id="startGameBtn">Start</button>
</form>
</div>

<div class="view game">

Cargando…
Cancelar
Guardar