diff --git a/scenes/bullets/seedler/seedler_nut.gd b/scenes/bullets/seedler/seedler_nut.gd index 05c1a8b..006356d 100644 --- a/scenes/bullets/seedler/seedler_nut.gd +++ b/scenes/bullets/seedler/seedler_nut.gd @@ -1,6 +1,12 @@ extends Area2D +const WIDTH = 8 @export var thorns: PackedScene +var alpha: float +var line1_from: Vector2 +var line1_to: Vector2 +var line2_from: Vector2 +var line2_to: Vector2 # 启动投掷动作 @@ -96,18 +102,10 @@ func super_burst(pos: Vector2): tween.tween_callback(queue_free) -var alpha: float -var line1_from: Vector2 -var line1_to: Vector2 -var line2_from: Vector2 -var line2_to: Vector2 -const width = 8 - - func _draw(): var yellow = Color(Color.GOLD, alpha) - draw_line(line1_from, line1_to, yellow, width) - draw_line(line2_from, line2_to, yellow, width) + draw_line(line1_from, line1_to, yellow, WIDTH) + draw_line(line2_from, line2_to, yellow, WIDTH) func super_burst_shot_beam(): diff --git a/scenes/weapons/seedler/seedler.gd b/scenes/weapons/seedler/seedler.gd index ee89328..3f4786a 100644 --- a/scenes/weapons/seedler/seedler.gd +++ b/scenes/weapons/seedler/seedler.gd @@ -2,9 +2,9 @@ extends Sprite2D signal attack_finished const TIMES = 5 +@export var beam: PackedScene @onready var path = $"../Path2D" @onready var follow = $"../Path2D/PathFollow2D" -@export var beam: PackedScene func move(length: float) -> void: