Fix Waves' Angles

main
Luna Brovchuk 2023-10-01 22:28:47 +02:00
parent dc3af8c23a
commit 7afd0874e8
2 changed files with 2 additions and 4 deletions

View File

@ -53,6 +53,7 @@ func _physics_process(delta):
func _shoot(): func _shoot():
sonic_wave = sonic_wave_preload.instance() sonic_wave = sonic_wave_preload.instance()
sonic_wave.angle = global_position.angle_to_point(player.global_position)
get_parent().add_child(sonic_wave) get_parent().add_child(sonic_wave)
sonic_wave.global_position.x = self.global_position.x + 8 sonic_wave.global_position.x = self.global_position.x + 8
sonic_wave.global_position.y = self.global_position.y + 8 sonic_wave.global_position.y = self.global_position.y + 8

View File

@ -5,9 +5,6 @@ var speed = 120
onready var player = $"../../Player" onready var player = $"../../Player"
var angle var angle
func _ready():
angle = global_position.angle_to_point(player.global_position)
func _physics_process(delta): func _physics_process(delta):
$Sprite.rotation_degrees = rad2deg(angle + PI) $Sprite.rotation_degrees = rad2deg(angle + PI)
move_and_slide(Vector2(speed, 0).rotated(angle + PI)) move_and_collide(Vector2(speed, 0).rotated(angle + PI) * delta)