diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-05-23 14:11:43 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-05-23 14:11:43 +0200 |
commit | 06647b11ee163bc40daf454d87e1fcae563c3ced (patch) | |
tree | 866823ed79fa1c3bbdcb8b0be417f028f0c92d9b /Scenes/Maps/Base01.gd | |
parent | 276b7664bd4a475a3ca93a682c16b49c504c58f7 (diff) |
update
Diffstat (limited to 'Scenes/Maps/Base01.gd')
-rw-r--r-- | Scenes/Maps/Base01.gd | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Scenes/Maps/Base01.gd b/Scenes/Maps/Base01.gd index 83947e4..96e5520 100644 --- a/Scenes/Maps/Base01.gd +++ b/Scenes/Maps/Base01.gd @@ -69,18 +69,20 @@ func place_boxes( var tile_size = tilemap.tile_set.tile_size for entity in entry_entities: placeable_cells.erase(tilemap.local_to_map(entity.position)) - placeable_cells.erase(tilemap.local_to_map( - entity.position + Vector2(0, tile_size.y) - )) - placeable_cells.erase(tilemap.local_to_map( - entity.position + Vector2(tile_size.x, 0) - )) - placeable_cells.erase(tilemap.local_to_map( - entity.position + Vector2(0, -tile_size.y) - )) - placeable_cells.erase(tilemap.local_to_map( - entity.position + Vector2(-tile_size.x, 0) - )) + # erase in 2 times around + for n in range(1, 3): + placeable_cells.erase(tilemap.local_to_map( + entity.position + Vector2(0, tile_size.y * n) + )) + placeable_cells.erase(tilemap.local_to_map( + entity.position + Vector2(tile_size.x * n, 0) + )) + placeable_cells.erase(tilemap.local_to_map( + entity.position + Vector2(0, -tile_size.y * n) + )) + placeable_cells.erase(tilemap.local_to_map( + entity.position + Vector2(-tile_size.x * n, 0) + )) if include_edges: var rect := tilemap.get_used_rect() @@ -103,14 +105,12 @@ func handle_doors(doors: Array, condition): for door in doors: door.enable() - if condition.check(): - for door in doors: - door.disable() - condition.fulfilled.connect(func(): for door in doors: door.disable() ) + + condition.check() func door_condition_enemies(enemies: Array): var condition = Utilities.Condition.new() |