mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
24 lines
546 B
GDScript
24 lines
546 B
GDScript
extends Enemy
|
|
|
|
@export var held_scene: PackedScene = null
|
|
|
|
func stomped_on(player: Player) -> void:
|
|
player.enemy_bounce_off()
|
|
AudioManager.play_sfx("enemy_stomp", global_position)
|
|
summon_held()
|
|
|
|
func summon_held() -> Node:
|
|
var node = held_scene.instantiate()
|
|
node.global_position = global_position
|
|
node.direction = direction
|
|
if $TrackJoint.is_attached:
|
|
get_parent().owner.add_sibling(node)
|
|
else:
|
|
add_sibling(node)
|
|
queue_free()
|
|
return node
|
|
|
|
func fireball_hit(fireball: Node2D) -> void:
|
|
var held = summon_held()
|
|
held.kick(fireball)
|