Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Aug 10, 2024
1 parent ec465e5 commit e8c5539
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@
</div>
<button type="button"
class="btn btn-primary btn-lg"
onclick="game.exactry()"
id="exactry-button" disabled></button>
onclick="game.exactly()"
id="exactly-button" disabled></button>
<button type="button"
class="btn btn-primary btn-lg"
onclick="game.inexactry()"
id="inexactry-button" disabled>×</button>
onclick="game.inexactly()"
id="inexactly-button" disabled>×</button>
<audio src="se/hai.mp3" id="hai"></audio>
<audio src="se/pingpong2.mp3" id="pingpong2"></audio>
<audio src="se/buzzer.mp3" id="buzzer"></audio>
Expand Down
24 changes: 12 additions & 12 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Player {
this.name = `Player ${no}`;

if (!this.gamepad) {
this.updateThumnailColor("gray");
this.updateThumbnailColor("gray");
}

this.icon.onerror = function(e) {
Expand Down Expand Up @@ -43,7 +43,7 @@ class Player {
return this.thumbnail.getElementsByClassName("score")[0];
}

updateThumnailColor(color) {
updateThumbnailColor(color) {
if (color) {
this.thumbnail.style.cssText = `background-color: ${color}`;
} else {
Expand All @@ -58,7 +58,7 @@ class Player {

takeAnswerable() {
this.game.enableScoring(this);
this.updateThumnailColor("GreenYellow");
this.updateThumbnailColor("GreenYellow");
}

succScore() {
Expand Down Expand Up @@ -86,7 +86,7 @@ class Player {
} else if (player.buttonPressed && player.game.waiting && !player.penalty) {
player.takeAnswerable();
} else {
player.updateThumnailColor(null);
player.updateThumbnailColor(null);
}

if (player.game.waiting) {
Expand All @@ -104,9 +104,9 @@ class Player {
if (!player.gamepad || !player.dom) {
// Do nothing
} else if (player.buttonPressed) {
player.updateThumnailColor("Cyan");
player.updateThumbnailColor("Cyan");
} else {
player.updateThumnailColor(null);
player.updateThumbnailColor(null);
}

if (player.game.entering) {
Expand Down Expand Up @@ -145,26 +145,26 @@ class Game {
this.answering = player;
document.getElementById("hai").play();
this.setMessage(`<span>はい ${this.answering.name} さん早かった</span>`);
document.getElementById("exactry-button").disabled = false;
document.getElementById("inexactry-button").disabled = false;
document.getElementById("exactly-button").disabled = false;
document.getElementById("inexactly-button").disabled = false;
document.getElementById("start-button").disabled = true;
}

disableScoring() {
this.answering = null;
document.getElementById("exactry-button").disabled = true;
document.getElementById("inexactry-button").disabled = true;
document.getElementById("exactly-button").disabled = true;
document.getElementById("inexactly-button").disabled = true;
document.getElementById("start-button").disabled = false;
}

exactry() {
exactly() {
this.answering.succScore();
this.setMessage("<span>正解!!</span>");
this.disableScoring();
document.getElementById("pingpong2").play();
}

inexactry() {
inexactly() {
this.answering.rest();
this.setMessage("<span>残念!!</span>");
this.disableScoring();
Expand Down

0 comments on commit e8c5539

Please sign in to comment.