Skip to content

Commit

Permalink
Merge pull request ChromeGaming#675 from hars-21/scoreboard
Browse files Browse the repository at this point in the history
Scoreboard and Timer fixed
  • Loading branch information
ayush-t02 authored Aug 3, 2024
2 parents 2df9e4c + bf6e5cd commit 0016cf4
Show file tree
Hide file tree
Showing 2 changed files with 701 additions and 7 deletions.
6 changes: 5 additions & 1 deletion js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ class Game {
// Create timer UI
createTimerUI() {
const timerContainer = document.createElement("div");
const misc = document.querySelector(".button-container");
timerContainer.id = "timer-container";
timerContainer.innerHTML = `
<div id="timer">30</div>
<div id="timer-label">seconds left</div>
`;
document.body.appendChild(timerContainer);
misc.appendChild(timerContainer);
this.timerDisplay = document.getElementById("timer");
}

Expand Down Expand Up @@ -149,6 +150,9 @@ class Game {

// Add players to UI
addPlayersUI() {
const scoreboardContainer = document.querySelector(".scoreboard-container");
scoreboardContainer.style.visibility = "visible";

const scoreboard = document.querySelector(".scoreboard");
scoreboard.innerHTML = ""; // Clear existing content

Expand Down
Loading

0 comments on commit 0016cf4

Please sign in to comment.