add falling block
This commit is contained in:
parent
d6547b61d4
commit
54f0880864
20 changed files with 153 additions and 26 deletions
23
objects/environment/turniwood/turniwood.gd
Normal file
23
objects/environment/turniwood/turniwood.gd
Normal file
|
@ -0,0 +1,23 @@
|
|||
extends Node2D
|
||||
onready var anims = $AnimationPlayer
|
||||
onready var timer = $Timer
|
||||
export var time:float = 60
|
||||
export(int, "Wood", "Yellow") var color
|
||||
onready var time_frames = time * 0.0166666666666667 # Time is converted from ms to frames @ 60fps
|
||||
|
||||
func _ready():
|
||||
#Autostart animationplayer
|
||||
anims.play("idle")
|
||||
timer.set_wait_time(time_frames)
|
||||
timer.start()
|
||||
|
||||
|
||||
func _on_AnimationPlayer_animation_finished(anim_name):
|
||||
#Return to idle after turn animation
|
||||
if anim_name == "turn":
|
||||
anims.play("idle")
|
||||
timer.set_wait_time(time_frames)
|
||||
|
||||
|
||||
func _on_Timer_timeout():
|
||||
anims.play("turn")
|
Loading…
Add table
Add a link
Reference in a new issue