Texpand/scenes/Main/control.gd

47 lines
1.2 KiB
GDScript

extends Control
@onready var buttonContainer1 = $HBoxContainer3
@onready var buttonContainer2 = $HBoxContainer4
@onready var buttonContainer3 = $HBoxContainer5
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
print(DisplayServer.mouse_get_position() != Vector2i())
if DisplayServer.mouse_get_position() == Vector2i():
buttonContainer1.show()
buttonContainer2.show()
buttonContainer3.show()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_left_button_pressed() -> void:
Input.action_press("left")
Input.action_release("left")
func _on_right_button_pressed() -> void:
Input.action_press("right")
Input.action_release("right")
func _on_rotate_left_button_pressed() -> void:
Input.action_press("rotate_left")
Input.action_release("rotate_left")
func _on_rotate_right_button_pressed() -> void:
Input.action_press("rotate_right")
Input.action_release("rotate_right")
func _on_down_button_button_down() -> void:
Input.action_press("down")
func _on_down_button_button_up() -> void:
Input.action_press("down")
Input.action_release("down")