mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 07:28:14 +00:00
22 lines
510 B
GDScript
22 lines
510 B
GDScript
extends Node2D
|
|
|
|
func _ready() -> void:
|
|
set_process(false)
|
|
if owner is Block:
|
|
$Joint.remote_path = $Joint.get_path_to(owner.visuals)
|
|
|
|
func _process(_delta: float) -> void:
|
|
owner.visuals.z_index = z_index
|
|
|
|
func bounce_block() -> void:
|
|
set_process(true)
|
|
owner.visuals.show()
|
|
owner.visuals.z_index = 3
|
|
owner.get_parent().move_child(owner, -1)
|
|
owner.bouncing = true
|
|
$Animations.play("BlockHit")
|
|
await $Animations.animation_finished
|
|
owner.visuals.z_index = 0
|
|
owner.bouncing = false
|
|
set_process(false)
|