mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 07:28:14 +00:00
23 lines
524 B
GDScript
23 lines
524 B
GDScript
extends Block
|
|
const SPINNING_TURN_BLOCK = preload("uid://b8dalotrk2oci")
|
|
func on_block_hit(player: Player) -> void:
|
|
if item != null:
|
|
if mushroom_if_small:
|
|
item = player_mushroom_check(player)
|
|
dispense_item()
|
|
else:
|
|
spin()
|
|
|
|
func on_shell_block_hit(_shell: Shell) -> void:
|
|
if item != null:
|
|
dispense_item()
|
|
else:
|
|
spin()
|
|
|
|
func spin() -> void:
|
|
await get_tree().create_timer(0.15, false).timeout
|
|
var spinning = SPINNING_TURN_BLOCK.instantiate()
|
|
spinning.position = position
|
|
add_sibling(spinning)
|
|
queue_free()
|