From a8dd65130126b3ee75984e0ebfc912b0124950b3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 13 Jul 2021 13:22:00 +0200 Subject: crusader: Reveal all blocks when the game is over. --- public/common/client.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'public') 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) { -- cgit v1.2.3