2026-04-28 01:06:17 +00:00
|
|
|
class_name GameController extends Node2D
|
|
|
|
|
|
|
|
|
|
signal destroy(body)
|
2026-04-21 01:09:00 +00:00
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
|
get_window().grab_focus() # Replace with function body.
|
|
|
|
|
|
|
|
|
|
func _process(delta):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
func _on_area_2d_trigger_active_signal(body, intentMessage):
|
|
|
|
|
print("game controller received trigger")
|
2026-04-28 01:06:17 +00:00
|
|
|
if intentMessage == "destroy" and body.is_in_group("destructable"):
|
|
|
|
|
destroy.emit(body)
|
|
|
|
|
|
|
|
|
|
var crate_num : int = 0
|
|
|
|
|
func set_crate_num(count: int):
|
|
|
|
|
crate_num = count
|
|
|
|
|
print("number of crates: " + str(crate_num))
|
|
|
|
|
if crate_num <= 0:
|
|
|
|
|
print("You Win!")
|