godot-accessibility/player.gd
Nolan Darilek 744e2727db Enough changes to launch a basic game!
* Add an action to autoclose the dialog for setting keybindings after 5 seconds, thus allowing capturing keys to attach to actions.
 * Remove "Hello, world." from global script and move it into player.
 * Add commands to speak coordinates, headings, and to stop speech.
 * Add Quit command.
 * Announce new screen on change.
 * Other minor cleanups.
2019-09-05 09:01:20 -05:00

21 lines
712 B
GDScript3

extends Area2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
Globals.tts.speak("Hello, world.", true)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Input.is_action_just_pressed("speak_coordinates"):
Globals.tts.speak("%s, %s" % [position.x, position.y], true)
elif Input.is_action_just_pressed("speak_heading"):
Globals.tts.speak("%s degrees" % global_rotation_degrees, true)
elif Input.is_action_pressed("quit"):
get_tree().quit()
elif Input.is_action_pressed("stop_speech"):
Globals.tts.stop()