big 4 objects, custom signal, game controller
This commit is contained in:
commit
afe089fdcd
16 files changed
+261
No files matched your search
@@ -0,0 +1,21 @@
|
||||
extends Node2D
|
||||
|
||||
|
||||
# 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_fired(intent: Variant, body) -> void:
|
||||
print("GC knows trigger fired " +intent)
|
||||
match intent:
|
||||
"destroy":
|
||||
print("destroy this thing")
|
||||
body.queue_free()
|
||||
"powerup":
|
||||
print("power up this thing")
|
||||
@@ -0,0 +1 @@
|
||||
uid://c546prectbgc7
|
||||
@@ -0,0 +1,15 @@
|
||||
extends Area2D
|
||||
|
||||
@export var intent = "destroy"
|
||||
|
||||
signal triggerFiredSignal(intent, body)
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
func _on_body_entered(body):
|
||||
print("trigger fired")
|
||||
triggerFiredSignal.emit(intent, body)
|
||||
@@ -0,0 +1 @@
|
||||
uid://pxfi4acsyvl0
|
||||
Reference in new issue
Block a user