2026-04-28 01:07:56 +00:00
|
|
|
class_name GameController extends Node2D
|
2026-04-27 22:27:47 +00:00
|
|
|
|
2026-04-28 01:07:56 +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!")
|
2026-04-28 01:07:56 +00:00
|
|
|
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")
|