Add pause menu functionality and update collectable nodes with collision shapes

This commit is contained in:
2025-05-03 15:10:50 +02:00
parent e286908e46
commit 9dabff474d
12 changed files with 249 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ var root: Node
var has_fade_away: bool = false
@export var area2d: Area2D
@export var collision_shape: CollisionShape2D
@export var collectable_data: CollectableResource
@export var sfx: AudioStreamPlayer2D
signal collected(amount: int, type: CollectableResource.CollectableType)
@@ -25,6 +26,8 @@ func _ready() -> void:
func _on_area2d_body_entered(body: Node2D) -> void:
if body.has_node("CanPickUpComponent"):
collected.emit(collectable_data.amount, collectable_data.type)
if collision_shape:
collision_shape.call_deferred("set_disabled", true)
if sfx:
sfx.play()
if not has_fade_away: