From f7d00a3381ae823ae98cbf6b758f05b3ce8d45e0 Mon Sep 17 00:00:00 2001 From: Exobyt Date: Tue, 20 Aug 2024 14:50:39 +0200 Subject: [PATCH] Fixed Bugs --- project.godot | 4 ---- scenes/Globals/global.gd | 4 ++-- scenes/Grid/grid.gd | 9 ++++++--- scenes/Main/control.gd | 12 +++--------- scenes/Main/main.gd | 1 + 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/project.godot b/project.godot index c28169d..4f3363a 100644 --- a/project.godot +++ b/project.godot @@ -88,10 +88,6 @@ down={ ] } -[input_devices] - -pointing/emulate_touch_from_mouse=true - [internationalization] locale/locale_filter_mode=0 diff --git a/scenes/Globals/global.gd b/scenes/Globals/global.gd index aba9705..e2d306e 100644 --- a/scenes/Globals/global.gd +++ b/scenes/Globals/global.gd @@ -28,7 +28,7 @@ var lastUID = 1 var currentUID = lastUID -var time = 60 +var time = 120 var lost = false @@ -42,7 +42,7 @@ func resetGame(): points = 0 lastUID = 0 currentUID = lastUID - time = 60 + time = 120 lost = false func _ready() -> void: diff --git a/scenes/Grid/grid.gd b/scenes/Grid/grid.gd index 39954ed..5f8438b 100644 --- a/scenes/Grid/grid.gd +++ b/scenes/Grid/grid.gd @@ -285,11 +285,14 @@ func testRows(): splitOphansUID(j.UID) if j.expand: GLOBAL.points += j.type * 2 - GLOBAL.time += j.type * 4 + GLOBAL.time += j.type elif not j.expand: GLOBAL.points += j.type - GLOBAL.time += j.type * 2 + GLOBAL.time += j.type j.queue_free() for j in getBlockGroupsList(): - if j != GLOBAL.currentUID: + if j != GLOBAL.currentUID: moveUidGroup(GLOBAL.Direction.BOTTOM, j) + +func toggleButton(): + $Camera2D/CanvasLayer/Control.toggleButton() diff --git a/scenes/Main/control.gd b/scenes/Main/control.gd index 31f31ff..72c2905 100644 --- a/scenes/Main/control.gd +++ b/scenes/Main/control.gd @@ -3,19 +3,13 @@ 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(): + +func toggleButton(): + if DisplayServer.is_touchscreen_available(): 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") diff --git a/scenes/Main/main.gd b/scenes/Main/main.gd index 084d4a5..5c78dbe 100644 --- a/scenes/Main/main.gd +++ b/scenes/Main/main.gd @@ -13,6 +13,7 @@ func loadGrid(): if $ScoreOverview != null: $ScoreOverview.queue_free() add_child(load("res://scenes/Grid/grid.tscn").instantiate()) + $Grid.toggleButton() func scoreOverview(): if $Grid != null: