Screen is refreshed only when pads are all refreshed, fixes #50

This commit is contained in:
Yohann D'ANELLO
2020-12-18 16:40:52 +01:00
parent 5ae49e71ff
commit 77f52b6276
6 changed files with 25 additions and 14 deletions

View File

@ -61,16 +61,18 @@ class Game:
self.map.spawn_random_entities(randint(3, 10))
self.inventory_menu.update_player(self.player)
def run(self, screen: Any) -> None:
def run(self, screen: Any) -> None: # pragma no cover
"""
Main infinite loop.
We wait for the player's action, then we do what that should be done
when the given key gets pressed.
"""
while True: # pragma no cover
screen.refresh()
while True:
screen.erase()
screen.refresh()
screen.noutrefresh()
self.display_actions(DisplayActions.REFRESH)
curses.doupdate()
key = screen.getkey()
if key == "KEY_MOUSE":
_ignored1, x, y, _ignored2, _ignored3 = curses.getmouse()