mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-26 17:30:54 +00:00
Fix not being able to collect Red Coins from bumping blocks (#672)
This commit is contained in:
committed by
GitHub
parent
bb3ece8922
commit
2cb9675227
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user