Add lever and jump pad components with activation logic

This commit is contained in:
2025-04-25 22:41:35 +02:00
parent 9b2ca61163
commit 8959fd4b9f
323 changed files with 12844 additions and 18 deletions

View File

@@ -6,9 +6,9 @@ var has_fade_away: bool = false
@export var area2d: Area2D
@export var collectable_data: CollectableResource
signal collected(amount: int)
func _ready() -> void:
if area2d:
area2d.body_entered.connect(_on_area2d_body_entered)
@@ -20,6 +20,7 @@ func _ready() -> void:
if root.has_node("FadeAwayComponent"):
has_fade_away = true
func _on_area2d_body_entered(body: Node2D) -> void:
if body.has_node("CanPickUpComponent"):
collected.emit(collectable_data.amount)