You should be able to do it with code like this (not tested):
extends KinematicBody2D
const SPEED = 20
var movement_vector = Vector2()
func _physics_process(delta):
movement_vector = Vector2()
if Input.is_action_pressed("up"):
movement_vector.y = -1
if Input.is_action_pressed("down"):
movement_vector.y = 1
if Input.is_action_pressed("left"):
movement_vector.x = -1
if Input.is_action_pressed("right"):
movement_vector.x = 1
" Do whatever you need to do with the input. "
move_and_collide(movement_vector * SPEED * delta)
You can change the order of which action takes priority by changing the order of the input checking if statements.
The code above does not override the previous input though. For example, if you use the code above and are pressing down and then press up, the player will continue to move down since the down action always takes priority over the up action.
You could probably make a system that always overrides the previous input, but right off I'm not sure how to go about it without making a project and testing.