Level2 update

This commit is contained in:
Nicholas 2025-05-19 16:52:30 +01:00
parent f1f4e8db8d
commit 41dc9d98a6
7 changed files with 83 additions and 4 deletions

View File

@ -90,6 +90,7 @@ texture_region_size = Vector2i(32, 32)
17:12/0 = 0 17:12/0 = 0
1:13/0 = 0 1:13/0 = 0
2:13/0 = 0 2:13/0 = 0
2:13/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -16, 16, 16, 16, 16, -16)
3:13/0 = 0 3:13/0 = 0
4:13/0 = 0 4:13/0 = 0
5:13/0 = 0 5:13/0 = 0

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jhhth"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_jhhth"]
size = Vector2(32, 29) size = Vector2(32, 29)
[node name="Node2D" type="Node2D"] [node name="exit" type="Node2D"]
[node name="exitZone" type="Area2D" parent="."] [node name="exitZone" type="Area2D" parent="."]
position = Vector2(14, -18) position = Vector2(14, -18)

15
triggers/exitZone2.tscn Normal file
View File

@ -0,0 +1,15 @@
[gd_scene load_steps=2 format=3 uid="uid://c0h3r0ot5jeds"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jhhth"]
size = Vector2(32, 29)
[node name="exit2" type="Node2D"]
[node name="exitZone" type="Area2D" parent="."]
position = Vector2(14, -18)
[node name="CollisionShape2D" type="CollisionShape2D" parent="exitZone"]
position = Vector2(-14, 18)
shape = SubResource("RectangleShape2D_jhhth")
[connection signal="body_entered" from="exitZone" to="exitZone" method="_on_body_entered"]

View File

@ -12,4 +12,4 @@ func levelComplete():
func _on_body_entered(body: Node2D) -> void: func _on_body_entered(body: Node2D) -> void:
if activated: if activated:
get_tree().change_scene_to_file("res://planetScene/planet.tscn") get_tree().change_scene_to_file(" ")

15
triggers/exit_zone2.gd Normal file
View File

@ -0,0 +1,15 @@
extends Area2D
var activated: bool = false
func _ready() -> void:
var scoreBar = get_tree().root.find_child("ProgressBar", true, false)
scoreBar.connect("complete", Callable(self, "levelComplete"))
func levelComplete():
activated = true
print("exit active")
func _on_body_entered(body: Node2D) -> void:
if activated:
get_tree().change_scene_to_file("res://planetScene/planet.tscn")

View File

@ -0,0 +1 @@
uid://b2wo3pho6jsk3