Add test about gyroscope movement camera
This commit is contained in:
@@ -3,7 +3,10 @@ extends Node
|
||||
export (PackedScene) var about = load("res://scenes/UI/About.tscn")
|
||||
export (PackedScene) var scenes = load("res://scenes/UI/ChooseScene.tscn")
|
||||
|
||||
const max_diff = 0.08
|
||||
|
||||
var current_scene = null
|
||||
var value_old = Vector2(0, 0)
|
||||
|
||||
func _ready():
|
||||
print(tr("MESSAGE_READY"))
|
||||
@@ -12,6 +15,14 @@ func _ready():
|
||||
$Grid/Menu/Action/About.text = tr("MAIN_BUTTON_ABOUT")
|
||||
$Grid/Menu/Action/Quit.text = tr("MAIN_BUTTON_QUIT")
|
||||
|
||||
func _process(delta):
|
||||
var gyroscope = Input.get_gyroscope().abs()
|
||||
var value = Vector2(gyroscope[0], gyroscope[1])
|
||||
if value[0] > value_old[0] + max_diff and value[1] > value_old[1] + max_diff:
|
||||
print("[main#_process] " + String(value))
|
||||
|
||||
value_old = value
|
||||
|
||||
# Quit the game
|
||||
func _on_Quit_pressed():
|
||||
get_tree().quit(0)
|
||||
|
||||
Reference in New Issue
Block a user