Initial Commit
This commit is contained in:
26
Game.gd
Normal file
26
Game.gd
Normal file
@@ -0,0 +1,26 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user