Add lever and jump pad components with activation logic
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user