home · contact · privacy
Only draw new game content on tick completion.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 25 Oct 2020 00:34:32 +0000 (02:34 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 25 Oct 2020 00:34:32 +0000 (02:34 +0200)
new2/plomrogue/game.py
new2/rogue_chat.html

index e0c07155b0333486d1b82cf41ee0cc3af376417f..c8c2f3cbf9fae868e15eaa0bfdba13a7233dbe8a 100755 (executable)
@@ -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 = []
index dde77beb49459827ca7f40cce210b45d6257ccad..cefc451dabcbfbbeca91cdc0ed533926ae9ab52a 100644 (file)
@@ -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]);