Fix gas poisoning, explosion hit detection and render order

- Move gas poisoning from Gas.move() to Gas.collisions() so all rats are
  registered in the collision system before the poison query runs.
- Shrink gas and explosion bboxes so rats must be well inside the tile to
  be poisoned/killed.
- Use AABB overlap instead of partial_move threshold for gas poisoning.
- Draw mobile units first, then top-layer effects (gas, mines, bombs,
  explosions) so rats appear under the gas.
- Add draw_on_top hint to Unit base class and top-layer units.
This commit is contained in:
2026-06-16 19:19:14 +02:00
parent 3e8cd97fda
commit 2f8e3e8b28
7 changed files with 88 additions and 33 deletions
+2
View File
@@ -3,6 +3,8 @@ from .bomb import Explosion
from engine.collision_system import CollisionLayer
class Mine(Unit):
draw_on_top = True
def __init__(self, game, position=(0,0), id=None):
super().__init__(game, position, id, collision_layer=CollisionLayer.MINE, unit_type=UnitType.MINE)
self.speed = 1.0 # Mine doesn't move but needs speed for consistency