Make Yoshi Eggs award score / collection status immediately (#714)

* Make Yoshi Egg award collection status + points immediately, and have the score note be decorative

* Removed gave_points var
This commit is contained in:
jdaster64 2025-11-22 11:39:08 -05:00 committed by GitHub
parent c41d6fda47
commit 0e09331e1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 10 deletions

View file

@ -375,7 +375,6 @@ autoplay = "new_animation"
[node name="ScoreNoteSpawner" type="Node" parent="."]
script = ExtResource("4_f5bm0")
add_score = true
metadata/_custom_type_script = "uid://5octqlf4ohel"
[node name="YoshiHatch" type="AudioStreamPlayer2D" parent="."]

View file

@ -1,14 +1,13 @@
extends CharacterBody2D
var gave_points := false
func _ready() -> void:
AudioManager.play_sfx("item_appear", global_position)
Global.score += 5000
ChallengeModeHandler.set_value(ChallengeModeHandler.CoinValues.YOSHI_EGG, true)
velocity.y = -150
$Egg.play(["Green", "Yellow", "Red", "Blue"][Global.level_num - 1])
$Yoshi.play(["Green", "Yellow", "Red", "Blue"][Global.level_num - 1])
await get_tree().create_timer(1.5, false).timeout
ChallengeModeHandler.set_value(ChallengeModeHandler.CoinValues.YOSHI_EGG, true)
func _physics_process(delta: float) -> void:
velocity.y += (Global.entity_gravity / delta) * delta
@ -16,15 +15,9 @@ func _physics_process(delta: float) -> void:
move_and_slide()
func show_smoke() -> void:
gave_points = true
var smoke = preload("res://Scenes/Prefabs/Particles/SmokeParticle.tscn").instantiate()
smoke.scale = Vector2(2, 2)
smoke.global_position =global_position
add_sibling(smoke)
$ScoreNoteSpawner.spawn_note(5000)
queue_free()
func _exit_tree() -> void:
if gave_points == false:
ChallengeModeHandler.set_value(ChallengeModeHandler.CoinValues.YOSHI_EGG, true)
Global.score += 5000