Refactor keybindings configuration and remove obsolete JSON files
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user