A good starting point would be to give your player a variable that determines its facing direction. You can use Vector2 to do this:
var facing_direction: Vector2 = Vector2.ZERO
func _physics_process():
# reset facing direction
facing_direction = Vector2.ZERO
# get facing direction from inputs
if Input.is_action_pressed("move_left"): facing_direction += Vector2.LEFT
if Input.is_action_pressed("move_right"): facing_direction += Vector2.RIGHT
if Input.is_action_pressed("move_up"): facing_direction += Vector2.UP
if Input.is_action_pressed("move_down" ): facing_direction += Vector2.DOWN
Then, when you press the shoot button, you can instantiate a projectile on the player and set its velocity to the player’s facing_direction multiplied by the projectile’s movement speed. If you do it this way, projectiles will only ever travel in 8 directions.