Add non-regression test states and Bluetooth diagnostic script

- Introduced a new JSON file containing non-regression test states with detailed unit information, including positions, ages, and movement directions across multiple frames.
- Added a shell script for Bluetooth diagnostics that checks system information, Bluetooth binaries, running processes, D-Bus status, Bluetooth controller details, and audio stack status, providing a comprehensive overview for troubleshooting.
This commit is contained in:
John Doe
2026-05-17 23:36:24 +02:00
parent dd82ccc087
commit 486cd6b7c5
31 changed files with 2244 additions and 698 deletions
+6 -6
View File
@@ -36,7 +36,7 @@ class Bomb(Unit):
n = 1
if n < 0:
n = 0
image = self.game.bomb_assets[n]
image = self.game.graphics.bomb_assets[n]
image_size = self.game.render_engine.get_image_size(image)
self.rat_image = image
partial_x, partial_y = 0, 0
@@ -70,7 +70,7 @@ class Timer(Bomb):
print(f"Unit {target_unit.id} already dead")
# Bomb-specific behavior: create explosion
self.game.spawn_unit(Explosion, target_unit.position)
self.game.unit_manager.spawn_unit(Explosion, target_unit.position)
# Collect all explosion positions using vectorized approach
explosion_positions = []
@@ -94,7 +94,7 @@ class Timer(Bomb):
# Create all explosions at once
for pos in explosion_positions:
self.game.spawn_unit(Explosion, pos)
self.game.unit_manager.spawn_unit(Explosion, pos)
# Use optimized collision system to get all rats in explosion area
# This replaces the nested loop with a single vectorized operation
@@ -105,7 +105,7 @@ class Timer(Bomb):
# Kill all victims with score multiplier
for victim_id in victim_ids:
victim = self.game.get_unit_by_id(victim_id)
victim = self.game.unit_manager.get_unit_by_id(victim_id)
if victim and victim.id in self.game.units:
# Determine position based on partial_move
victim_pos = victim.position if victim.partial_move >= 0.5 else victim.position_before
@@ -128,7 +128,7 @@ class Explosion(Bomb):
self.die()
def draw(self):
image = self.game.assets["BMP_EXPLOSION"]
image = self.game.graphics.assets["BMP_EXPLOSION"]
image_size = self.game.render_engine.get_image_size(image)
partial_x, partial_y = 0, 0
@@ -186,7 +186,7 @@ class NuclearBomb(Unit):
def draw(self):
"""Draw nuclear bomb on position"""
image = self.game.assets["BMP_NUCLEAR"]
image = self.game.graphics.assets["BMP_NUCLEAR"]
image_size = self.game.render_engine.get_image_size(image)
x_pos = self.position[0] * self.game.cell_size + (self.game.cell_size - image_size[0]) // 2