瀏覽代碼

improved things

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

Loading…
取消
儲存