diff --git a/funcs/game.py b/funcs/game.py index 70325b7..ebcda94 100644 --- a/funcs/game.py +++ b/funcs/game.py @@ -40,3 +40,4 @@ class Game: def draw_game(self) -> None: raise NotImplementedError + diff --git a/funcs/undo_doodle.py b/funcs/undo_doodle.py index 2527c25..c55f50b 100644 --- a/funcs/undo_doodle.py +++ b/funcs/undo_doodle.py @@ -55,6 +55,18 @@ class DoodleGame(Game): self.doodle = self.doodle.end_stroke() elif event.type == pygame.KEYDOWN and event.key == pygame.K_BACKSPACE: self.doodle = self.doodle.undo() + else: + return # andere Events nicht ausgeben + self.debug_print() + + def debug_print(self) -> None: + d = self.doodle + print("---") + print("Striche aktuell :", len(d.strokes)) + print("Stift aufgesetzt:", d.drawing) + print("Historie :", len(d.history), "Zustände") + for i, zustand in enumerate(d.history): + print(f" [{i}] {len(zustand)} Striche") def update_game(self) -> bool: return True