25 lines
611 B
GDScript
25 lines
611 B
GDScript
class_name GameController extends Node2D
|
|
|
|
signal teleportSignal(body)
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass # Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|
|
|
|
func _on_trigger(effect: Variant, Object: Variant) -> void:
|
|
print("GC knows about trigger: " + effect)
|
|
match effect:
|
|
"destroy":
|
|
if not Object is Player:
|
|
Object.queue_free()
|
|
"teleport":
|
|
print("Trigger wants to teleport")
|
|
if Object is Crate:
|
|
teleportSignal.emit(Object)
|