From: Geoffrey Allott Date: Sun, 25 Dec 2022 20:32:36 +0000 (+0000) Subject: get any pending keys each cycle X-Git-Url: https://git.pointlesshacks.com/?a=commitdiff_plain;h=909bcb32c7ecdd9a198a05e759f958889f7499a0;p=snake.git get any pending keys each cycle --- diff --git a/snake.py b/snake.py index 7d70dde..6be31c3 100644 --- a/snake.py +++ b/snake.py @@ -256,6 +256,8 @@ class GameArea: raise ExitGameException() if ch == ord('r'): raise RestartGameException() + if ch != -1: + self.getch() def random_empty_tile(self): return self.random.choice([