Render rats inside internal tunnel passages

Previously Rat.draw() hid any rat whose center fell inside a tunnel.
The clipping helper only handled single-entrance cells and returned None
for internal passages/crossroads, causing rats to vanish entirely.

Now internal tunnel cells (those with 0 or 2+ open sides) draw the rat
normally so it remains visible while walking through the tunnel.
Single-entrance cells keep the partial clip effect.
Also fix the visible-ratio math for DOWN/RIGHT clipping: the old
formulas subtracted cell_size from a local coordinate, producing
zero or negative visibility.
This commit is contained in:
2026-06-16 20:28:53 +02:00
parent b1e9770991
commit 5afdf3705b
2 changed files with 16 additions and 15 deletions
+3 -3
View File
@@ -347,9 +347,9 @@ class Graphics:
if below:
if left:
if right:
# Internal tunnel passage: draw a neutral floor cap
# so the grey background does not show through.
draw_cave(random_wall_texture(), px + half_cell, py + half_cell, None)
# Internal tunnel passage: leave it empty so it uses
# the background fill color and stays visually open.
pass
else:
draw_cave(self.caves["RIGHT"], px, py, "RIGHT")
else: