diff --git a/scripts/level_up_manager.gd b/scripts/level_up_manager.gd index 725e4d3..a5d6dbf 100644 --- a/scripts/level_up_manager.gd +++ b/scripts/level_up_manager.gd @@ -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() diff --git a/scripts/perk_card.gd b/scripts/perk_card.gd index 3dea693..36e1295 100644 --- a/scripts/perk_card.gd +++ b/scripts/perk_card.gd @@ -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():