static body, rigid body, character body, area2d, gamecontroller, custom signal

This commit is contained in:
OddlyTimbot committed 2025-06-02 20:57:07 -04:00
1 parent 66f92e9d59
commit e771dd5a61
10 files changed
+155

No files matched your search

+21
View File
@@ -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_areatrigger(effect, body) -> void:
print("Game controller knows about trigger")
if effect == "destroy":
print("Destroy this thing")
body.queue_free()
if effect == "powerup":
print("power up the player")
+1
View File
@@ -0,0 +1 @@
uid://dflv3rb4v8c0r
+19
View File
@@ -0,0 +1,19 @@
extends Area2D
@export var effect = "destroy"
signal areatrigger(effect, Object)
# 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_body_entered(body: Node2D) -> void:
print("Trigger entered")
#broadcast to controller
areatrigger.emit(effect, body)
+1
View File
@@ -0,0 +1 @@
uid://ixnbwhm0ptg5