23 lines
673 B
GDScript
23 lines
673 B
GDScript
class_name GameController extends Node2D
|
|
|
|
signal destroySignal(body)
|
|
|
|
# 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")
|