This commit is contained in:
MarkYabut committed 2026-10-13 20:58:42 -04:00
1 parent 3607e63548
commit c1486f3e55
16 files changed
+488 -22

No files matched your search

+5 -4
View File
@@ -1,6 +1,7 @@
class_name GameController extends Node2D
signal teleportSignal(body)
signal teleportSignal(body:RigidBody2D)
signal destroySignal(body)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
@@ -17,7 +18,7 @@ func _on_trigger(effect: Variant, Object: Variant) -> void:
match effect:
"destroy":
if not Object is Player:
Object.queue_free()
destroySignal.emit(Object)
"teleport":
print("Trigger wants to teleport")
if Object is Crate:
@@ -26,6 +27,6 @@ func _on_trigger(effect: Variant, Object: Variant) -> void:
func _on_bullet_hit(body, bullet) -> void:
print("GC knows bullet hit")
if body is Crate:
body.queue_free()
bullet.queue_free()
destroySignal.emit(body)
destroySignal.emit(bullet)