Browse Source
- 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 effectsmaster
16 changed files with 306 additions and 21 deletions
|
After Width: | Height: | Size: 419 B |
|
After Width: | Height: | Size: 425 B |
|
After Width: | Height: | Size: 428 B |
|
After Width: | Height: | Size: 416 B |
@ -0,0 +1,40 @@
|
||||
[mice-launcher] script_dir=/home/enne2/dev/mice |
||||
[mice-launcher] game_dir=/home/enne2/dev/mice |
||||
[mice-launcher] python=/home/enne2/dev/mice/.venv/bin/python |
||||
Game starting... |
||||
Loading map from /home/enne2/dev/mice/assets/Rat/level.dat (level 0) |
||||
Loaded profile: Player1 |
||||
Screen size: 1280x1280 |
||||
[input] no joystick detected |
||||
[input] keybindings profile=pc source=keybindings_pc.yaml reason=default |
||||
[gfx] load_assets requested: level=1 theme=1 |
||||
Loading graphics assets... |
||||
Pre-generating blood stain pool... |
||||
[gfx] common assets loaded |
||||
Loading theme assets 1... |
||||
[gfx] theme cache miss -> loaded theme 1 |
||||
[flow] start_game: level=1 difficulty=easy starting_rats=5 rat_speed=100% |
||||
[audio] level 1 music=Clockwork_Thicket.mp3 source=config |
||||
[flow] choose_start computed 279 spawnable cells |
||||
[flow] spawn_rat using position=(27, 16) |
||||
[flow] spawn_rat using position=(30, 6) |
||||
[flow] spawn_rat using position=(10, 14) |
||||
[flow] spawn_rat using position=(1, 30) |
||||
[flow] spawn_rat using position=(20, 30) |
||||
[gfx] generating background texture for level=1 theme=1 |
||||
[flow] reset_game called: game_end=(False, None) game_status=start_menu menu_screen=start points=0 level=1 |
||||
[flow] reset_game -> leaving menu_screen=start and entering gameplay |
||||
[flow] load_level requested: target_level=1 preserve_points=False show_menu=False menu_screen=None current_points=0 next_theme=1 |
||||
[audio] level 1 music=Clockwork_Thicket.mp3 source=config |
||||
[flow] theme unchanged: reusing theme 1 |
||||
[flow] points reset for new run |
||||
[flow] spawning 5 rats for level=1 difficulty=easy |
||||
[flow] choose_start computed 279 spawnable cells |
||||
[flow] spawn_rat using position=(8, 26) |
||||
[flow] spawn_rat using position=(27, 19) |
||||
[flow] spawn_rat using position=(10, 10) |
||||
[flow] spawn_rat using position=(27, 11) |
||||
[flow] spawn_rat using position=(6, 26) |
||||
[flow] level loaded directly into gameplay: level=1 points=0 |
||||
[gfx] generating background texture for level=1 theme=1 |
||||
BOOM |
||||
@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env python3 |
||||
|
||||
import unittest |
||||
from pathlib import Path |
||||
|
||||
from engine import controls |
||||
|
||||
|
||||
class DummyBindings(controls.KeyBindings): |
||||
def spawn_rat(self): |
||||
pass |
||||
|
||||
def toggle_audio(self): |
||||
pass |
||||
|
||||
def toggle_full_screen(self): |
||||
pass |
||||
|
||||
def start_scrolling(self, direction): |
||||
pass |
||||
|
||||
def stop_scrolling(self): |
||||
pass |
||||
|
||||
def spawn_new_bomb(self): |
||||
pass |
||||
|
||||
def spawn_new_nuclear_bomb(self): |
||||
pass |
||||
|
||||
def spawn_new_mine(self): |
||||
pass |
||||
|
||||
def spawn_new_gas(self): |
||||
pass |
||||
|
||||
def spawn_gas(self, parent_id=None): |
||||
pass |
||||
|
||||
def toggle_pause(self): |
||||
pass |
||||
|
||||
def reset_game(self): |
||||
pass |
||||
|
||||
def quit_game(self): |
||||
pass |
||||
|
||||
def menu_up(self): |
||||
pass |
||||
|
||||
def menu_down(self): |
||||
pass |
||||
|
||||
def menu_left(self): |
||||
pass |
||||
|
||||
def menu_right(self): |
||||
pass |
||||
|
||||
|
||||
class KeybindingProfileTests(unittest.TestCase): |
||||
def test_shipped_profiles_expose_all_weapon_actions(self): |
||||
dummy = DummyBindings() |
||||
conf_dir = Path(__file__).resolve().parent / "conf" |
||||
weapon_actions = { |
||||
"spawn_new_bomb", |
||||
"spawn_new_nuclear_bomb", |
||||
"spawn_new_mine", |
||||
"spawn_new_gas", |
||||
} |
||||
|
||||
for config_path in sorted(conf_dir.glob("keybindings*.json")) + sorted(conf_dir.glob("keybindings*.yaml")): |
||||
bindings = controls._load_bindings_from_file(config_path) |
||||
validated = dummy._validate_bindings(bindings, config_path) |
||||
game_bindings = validated.get("keybinding_game", {}) |
||||
self.assertTrue(game_bindings, f"missing keybinding_game in {config_path.name}") |
||||
|
||||
actions = set(game_bindings.values()) |
||||
self.assertTrue( |
||||
weapon_actions.issubset(actions), |
||||
f"incomplete weapon bindings in {config_path.name}: {sorted(actions)}", |
||||
) |
||||
|
||||
|
||||
if __name__ == "__main__": |
||||
unittest.main() |
||||
Loading…
Reference in new issue