Added basic user list, Boing and Kirbeep buzzers as well as some refactoring and ui adjustments

This commit is contained in:
Samuel Kent
2022-12-27 09:30:49 +11:00
parent ced7fa5092
commit 252fa97606
15 changed files with 143 additions and 105 deletions
+30
View File
@@ -0,0 +1,30 @@
function setupBuzzerOptions() {
let buzzerOptions = ["Kirbeep","MPYosh","MPDog","MPCat","Wow","Ooh","MarioBoing","TheNumberEight"];
buzzerOptions.forEach((buzzerName) => {
$("#buzzerOptions").append("<img id='"+buzzerName+"' src='"+buzzerName+".png'>");
});
return buzzerOptions;
}
function userListsToClient(playerList, chaserList) {
$("#playerList").html("");
$("#chaserList").html("");
playerList.forEach((playerName) => {
$("#playerList").append("<li>"+playerName+"</li>");
});
chaserList.forEach((chaserName) => {
$("#chaserList").append("<li>"+chaserName+"</li>");
});
}
function gameStateToClient(currentTeam, currentScore) {
$("#currentTeam").html(currentTeam);
$("#currentScore").html(currentScore);
}
function buzzListToClient(buzzList, buzzerSound) {
//play sound for first buzz in
if ($("#buzzList").html() == "") {
buzzerSound.play();
}
$("#buzzList").html(buzzList.join());
}