mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-23 07:58:09 +00:00
added the game
This commit is contained in:
27
Scripts/Classes/Entities/Items/SuperMushroom.gd
Normal file
27
Scripts/Classes/Entities/Items/SuperMushroom.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
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.current_game_mode == Global.GameMode.CHALLENGE or Settings.file.difficulty.inf_lives:
|
||||
Global.score += 2000
|
||||
$ScoreNoteSpawner.spawn_note(2000)
|
||||
else:
|
||||
$ScoreNoteSpawner.spawn_one_up_note()
|
||||
Global.lives += 1
|
||||
queue_free()
|
Reference in New Issue
Block a user