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:
+3
-3
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user