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:
+10
-10
@@ -93,7 +93,7 @@ class Rat(Unit):
|
||||
sex = self.sex if self.age > AGE_THRESHOLD else "BABY"
|
||||
|
||||
# Get cached image size instead of calling get_image_size()
|
||||
image_size = self.game.rat_image_sizes[sex][self.direction]
|
||||
image_size = self.game.graphics.rat_image_sizes[sex][self.direction]
|
||||
|
||||
# Calculate partial movement offset
|
||||
if self.direction in ["UP", "DOWN"]:
|
||||
@@ -130,7 +130,7 @@ class Rat(Unit):
|
||||
|
||||
# Process each collision
|
||||
for _, other_id in collisions:
|
||||
other_unit = self.game.get_unit_by_id(other_id)
|
||||
other_unit = self.game.unit_manager.get_unit_by_id(other_id)
|
||||
|
||||
# Skip if not another Rat
|
||||
if not isinstance(other_unit, Rat):
|
||||
@@ -164,17 +164,17 @@ class Rat(Unit):
|
||||
|
||||
# Rat-specific behavior: spawn points
|
||||
if score not in [None, 0]:
|
||||
self.game.add_point(score)
|
||||
self.game.spawn_unit(Point, death_position, value=score)
|
||||
self.game.scoring.add_point(score)
|
||||
self.game.unit_manager.spawn_unit(Point, death_position, value=score)
|
||||
|
||||
# Add blood stain directly to background
|
||||
self.game.add_blood_stain(death_position)
|
||||
self.game.graphics.add_blood_stain(death_position)
|
||||
|
||||
def draw(self):
|
||||
"""Optimized draw using pre-calculated positions from move()"""
|
||||
sex = self.sex if self.age > AGE_THRESHOLD else "BABY"
|
||||
image = self.game.rat_assets_textures[sex][self.direction]
|
||||
image_size = self.game.rat_image_sizes[sex][self.direction]
|
||||
image = self.game.graphics.rat_assets_textures[sex][self.direction]
|
||||
image_size = self.game.graphics.rat_image_sizes[sex][self.direction]
|
||||
|
||||
# Calculate render position if not yet set (first frame)
|
||||
if not hasattr(self, 'render_x'):
|
||||
@@ -275,7 +275,7 @@ class Rat(Unit):
|
||||
"""Calculate render position and bbox (used when render_x not yet set)"""
|
||||
sex = self.sex if self.age > AGE_THRESHOLD else "BABY"
|
||||
image_size = self.game.render_engine.get_image_size(
|
||||
self.game.rat_assets_textures[sex][self.direction]
|
||||
self.game.graphics.rat_assets_textures[sex][self.direction]
|
||||
)
|
||||
|
||||
partial_x, partial_y = 0, 0
|
||||
@@ -314,7 +314,7 @@ class Female(Rat):
|
||||
self.babies -= 1
|
||||
self.stop = 20
|
||||
if self.partial_move > 0.2:
|
||||
self.game.spawn_rat(self.position)
|
||||
self.game.unit_manager.spawn_rat(self.position)
|
||||
else:
|
||||
self.game.spawn_rat(self.position_before)
|
||||
self.game.unit_manager.spawn_rat(self.position_before)
|
||||
self.game.render_engine.play_sound("BIRTH.WAV")
|
||||
Reference in New Issue
Block a user