summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-07-13 13:22:00 +0200
committerTor Andersson <tor@ccxvii.net>2021-07-13 13:22:00 +0200
commita8dd65130126b3ee75984e0ebfc912b0124950b3 (patch)
treebea4402e32177c31ce3e2be00a69e4ffae6691d2
parent00bc6cae6aa956d108b4a9ef956c4781a46253ba (diff)
downloadserver-a8dd65130126b3ee75984e0ebfc912b0124950b3.tar.gz
crusader: Reveal all blocks when the game is over.
-rw-r--r--public/common/client.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/public/common/client.js b/public/common/client.js
index 6ab86b3..1416e10 100644
--- a/public/common/client.js
+++ b/public/common/client.js
@@ -3,6 +3,7 @@
/* global io, on_update */
let game = null;
+let game_over = false;
let player = null;
let socket = null;
@@ -240,13 +241,14 @@ function init_client(roles) {
}
});
- socket.on('state', (state, game_over) => {
+ socket.on('state', (new_game, new_game_over) => {
console.log("STATE");
- game = state;
+ game = new_game;
+ game_over = new_game_over;
on_update_log();
on_update_bar();
on_update();
- on_game_over(game_over);
+ on_game_over();
});
socket.on('save', (msg) => {
@@ -465,7 +467,7 @@ function send_restart(scenario) {
socket.emit('restart', scenario);
}
-function on_game_over(game_over) {
+function on_game_over() {
if (player) {
let exit_button = document.querySelector("#exit_button");
if (exit_button) {