MarchGame/scripts/gameController.gd
2026-03-02 21:07:00 -05:00

25 lines
507 B
GDScript

extends Node2D
var crateTotal=3
# 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(body: Variant,effect) -> void:
print("GC knows trigger..."+effect)
if body is Crate:
match effect:
"destroy":
crateTotal -=1
if crateTotal <=0:
print("you win")
body.queue_free()