22 lines
534 B
GDScript
22 lines
534 B
GDScript
class_name FloatingTextLabel
|
|
extends Label
|
|
|
|
var text_velocity : Vector2 = Vector2.ZERO
|
|
const SPEED = 52
|
|
|
|
func _ready() -> void:
|
|
tween_text()
|
|
|
|
|
|
func tween_text() -> void:
|
|
position = Vector2(0, 450)
|
|
var goal_position = Vector2(0.0,-3000.0)
|
|
var distance := position.distance_to(goal_position)
|
|
var tween_time := distance / SPEED
|
|
|
|
var tween = create_tween()
|
|
tween.tween_property(self, "position", goal_position, tween_time)
|
|
|
|
await get_tree().create_timer(38).timeout
|
|
get_tree().change_scene_to_file("res://star_animation.tscn")
|