Skip to content

Commit

Permalink
fix:laser beam direction
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed Aug 25, 2024
1 parent efb6d19 commit 245b50c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions scenes/bullets/star_wrath/laser_beam.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion scenes/weapons/star_wrath/star_wrath.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 245b50c

Please sign in to comment.