smoother card hover and perk screen exit transition

main
Artur David 2026-06-02 09:25:16 +02:00
parent 5876fe992c
commit e07519ba05
2 changed files with 6 additions and 4 deletions

View File

@ -54,10 +54,13 @@ func select_perk(perk):
_spawn_level_up_particles(get_node("/root/Game/Witch").global_position)
_spawn_level_up_particles(get_node("/root/Game/Player").global_position)
perks.erase(perk)
for child in $HBoxContainer.get_children(): child.queue_free()
for child in $HBoxContainer.get_children():
child.animate_out()
var tween = create_tween()
tween.tween_property($ColorRect, "color:a", 0.0, 0.3)
tween.tween_property($ColorRect, "color:a", 0.0, 0.4)
await tween.finished
for child in $HBoxContainer.get_children():
child.queue_free()
func _spawn_level_up_particles(pos: Vector2) -> void:
var p = _particles_scene.instantiate()

View File

@ -148,8 +148,7 @@ func animate_in():
if not is_instance_valid(self):
return
_hover_tween = create_tween().set_loops()
_hover_tween.tween_property(self, "position:y", rest_y - 5.0, 1.0).set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_SINE)
_hover_tween.tween_property(self, "position:y", rest_y, 1.0).set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_SINE)
_hover_tween.tween_method(func(t: float): position.y = rest_y + sin(t * TAU) * 5.0, 0.0, 1.0, 2.0)
func animate_out():