diff --git a/app.js b/app.js
index bf2458b..cc0d23f 100644
--- a/app.js
+++ b/app.js
@@ -16,10 +16,10 @@ const io = new Server(server, {
const userMap = new Map();
let buzzInfo = [];
let userInfo = new Object();//Each user has properties, and is stored as a property of userInfo
-
+let anyObjections = false;
const teamsList = ["Players","Chasers"]
-const teamsScore = [0,0]
+const teamsScore = [0,0];
let currentTeamNumber = 0;
io.on("connection", (socket) => {
console.log("a user connected");
@@ -31,6 +31,10 @@ io.on("connection", (socket) => {
//initial info on connection
socket.emit("gameStateToClient", teamsList[currentTeamNumber], teamsScore[currentTeamNumber]);
+ if (anyObjections == true) {
+ socket.emit("objectionToClient", "????");
+ }
+
socket.on("pingServer", (timeStamp) => {
socket.emit("pingClient", timeStamp);
});
@@ -84,10 +88,22 @@ io.on("connection", (socket) => {
});
socket.on("unregisterUsers", () => {
+ // console.log("whaat?");
userInfo = new Object();
io.emit("userInfoToClient", userInfo);
});
+ socket.on("objectionToServer", (userName) => {
+ if (anyObjections == false) {
+ io.emit("objectionToClient", userName);
+ anyObjections = true;
+ }
+ });
+
+ socket.on("clearObjectionToServer", () => {
+ anyObjections = false;
+ io.emit("clearObjectionToClient");
+ });
});
// const io = new Server(server);
diff --git a/audio/AAObjection.wav b/audio/AAObjection.wav
new file mode 100644
index 0000000..6b3ed3a
Binary files /dev/null and b/audio/AAObjection.wav differ
diff --git a/audio/FF9Moogle.wav b/audio/FF9Moogle.wav
new file mode 100644
index 0000000..d01f055
Binary files /dev/null and b/audio/FF9Moogle.wav differ
diff --git a/audio/MGSAlert.wav b/audio/MGSAlert.wav
new file mode 100644
index 0000000..e6e4bd3
Binary files /dev/null and b/audio/MGSAlert.wav differ
diff --git a/audio/MarioCoin.wav b/audio/MarioCoin.wav
new file mode 100644
index 0000000..fef4191
Binary files /dev/null and b/audio/MarioCoin.wav differ
diff --git a/audio/PikminThrow.wav b/audio/PikminThrow.wav
new file mode 100644
index 0000000..229d884
Binary files /dev/null and b/audio/PikminThrow.wav differ
diff --git a/browserFunctions.js b/browserFunctions.js
index 98e7536..bc861d4 100644
--- a/browserFunctions.js
+++ b/browserFunctions.js
@@ -43,4 +43,14 @@ function selectBuzzer(buzzerId) {
$("#buzzer").attr("src", buzzerId+".png" );
buzzerSound.play();
return buzzerSound;
+}
+
+let objectionSound = new Audio("AAObjection.wav");
+function objectionToClient(userName) {
+ objectionSound.play();
+ $("#objection").html("+")
"+userName+" is objecting!
");
+}
+
+function clearObjectionToClient() {
+ $("#objection").html("");
}
\ No newline at end of file
diff --git a/images/AAEvidence.gif b/images/AAEvidence.gif
new file mode 100644
index 0000000..8aac87a
Binary files /dev/null and b/images/AAEvidence.gif differ
diff --git a/images/AAEvidence.png b/images/AAEvidence.png
new file mode 100644
index 0000000..285491f
Binary files /dev/null and b/images/AAEvidence.png differ
diff --git a/images/AAObjection.gif b/images/AAObjection.gif
new file mode 100644
index 0000000..3c0a938
Binary files /dev/null and b/images/AAObjection.gif differ
diff --git a/images/AAObjection.png b/images/AAObjection.png
new file mode 100644
index 0000000..1d954af
Binary files /dev/null and b/images/AAObjection.png differ
diff --git a/images/EmergencyMeeting.psd b/images/EmergencyMeeting.psd
deleted file mode 100644
index 2c1e76d..0000000
Binary files a/images/EmergencyMeeting.psd and /dev/null differ
diff --git a/images/TurnVisual.psd b/images/TurnVisual.psd
deleted file mode 100644
index aef4d7f..0000000
Binary files a/images/TurnVisual.psd and /dev/null differ
diff --git a/images/buzzers/FF9Moogle.png b/images/buzzers/FF9Moogle.png
new file mode 100644
index 0000000..5e63e2f
Binary files /dev/null and b/images/buzzers/FF9Moogle.png differ
diff --git a/images/buzzers/MGSAlert.png b/images/buzzers/MGSAlert.png
new file mode 100644
index 0000000..88974dd
Binary files /dev/null and b/images/buzzers/MGSAlert.png differ
diff --git a/images/buzzers/MarioCoin.png b/images/buzzers/MarioCoin.png
new file mode 100644
index 0000000..2f3dd3a
Binary files /dev/null and b/images/buzzers/MarioCoin.png differ
diff --git a/images/buzzers/PikminThrow.png b/images/buzzers/PikminThrow.png
new file mode 100644
index 0000000..a80aee9
Binary files /dev/null and b/images/buzzers/PikminThrow.png differ
diff --git a/pages/host.html b/pages/host.html
index 6441fb7..1b7577f 100644
--- a/pages/host.html
+++ b/pages/host.html
@@ -38,7 +38,19 @@
});
$("#unregisterUsers").click(function() {
- socket.emit("unregisterUsers", 2);
+ socket.emit("unregisterUsers");
+ });
+
+ socket.on("objectionToClient", (userName) => {
+ objectionToClient(userName);
+ $("#objection").append("");
+ $("#clearObjection").click(function() {
+ socket.emit("clearObjectionToServer");
+ });
+ });
+
+ socket.on("clearObjectionToClient", () => {
+ clearObjectionToClient();
});
});
@@ -56,9 +68,15 @@
(all points buttons clear buzzers)
-+
+
");
});
@@ -86,6 +86,26 @@
$("#buzzer").attr("src", buzzerId+".png" );
buzzerSound.play();
});
+
+ $("#contestAnswer").find("img").mousedown(function() {
+ socket.emit("objectionToServer", userName);
+ });
+
+ $("#contestAnswer").find("img").hover(
+ function() {
+ $(this).attr("src", "AAEvidence.gif");
+ }, function() {
+ $(this).attr("src", "AAEvidence.png");
+ }
+ );
+
+ socket.on("objectionToClient", (userName) => {
+ objectionToClient(userName);
+ });
+
+ socket.on("clearObjectionToClient", () => {
+ clearObjectionToClient();
+ });
});
@@ -99,6 +119,8 @@
+
+ Click to contest an answer marked incorrectly.
+
+ (please use sparingly)
+
");
});
@@ -86,6 +86,26 @@
$("#buzzer").attr("src", buzzerId+".png" );
buzzerSound.play();
});
+
+ $("#contestAnswer").find("img").mousedown(function() {
+ socket.emit("objectionToServer", userName);
+ });
+
+ $("#contestAnswer").find("img").hover(
+ function() {
+ $(this).attr("src", "AAEvidence.gif");
+ }, function() {
+ $(this).attr("src", "AAEvidence.png");
+ }
+ );
+
+ socket.on("objectionToClient", (userName) => {
+ objectionToClient(userName);
+ });
+
+ socket.on("clearObjectionToClient", () => {
+ clearObjectionToClient();
+ });
});
@@ -99,6 +119,8 @@