diff --git a/scripts/notification_display.gd b/scripts/notification_display.gd index e310866..2150af8 100644 --- a/scripts/notification_display.gd +++ b/scripts/notification_display.gd @@ -44,12 +44,20 @@ func show_notification(weapon_name: String, player_node: Node2D, player_sprite_s position.y = target_pos.y - 10.0 modulate.a = 0.0 + # Create connector line immediately so it fades in with the notification + _connector_line = Line2D.new() + _connector_line.default_color = Color(1.0, 1.0, 1.0, 0.0) + _connector_line.width = 1.0 + add_child(_connector_line) + _connector_visible = true + # Pause following during fade-in so the tween isn't overridden by _process _follow_player = false - # Fade in and slide into position with overshoot + # Fade in notification and connector together, slide into position with overshoot var tween = create_tween().set_parallel() tween.tween_property(self, "modulate:a", 1.0, 0.3) + tween.tween_property(_connector_line, "default_color:a", 1.0, 0.3) var move_tween = tween.tween_property(self, "position:y", target_pos.y, 0.3) move_tween.set_trans(Tween.TRANS_ELASTIC).set_ease(Tween.EASE_OUT) @@ -57,13 +65,6 @@ func show_notification(weapon_name: String, player_node: Node2D, player_sprite_s await tween.finished _follow_player = true - # Create connector line from notification to player origin - _connector_line = Line2D.new() - _connector_line.default_color = Color.WHITE - _connector_line.width = 1.0 - add_child(_connector_line) - _connector_visible = true - # Stay fully visible for a moment before fading await get_tree().create_timer(0.5).timeout