diff --git a/engine/graphics.py b/engine/graphics.py index 120e2f2..119ecad 100644 --- a/engine/graphics.py +++ b/engine/graphics.py @@ -21,7 +21,7 @@ class Graphics(): self.assets = {} for file in os.listdir("assets/Rat"): if file.endswith(".png"): - self.assets[file[:-4]] = self.render_engine.load_image(f"Rat/{file}") + self.assets[file[:-4]] = self.render_engine.load_image(f"Rat/{file}", transparent_color=(128, 128, 128)) diff --git a/engine/sdl2.py b/engine/sdl2.py index 89d6b97..e2e9143 100644 --- a/engine/sdl2.py +++ b/engine/sdl2.py @@ -455,12 +455,12 @@ class GameWindow: current_time = sdl2.SDL_GetTicks() elapsed_time = current_time - self.white_flash_start_time - if elapsed_time < 1000: # First 1 second : full white + if elapsed_time < 500: # First 500ms : full white self.white_flash_opacity = 255 return True - elif elapsed_time < 3000: # Next 2 seconds: fade out - # Calculate fade based on remaining time (2000ms fade duration) - fade_progress = (elapsed_time - 1000) / 2000.0 # 0.0 to 1.0 + elif elapsed_time < 2000: # Next 2 seconds: fade out + # Calculate fade based on remaining time (1000ms fade duration) + fade_progress = (elapsed_time - 500) / 1000.0 # 0.0 to 1.0 self.white_flash_opacity = int(255 * (1.0 - fade_progress)) return True else: # Effect is complete diff --git a/rats.py b/rats.py index d56e961..59c07fe 100644 --- a/rats.py +++ b/rats.py @@ -184,6 +184,7 @@ class MiceMaze( entry.get('user_id', 'Unknown'), ]) + if not self.game_end[1]: self.render_engine.dialog( "Game Over: Mice are too many!", diff --git a/server/mice_game.db b/server/mice_game.db index e586eae..8f8b96a 100644 Binary files a/server/mice_game.db and b/server/mice_game.db differ diff --git a/units/bomb.py b/units/bomb.py index 3442774..afc8bd9 100644 --- a/units/bomb.py +++ b/units/bomb.py @@ -151,7 +151,7 @@ class NuclearBomb(Unit): if random.random() < 0.7: # 70% chance to kill each rat rats_to_kill.append(unit) for unit in rats_to_kill: - unit.die(score=None) + unit.die(score=5) print(f"Nuclear explosion killed {len(rats_to_kill)} rats!") diff --git a/units/gas.py b/units/gas.py index a02f51a..59e1f79 100644 --- a/units/gas.py +++ b/units/gas.py @@ -47,8 +47,8 @@ class Gas(Unit): self.game.spawn_unit(Gas, (new_x, new_y), parent_id=self.parent_id if self.parent_id else self.id) def collisions(self): pass - - def die(self, unit=None): + + def die(self, unit=None, score=None): if not unit: unit = self self.game.units.pop(unit.id) diff --git a/user_profiles.json b/user_profiles.json index fe5d1d4..a167f58 100644 --- a/user_profiles.json +++ b/user_profiles.json @@ -78,10 +78,10 @@ "B0B": { "name": "B0B", "created_date": "2025-08-21T18:03:12.189612", - "last_played": "2025-08-21T18:04:57.426796", + "last_played": "2025-08-21T18:59:35.393040", "games_played": 0, - "total_score": 0, - "best_score": 0, + "total_score": 590, + "best_score": 590, "settings": { "difficulty": "normal", "sound_volume": 50,