extends MovementComponent

## Deprecated
#export var flipped_sprite: bool = true

export var player_number: int = 1

#func process_physics(delta):
#	PlayerInfo.player_position = owner.global_position

# Return the desired direction of movement for the character
# in the range [-1, 1], where positive values indicate a desire
# to move to the right and negative values to the left.
func get_movement_direction() -> float:
	#return Input.get_axis('move_left', 'move_right')
	desired_movement_vector.x = Input.get_axis("move_left_" + str(player_number), "move_right_" + str(player_number))
	return Input.get_axis("move_left_" + str(player_number), "move_right_" + str(player_number))

# Return a boolean indicating if the character wants to jump
func wants_jump() -> bool:
	
	if Input.is_action_just_pressed("jump_" + str(player_number)):
		desired_movement_vector.y = 1
		return true
	else:
		return false

# Return a boolean indicating if the character wants to jump
func wants_shoot() -> bool:	
	if Input.is_action_just_pressed("shoot_" + str(player_number)):
		return true
	else:
		return false
