Files
Super-Mario-Bros.-Remastere…/Scripts/Classes/Entities/Items/SuperMushroom.gd
John Cooper McDonald 568d45ee31 Change 1-up flagpole to replace the 5000 point bonus (#550)
* Change 1-up flagpole to replace the 5000 point bonus

* Also no 1-ups in you vs boo

* Update EndFlagpole.gd

* Style

* Update EndFlagpole.tscn
2025-10-18 14:42:51 +01:00

28 lines
750 B
GDScript

extends PowerUpItem
const MOVE_SPEED := 65
func _physics_process(delta: float) -> void:
$BasicEnemyMovement.handle_movement(delta)
func on_area_entered(area: Area2D) -> void:
if area.owner is Player:
if has_meta("is_poison"):
area.owner.damage()
queue_free()
elif has_meta("is_oneup"):
give_life(area.owner)
else:
collect_item(area.owner)
func give_life(_player: Player) -> void:
DiscoLevel.combo_amount += 1
AudioManager.play_sfx("1_up", global_position)
if [Global.GameMode.CHALLENGE, Global.GameMode.BOO_RACE].has(Global.current_game_mode) or Settings.file.difficulty.inf_lives:
Global.score += 2000
$ScoreNoteSpawner.spawn_note(2000)
else:
Global.lives += 1
$ScoreNoteSpawner.spawn_one_up_note()
queue_free()