final score 3d text is loaded during fade in to make performance issues on MY PC less noticeable
This commit is contained in:
parent
6111fec2d9
commit
28c5dd991d
1 changed files with 8 additions and 4 deletions
|
@ -13,8 +13,15 @@ onready var life_bonus_score = $ShardsAndBonuses/Bonuses/LifeBonus/LifeBonusScor
|
|||
onready var arrow_bonus_score = $ShardsAndBonuses/Bonuses/ArrowBonus/ArrowBonusScore
|
||||
onready var perfect_bonus_score = $ShardsAndBonuses/Bonuses/PerfectBonus/PerfectBonusScore
|
||||
const Text3D = preload("res://objects/hud/3d_text.tscn")
|
||||
var text_3d = null
|
||||
|
||||
func _ready() -> void:
|
||||
#preload final score
|
||||
text_3d = Text3D.instance()
|
||||
text_3d.anim = "final score"
|
||||
yield(get_tree(), "idle_frame")
|
||||
self.add_child(text_3d)
|
||||
text_3d.animation_player.set_speed_scale(0)
|
||||
Fade.fade_in(0.4)
|
||||
# fill in shard names
|
||||
var level: LevelEntry = LevelData.levels[Game.current_level]
|
||||
|
@ -37,10 +44,7 @@ func _physics_process(delta: float) -> void:
|
|||
|
||||
func final_score():
|
||||
animation_player.set_speed_scale(2)
|
||||
var text_3d = Text3D.instance()
|
||||
text_3d.anim = "final score"
|
||||
yield(get_tree(), "idle_frame")
|
||||
self.add_child(text_3d)
|
||||
text_3d.animation_player.set_speed_scale(1)
|
||||
|
||||
|
||||
func _on_AnimationPlayer_animation_finished(anim_name):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue