Parcourir la source

improved things

master
mort il y a 8 ans
Parent
révision
ed54f63abb
3 fichiers modifiés avec 12 ajouts et 5 suppressions
  1. 1
    1
      es/game.js
  2. 6
    1
      es/script.js
  3. 5
    3
      index.html

+ 1
- 1
es/game.js Voir le fichier

@@ -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 Voir le fichier

@@ -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 Voir le fichier

@@ -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">

Chargement…
Annuler
Enregistrer