From 245b50c35288715047e68568096696b87400fd8b Mon Sep 17 00:00:00 2001 From: limuy Date: Sun, 25 Aug 2024 19:04:45 +0800 Subject: [PATCH] fix:laser beam direction --- scenes/bullets/star_wrath/laser_beam.gd | 3 +++ scenes/weapons/star_wrath/star_wrath.gd | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scenes/bullets/star_wrath/laser_beam.gd b/scenes/bullets/star_wrath/laser_beam.gd index 2a860a2..1f6c557 100644 --- a/scenes/bullets/star_wrath/laser_beam.gd +++ b/scenes/bullets/star_wrath/laser_beam.gd @@ -41,6 +41,9 @@ func init(pos: Vector2): # 设置激光的方向 func set_direct(direct_arg: Vector2) -> void: self.direct = direct_arg.normalized() + var rad = direct.y / direct.x + # 激光的角度 + beam_particles.rotation = rad func cast_beam(): diff --git a/scenes/weapons/star_wrath/star_wrath.gd b/scenes/weapons/star_wrath/star_wrath.gd index 6dd65b1..31360f2 100644 --- a/scenes/weapons/star_wrath/star_wrath.gd +++ b/scenes/weapons/star_wrath/star_wrath.gd @@ -31,7 +31,7 @@ func beam_shoot1(): beam.init(Vector2(200, 450)) beam.set_is_casting(true) beam.set_direct(beam.to_local(Vector2(300, 450))) - await get_tree().create_timer(10.0).timeout + await get_tree().create_timer(3.0).timeout beam.set_is_casting(false)