Parcourir la source

improved interface

master
mort il y a 8 ans
Parent
révision
33840a95c6
2 fichiers modifiés avec 16 ajouts et 1 suppressions
  1. 15
    1
      es/script.js
  2. 1
    0
      index.html

+ 15
- 1
es/script.js Voir le fichier

@@ -17,4 +17,18 @@ function startGame() {
}

document.querySelector("#startGameBtn").addEventListener("click", startGame);
document.querySelector("#restartGameBtn").addEventListener("click", startGame);
document.querySelector("#restartGameBtn").addEventListener("click", () => {
location.hash = "game";
location.reload();
});
document.querySelector("#storyBtn").addEventListener("click", () => {
location.hash = "";
location.reload();
});

window.addEventListener("load", () => {
if (location.hash.substring(1) === "game") {
startGame();
console.log("starting");
}
});

+ 1
- 0
index.html Voir le fichier

@@ -77,6 +77,7 @@

<div class="view game-over">
<h1>Game over.</h1>
<button id="storyBtn">Back</button>
<button id="restartGameBtn">Restart</button>
</div>


Chargement…
Annuler
Enregistrer