AprilGame/Scripts/gameController.gd

23 lines
673 B
GDScript3
Raw Normal View History

class_name GameController extends Node2D
2026-04-27 22:27:47 +00:00
signal destroySignal(body)
2026-04-27 22:27:47 +00:00
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
get_window().grab_focus()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_triggerSignal(body: Variant, intentMessage: Variant) -> void:
print("GC knows about a trigger!")
if body.is_in_group("Destructable") and intentMessage == "destroy":
destroySignal.emit(body)
func totalCrates(numberOfCrates:int)->void:
print("GC of crates"+str(numberOfCrates))
if numberOfCrates <=0:
print("You won. yay I am so happy for you. you")