level3 done

This commit is contained in:
Nicholas 2025-05-19 17:27:17 +01:00
parent 1452de0742
commit 653860fff7
4 changed files with 74 additions and 1 deletions

File diff suppressed because one or more lines are too long

18
triggers/exitZone3.tscn Normal file
View File

@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://8f5ju5hv8elk"]
[ext_resource type="Script" uid="uid://b0brgicfdcox0" path="res://triggers/exit_zone3.gd" id="1_pekjb"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jhhth"]
size = Vector2(32, 29)
[node name="exit3" type="Node2D"]
[node name="exitZone" type="Area2D" parent="."]
position = Vector2(14, -18)
script = ExtResource("1_pekjb")
[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"]

15
triggers/exit_zone3.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(" ")

View File

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