- Edited
So my current project is sort of an asteroid style space shooter game where I want the player to be able fly around the map killing enemies and gathering resources. My character controller is very basic and moves the player along the x/y axis to move, very simple forward/back and left/right movement. I could keep it like that and just simply figure out how to have the player ship face the direction they are flying, however I feel the ability to rotate along the axis would be more aesthetically pleasing but also give the player greater control over where they are going/aiming.
Currently the code for the controller simply consists of:
func _process(delta):
if Input.is_action_pressed("A"):
self.position.x-= 10
if Input.is_action_pressed("D"):
self.position.x+= 10
if Input.is_action_pressed("W"):
self.position.y-= 10
if Input.is_action_pressed("S"):
self.position.y+= 10
if Input.is_action_pressed("Fire"):
var b = bullet.instance()
add_child(b)
lol just goes to show how new I still am to coding. Anyway how can I modify this to get the desired effect?