From 63dba33ce0fd4b37d181e2561944f1a36cb5c586 Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Wed, 10 Nov 2021 11:37:05 +0000 Subject: [PATCH] show player name --- viewer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/viewer.py b/viewer.py index 57fbdaa..2271e74 100644 --- a/viewer.py +++ b/viewer.py @@ -79,6 +79,7 @@ async def main_loop(queue): state = await queue.get() # first state message includes map information logging.debug("Initial game status: %s", state) newgame_json = json.loads(state) + player_name = "" win.fill((0, 0, 0)) @@ -171,6 +172,12 @@ def draw_blocks(coordinates, color, x_offset=0, y_offset=0): ) yy += 6 + draw_info( + win, + f"{player_name}", + scale((dimensions.x + 1, dimensions.y-1)), + COLORS["white"], + ) draw_info( win, f"SCORE: {score}",