Fix egdewrapping
This commit is contained in:
parent
e44fc0ee09
commit
539982ef10
11
World/Map.gd
11
World/Map.gd
|
@ -96,6 +96,11 @@ func parse_map_file(file_name):
|
|||
print("Map data or dimensions missing")
|
||||
|
||||
func apply_options():
|
||||
# $"Map boundaries/CollisionShape2D".shape.size = 64 * Vector2i(width, height)
|
||||
# $"Map boundaries".position = 64 * Vector2i(width, height)
|
||||
pass
|
||||
if MapConfig.edgewrap:
|
||||
$"../Map boundaries/CollisionShape2D".shape.size = 64 * Vector2i(MapConfig.mapwidth, MapConfig.mapheight)
|
||||
$"../Map boundaries".position = 64 * Vector2i(MapConfig.mapwidth, MapConfig.mapheight)
|
||||
if not $"../Map boundaries".is_connected("body_exited", $".."._on_map_boundaries_body_exited):
|
||||
$"../Map boundaries".connect("body_exited", $".."._on_map_boundaries_body_exited)
|
||||
else:
|
||||
if $"../Map boundaries".is_connected("body_exited", $".."._on_map_boundaries_body_exited):
|
||||
$"../Map boundaries".disconnect("body_exited", $".."._on_map_boundaries_body_exited)
|
||||
|
|
|
@ -182,5 +182,3 @@ shape = SubResource("RectangleShape2D_hjo0t")
|
|||
_spawnable_scenes = PackedStringArray("res://World/PlayerShip.tscn")
|
||||
spawn_path = NodePath("../Players")
|
||||
spawn_limit = 4
|
||||
|
||||
[connection signal="body_exited" from="Map boundaries" to="." method="_on_map_boundaries_body_exited"]
|
||||
|
|
Loading…
Reference in New Issue