mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 23:48:11 +00:00
added the game
This commit is contained in:
21
Scripts/Parts/BlockAnimations.gd
Normal file
21
Scripts/Parts/BlockAnimations.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user