From 06647b11ee163bc40daf454d87e1fcae563c3ced Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 23 May 2024 14:11:43 +0200 Subject: update --- Scenes/Maps/Base01.gd | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Scenes/Maps/Base01.gd') 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() -- cgit v1.2.3