Draw explosions and gas inside tunnel cells
Remove the is_hidden_in_tunnel() checks from Explosion.draw() and Gas.draw() so explosions and gas clouds remain visible when their center falls inside a tunnel cell. Logic already spawned them in tunnel cells, but they were rendered invisible because the draw path returned early.
This commit is contained in:
@@ -169,9 +169,6 @@ class Explosion(Bomb):
|
||||
x_pos = self.position_before[0] * self.game.cell_size + (self.game.cell_size - image_size[0]) // 2 + partial_x
|
||||
y_pos = self.position_before[1] * self.game.cell_size + (self.game.cell_size - image_size[1]) // 2 + partial_y
|
||||
|
||||
if self.is_hidden_in_tunnel(image_size):
|
||||
return
|
||||
|
||||
self.game.render_engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit")
|
||||
|
||||
|
||||
|
||||
@@ -75,10 +75,8 @@ class Gas(Unit):
|
||||
|
||||
x_pos = self.position_before[0] * self.game.cell_size + (self.game.cell_size - image_size[0]) // 2 + partial_x
|
||||
y_pos = self.position_before[1] * self.game.cell_size + (self.game.cell_size - image_size[1]) // 2 + partial_y
|
||||
if not self.is_hidden_in_tunnel(image_size):
|
||||
self.game.render_engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit")
|
||||
for cell in self.spreading_cells:
|
||||
x_pos = cell[0] * self.game.cell_size + (self.game.cell_size - image_size[0]) // 2 + partial_x
|
||||
y_pos = cell[1] * self.game.cell_size + (self.game.cell_size - image_size[1]) // 2 + partial_y
|
||||
if not self.is_hidden_in_tunnel(image_size, position=cell):
|
||||
self.game.render_engine.draw_image(x_pos, y_pos, image, anchor="nw", tag="unit")
|
||||
|
||||
Reference in New Issue
Block a user