Skip to content

Commit

Permalink
fix: be sure to clear all of 'bottom' door tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
russmatney committed Mar 27, 2024
1 parent b06ab6d commit 7866c85
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/dino/modes/vania/maps/VaniaRoom.gd
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ func get_door_cells_to_neighbor(neighbor):
var cell_width = MetSys.settings.in_game_cell_size.x
var cell_height = MetSys.settings.in_game_cell_size.y

var border_width = tile_border_width * 16
var door_width = tile_door_width * 16
var tile_size = 16
var border_width = tile_border_width * tile_size
var door_width = tile_door_width * tile_size

var door_rect = Rect2()
match wall:
Expand All @@ -108,10 +109,10 @@ func get_door_cells_to_neighbor(neighbor):
door_rect.position.x += (cell_width - door_width) / 2
door_rect.size = Vector2(door_width, border_width)
Vector2.DOWN:
door_rect.position = cell_rect.position
door_rect.position.y += (cell_height - border_width)
door_rect.position = Vector2(cell_rect.position.x, cell_rect.end.y)
door_rect.position.y -= border_width
door_rect.position.x += (cell_width - door_width) / 2
door_rect.size = Vector2(door_width, border_width)
door_rect.size = Vector2(door_width, border_width + tile_size)

var rect = Reptile.rect_to_local_rect(tilemap, door_rect)
return Reptile.cells_in_rect(rect)

0 comments on commit 7866c85

Please sign in to comment.