From: Christian Heller Date: Sun, 25 Oct 2020 00:34:32 +0000 (+0200) Subject: Only draw new game content on tick completion. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/day?a=commitdiff_plain;h=8f4f45798471d5b0069d7ac2caaf7d6a389ce981;p=plomrogue2-experiments Only draw new game content on tick completion. --- diff --git a/new2/plomrogue/game.py b/new2/plomrogue/game.py index e0c0715..c8c2f3c 100755 --- a/new2/plomrogue/game.py +++ b/new2/plomrogue/game.py @@ -55,6 +55,7 @@ class Game(GameBase): self.io.send('TURN ' + str(self.turn)) for t in self.things: send_thing(t) + self.io.send('GAME_STATE_COMPLETE') def run_tick(self): to_delete = [] diff --git a/new2/rogue_chat.html b/new2/rogue_chat.html index dde77be..cefc451 100644 --- a/new2/rogue_chat.html +++ b/new2/rogue_chat.html @@ -176,10 +176,11 @@ websocket.onmessage = function (event) { if (tokens[0] === 'TURN') { game.things = {} game.tick = parseInt(tokens[1]); - tui.draw_tick_line(); - tui.draw_map(); } else if (tokens[0] === 'THING_POS') { game.things[tokens[1]] = parser.parse_position(tokens[2]); + } else if (tokens[0] === 'GAME_STATE_COMPLETE') { + tui.draw_tick_line(); + tui.draw_map(); tui.draw_map(); } else if (tokens[0] === 'LOG') { tui.log_msg(' ' + tokens[1]);