Refactor rendering logic in MiceMaze and Rat classes for improved clarity and efficiency

This commit is contained in:
2026-04-14 12:15:16 +02:00
parent bbafc3bbba
commit 509b3433b8
3 changed files with 455 additions and 60 deletions
+4 -4
View File
@@ -331,14 +331,14 @@ class MiceMaze(
self.unit_positions.setdefault(unit.position, []).append(unit)
self.unit_positions_before.setdefault(unit.position_before, []).append(unit)
self.draw_cave_foreground()
self.render_engine.draw_pointer(self.pointer[0] * self.cell_size, self.pointer[1] * self.cell_size)
# Fourth pass: check collisions and draw
for unit in self.units.copy().values():
unit.collisions()
unit.draw()
self.draw_cave_foreground()
self.render_engine.draw_pointer(self.pointer[0] * self.cell_size, self.pointer[1] * self.cell_size)
self.render_engine.update_status(f"Mice: {self.count_rats()} - Points: {self.points}")