20 lines
538 B
GDScript
20 lines
538 B
GDScript
extends Node
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
pass # Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
var v = $Player.velocity
|
|
var hvel = sqrt(v.x ** 2 + v.z ** 2)
|
|
var vvel = v.y
|
|
$Speed.text = 'Speed: %6.2f, %6.2f' % [hvel * 16, vvel * 16]
|
|
|
|
|
|
func _input(event: InputEvent):
|
|
if event is InputEventKey:
|
|
if event.keycode == KEY_F1 and not event.pressed:
|
|
$Mapentities.visible = not $Mapentities.visible
|