Added animation to help anticipate turning block turning
This commit is contained in:
parent
56e56a5cff
commit
3a8e9b757c
4 changed files with 48 additions and 14 deletions
|
@ -3,20 +3,22 @@ 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
|
||||
onready var time_ms = time * 0.0166666666666667 # Time is converted from frames @ 60fps to ms
|
||||
|
||||
func _ready():
|
||||
#Autostart animationplayer
|
||||
anims.play("idle")
|
||||
timer.set_wait_time(time_frames)
|
||||
timer.start()
|
||||
timer.start(time_ms)
|
||||
|
||||
func _physics_process(delta):
|
||||
pass
|
||||
#Debug.print(timer.)
|
||||
|
||||
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)
|
||||
timer.start(time_ms)
|
||||
|
||||
|
||||
func _on_Timer_timeout():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue