Enhance blood stain mechanics: add dynamic blood surface generation and integrate blood stains into game rendering
This commit is contained in:
+8
-2
@@ -91,12 +91,18 @@ class Rat(Unit):
|
||||
def die(self, unit=None, score=10):
|
||||
"""Handle rat death and spawn points."""
|
||||
target_unit = unit if unit else self
|
||||
death_position = target_unit.position_before
|
||||
|
||||
# Use base class cleanup
|
||||
if target_unit.id in self.game.units:
|
||||
self.game.units.pop(target_unit.id)
|
||||
# Rat-specific behavior: spawn points
|
||||
self.game.spawn_unit(Point, target_unit.position_before, value=score)
|
||||
|
||||
# Rat-specific behavior: spawn points
|
||||
self.game.spawn_unit(Point, death_position, value=score)
|
||||
|
||||
# Add blood stain directly to background
|
||||
self.game.add_blood_stain(death_position)
|
||||
|
||||
def draw(self):
|
||||
start_perf = self.game.render_engine.get_perf_counter()
|
||||
direction = self.calculate_rat_direction()
|
||||
|
||||
Reference in New Issue
Block a user