extends Node3D


@onready var label : Label = $CanvasLayer/Label
@onready var player : CharacterBody3D = $PlayerQ3


func _ready():
	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)


func _process(delta):
	label.text = "H Velocity: %3.2f" % [Vector2(player.velocity.x, player.velocity.z).length()]
	label.text += "\nV Velocity: %3.2f" % [player.velocity.y]
	label.text += "\nOn floor: %s" % player.is_on_floor()


func _input(event):
	if event is InputEventKey and event.is_pressed():
		if event.keycode == KEY_F:
			if !DisplayServer.window_get_mode():
				DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
			else:
				DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
		elif event.keycode == KEY_ESCAPE:
			get_tree().quit()
