Update keybindings and enhance loading screen functionality

- Refactor keybindings for gas spawning across multiple configurations
- Implement new loading screen updates during game initialization
- Add tests to ensure all weapon actions are exposed in keybinding profiles
- Introduce new assets for explosion effects
This commit is contained in:
2026-05-09 13:29:32 +02:00
parent 310dc0dca9
commit d9d7a4ac82
16 changed files with 306 additions and 21 deletions
+15 -2
View File
@@ -89,6 +89,10 @@ class MiceMaze(
):
# ==================== INITIALIZATION ====================
def _update_startup_loading(self, message, detail=None, progress=None):
if getattr(self, "startup_loading_active", False):
self.render_engine.show_loading_screen(message, detail=detail, progress=progress)
def __init__(self, maze_file, level_index=0):
# Initialize user profile integration
@@ -120,6 +124,8 @@ class MiceMaze(
self.cell_size, window_title,
key_callback=self.trigger)
self.render_engine.audio = self.audio
self.startup_loading_active = True
self._update_startup_loading("Loading Mice!", detail="Applying player settings", progress=0.08)
# Apply profile settings
if hasattr(self.render_engine, 'set_sound_volume'):
@@ -130,15 +136,22 @@ class MiceMaze(
self.render_engine.set_volume(self.music_volume)
self.initialize_keybindings()
self._update_startup_loading("Loading configuration", detail="Reading bundled settings", progress=0.14)
self.configs = self.get_config()
self._update_startup_loading("Scanning music", detail="Building soundtrack list", progress=0.2)
self.available_music_tracks = self._load_available_music_tracks()
self.current_level_music = None
self._update_startup_loading("Loading graphics", detail="Preparing common assets", progress=0.26)
self.load_assets()
self._update_startup_loading("Loading start menu", detail="Preparing menu animation", progress=0.9)
self.start_menu_animation = self.render_engine.load_animation(START_MENU_ANIMATION)
self.start_menu_animation_started_at = time.monotonic()
self.render_engine.window.show()
self._update_startup_loading("Starting", detail="Opening intro screen", progress=0.98)
self.render_engine.show_intro(bundle_path("assets", "Rat", "intro.png"))
self.startup_loading_active = False
self.pointer = (random.randint(1, self.map.width-2), random.randint(1, self.map.height-2))
self.scroll_cursor()
self.points = 0
@@ -965,10 +978,10 @@ class MiceMaze(
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")
self.game_status = "paused"
if self._is_last_dat_level():
self.render_engine.play_sound("WELLDONE.WAV", tag="effects")
self.game_end = (True, GAME_END_RUN_COMPLETE)
self._record_run_result(completed=True)
print(f"[flow] final DAT victory reached: points={self.points} level={self.current_level + 1}")