mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-12-05 19:20:19 -08:00
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:
parent
c41d6fda47
commit
0e09331e1a
2 changed files with 2 additions and 10 deletions
|
|
@ -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="."]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue