Fix bomb explosions not killing rats and remove tracked pycache
- Move Timer explosion from move() to collisions() so all units are registered in the collision system before the kill query runs. - Explosion units now set a bbox and kill rats that touch them. - Guard Rat.draw() so dead rats are not drawn. - Remove units/__pycache__ files from tracking.
This commit is contained in:
@@ -171,6 +171,8 @@ class Rat(Unit):
|
||||
|
||||
def draw(self):
|
||||
"""Optimized draw using pre-calculated positions from move()"""
|
||||
if self.id not in self.game.units:
|
||||
return
|
||||
sex = self.sex if self.age > AGE_THRESHOLD else "BABY"
|
||||
image = self.game.graphics.rat_assets_textures[sex][self.direction]
|
||||
image_size = self.game.graphics.rat_image_sizes[sex][self.direction]
|
||||
|
||||
Reference in New Issue
Block a user