Skip to content

Commit dfd0d59

Browse files
committed
Fixed mute text
1 parent 68bb8a8 commit dfd0d59

2 files changed

Lines changed: 7 additions & 27 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191

9292
function toggleMute() {
9393
game.mute();
94-
document.getElementById("muteLink").innerText = game.sounds.mute ? "unmute" : "mute";
94+
document.getElementById("muteLink").innerText = game.sounds.mute ? "Unmute" : "Mute";
9595
}
9696
</script>
9797
<script type="text/javascript">

js/spaceinvaders.js

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -344,37 +344,17 @@ PlayState.prototype.update = function(game, dt) {
344344
// event for smooth movement, otherwise the ship would move
345345
// more like a text editor caret.
346346

347-
// Left Arrow Key
348-
if(game.pressedKeys[37]) {
347+
// Left Movement Keys : A Key / Left Arrow Key
348+
if(game.pressedKeys[65] || game.pressedKeys[37]) {
349349
this.ship.x -= this.shipSpeed * dt;
350350
}
351351

352-
// Right Arrow Key
353-
if(game.pressedKeys[39]) {
352+
// Right Movement Keys: D Key / Right Arrow Key
353+
if(game.pressedKeys[68] || game.pressedKeys[39]){
354354
this.ship.x += this.shipSpeed * dt;
355355
}
356-
// Space Key
357-
if(game.pressedKeys[32]) {
358-
this.fireRocket();
359-
}
360-
361-
// A Key
362-
if(game.pressedKeys[65]) {
363-
this.ship.x -= this.shipSpeed * dt;
364-
}
365-
366-
// D Key
367-
if(game.pressedKeys[68]) {
368-
this.ship.x += this.shipSpeed * dt;
369-
}
370-
371-
// W Key
372-
if(game.pressedKeys[87]) {
373-
this.fireRocket();
374-
}
375-
376-
// Up Key
377-
if(game.pressedKeys[38]) {
356+
// Fire Keys : Space Key / W Key / Up Key
357+
if(game.pressedKeys[32] || game.pressedKeys[87] || game.pressedKeys[38]) {
378358
this.fireRocket();
379359
}
380360

0 commit comments

Comments
 (0)