Added mystery buzzer
This commit is contained in:
+12
-3
@@ -1,5 +1,6 @@
|
|||||||
|
let buzzerOptions = ["Kirbeep","MPYosh","MPDog","MPCat","Wow","Ooh","MarioBoing","TheNumberEight","Mystery"];
|
||||||
function setupBuzzerOptions() {
|
function setupBuzzerOptions() {
|
||||||
let buzzerOptions = ["Kirbeep","MPYosh","MPDog","MPCat","Wow","Ooh","MarioBoing","TheNumberEight"];
|
|
||||||
buzzerOptions.forEach((buzzerName) => {
|
buzzerOptions.forEach((buzzerName) => {
|
||||||
$("#buzzerOptions").append("<img id='"+buzzerName+"' src='"+buzzerName+".png'>");
|
$("#buzzerOptions").append("<img id='"+buzzerName+"' src='"+buzzerName+".png'>");
|
||||||
});
|
});
|
||||||
@@ -9,8 +10,6 @@ function setupBuzzerOptions() {
|
|||||||
function userInfoToClient(userInfo) {
|
function userInfoToClient(userInfo) {
|
||||||
$("#PlayersList").find("ul").html("");
|
$("#PlayersList").find("ul").html("");
|
||||||
$("#ChasersList").find("ul").html("");
|
$("#ChasersList").find("ul").html("");
|
||||||
console.log(userInfo);
|
|
||||||
|
|
||||||
for (const user in userInfo) {
|
for (const user in userInfo) {
|
||||||
const userId = user.replaceAll(" ","_");
|
const userId = user.replaceAll(" ","_");
|
||||||
$("#"+userInfo[user].teamName+"List").find("ul").append("<li id="+userId+">"+user+"<var></var></li>");
|
$("#"+userInfo[user].teamName+"List").find("ul").append("<li id="+userId+">"+user+"<var></var></li>");
|
||||||
@@ -41,3 +40,13 @@ function buzzInfoToClient(buzzInfo, buzzerSound) {
|
|||||||
$("#userListPanel").find("#"+userId).find("var").html(" ("+buzzInfo[i].lateTime/1000+")");
|
$("#userListPanel").find("#"+userId).find("var").html(" ("+buzzInfo[i].lateTime/1000+")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function selectBuzzer(buzzerId) {
|
||||||
|
if (buzzerId == "Mystery") {
|
||||||
|
buzzerId = buzzerOptions[Math.floor(Math.random()*8)];
|
||||||
|
}
|
||||||
|
buzzerSound = new Audio(buzzerId+".wav");
|
||||||
|
$("#buzzer").attr("src", buzzerId+".png" );
|
||||||
|
buzzerSound.play();
|
||||||
|
return buzzerSound;
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
+1
-2
@@ -44,8 +44,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#buzzerOptions").contents().mousedown(function() {
|
$("#buzzerOptions").contents().mousedown(function() {
|
||||||
buzzerSound = new Audio($(this).attr("id")+".wav");
|
buzzerSound = selectBuzzer($(this).attr("id"));
|
||||||
buzzerSound.play();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+1
-4
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
let buzzerOptions = setupBuzzerOptions();
|
let buzzerOptions = setupBuzzerOptions();
|
||||||
let buzzerSound = new Audio(buzzerOptions[0]+".wav");
|
let buzzerSound = new Audio(buzzerOptions[0]+".wav");
|
||||||
console.log(buzzerSound);
|
|
||||||
$("#buzzer").attr("src", buzzerOptions[0]+".png" );
|
$("#buzzer").attr("src", buzzerOptions[0]+".png" );
|
||||||
$("#buzzer").css("opacity", "0.2");
|
$("#buzzer").css("opacity", "0.2");
|
||||||
let buzzable = false;
|
let buzzable = false;
|
||||||
@@ -77,9 +76,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$("#buzzerOptions").contents().mousedown(function() {
|
$("#buzzerOptions").contents().mousedown(function() {
|
||||||
buzzerSound = new Audio($(this).attr("id")+".wav");
|
buzzerSound = selectBuzzer($(this).attr("id"));
|
||||||
$("#buzzer").attr("src", $(this).attr("id")+".png" );
|
|
||||||
buzzerSound.play();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user