Added introductory touchscreen support for mobile devices.
This commit is contained in:
parent
df13ee42d8
commit
4c512379c5
34 changed files with 697 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ const ROWS: int = 3
|
|||
|
||||
@onready var start_button = $CanvasLayer/CenterContainer/Start
|
||||
@onready var game_over = $CanvasLayer/CenterContainer/GameOver
|
||||
@onready var virtual_controls = $CanvasLayer/VirtualControls
|
||||
|
||||
func _ready():
|
||||
game_over.hide()
|
||||
|
|
@ -29,6 +30,7 @@ func _ready():
|
|||
EventBus.flash_screen.connect(_on_flash_screen)
|
||||
EventBus.win_game.connect(_on_win_game)
|
||||
EventBus.secret_win_game.connect(_on_secret_win_game)
|
||||
virtual_controls.hide()
|
||||
|
||||
|
||||
#func spawn_enemies():
|
||||
|
|
@ -139,6 +141,12 @@ func new_game():
|
|||
|
||||
|
||||
func _input(EventInput):
|
||||
|
||||
if EventInput is InputEventScreenTouch:
|
||||
if EventInput.pressed:
|
||||
virtual_controls.show()
|
||||
|
||||
|
||||
if EventInput.is_action_pressed("shoot") and playing == false:
|
||||
print("Input detected!")
|
||||
start_button.hide()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue