Fix not being able to collect Red Coins from bumping blocks (#672)

This commit is contained in:
John Cooper McDonald 2025-10-25 14:15:03 -05:00 committed by GitHub
parent bb3ece8922
commit 2cb9675227
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 4 deletions

View file

@ -8,6 +8,8 @@ var can_spawn_particles := false
@onready var COIN_SPARKLE = load("res://Scenes/Prefabs/Particles/RedCoinSparkle.tscn")
signal collected
func _ready() -> void:
if ChallengeModeHandler.is_coin_collected(id):
already_collected = true
@ -16,9 +18,10 @@ func _ready() -> void:
func on_area_entered(area: Area2D) -> void:
if area.owner is Player:
collected()
collect()
func collected() -> void:
func collect() -> void:
collected.emit()
if already_collected:
AudioManager.play_sfx("coin", global_position, 2)
else: