2024-12-20 01:39:49 -05:00

36 lines
979 B
GDScript

class_name Santa extends Node3D
@onready var animator: AnimationPlayer = $AnimationPlayer
func _ready() -> void:
animator.play("Sit_Chair_Idle")
func dive(pos: Vector3, time: float) -> void:
animator.play("flip")
var posTween: Tween = get_tree().create_tween()
posTween.tween_property(self, "global_position", (pos + global_position) / 2 + Vector3(0, 50, 0), time)
await get_tree().create_timer(time / 2).timeout
posTween.kill()
posTween = get_tree().create_tween()
posTween.tween_property(self, "global_position", pos, time / 2)
await get_tree().create_timer(time - (time / 2) - 0.4).timeout
City.instance.animator.play("fadeOut")
await City.instance.animator.animation_finished
Sleigh.instance.cam.clear_current()
ChimneyGame.instance.startGame()
City.instance.animator.play_backwards("fadeOut")
animator.play("flip", -1, -10, true)
position = Vector3(0, 1.471, -1.092)
await animator.animation_finished
animator.play("Sit_Chair_Idle")