mort 8 роки тому
джерело
коміт
ed54f63abb
3 змінених файлів з 12 додано та 5 видалено
  1. 1
    1
      es/game.js
  2. 6
    1
      es/script.js
  3. 5
    3
      index.html

+ 1
- 1
es/game.js Переглянути файл

@@ -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 Переглянути файл

@@ -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 Переглянути файл

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

Завантаження…
Відмінити
Зберегти