forked from team-sg/hero-mark-2
camera now has scroll direction toggles
This commit is contained in:
parent
48cc1d43d6
commit
c60375cb98
11 changed files with 202 additions and 70 deletions
|
@ -1,13 +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):
|
||||
#When idling is done, turn
|
||||
if anim_name == "idle":
|
||||
anims.play("turn")
|
||||
#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