Refactor keybindings configuration and remove obsolete JSON files

This commit is contained in:
2025-08-19 23:21:37 +02:00
parent 1269913275
commit 8451ac7913
14 changed files with 102 additions and 90 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ import os
import json
from engine import maze, sdl2 as engine, controls, graphics, unit_manager, scoring
from units import points
class MiceMaze(
controls.KeyBindings,
@@ -118,7 +119,7 @@ class MiceMaze(
def run(self):
self.render_engine.mainloop(update=self.update_maze, bg_update=self.draw_maze)
# ==================== GAME OVER LOGIC ====================
def game_over(self):
@@ -137,7 +138,7 @@ class MiceMaze(
self.game_end = (True, False)
self.game_status = "paused"
return True
if not count_rats:
if not count_rats and not any(isinstance(unit, points.Point) for unit in self.units.values()):
self.render_engine.stop_sound()
self.render_engine.play_sound("VICTORY.WAV")
self.render_engine.play_sound("WELLDONE.WAV", tag="effects")