From 5d4bd2b1f9425a1f8160089c13832627975843f5 Mon Sep 17 00:00:00 2001 From: fredboy Date: Thu, 9 May 2024 15:35:59 +0700 Subject: [PATCH] Higher touch resolution --- android/assets/json/texture_regions.json | 5 ++++ android/assets/json/touch_buttons.json | 23 ++++++++++++------ android/assets/touch_gui.png | Bin 6389 -> 6848 bytes .../ru/deadsoftware/cavedroid/CaveGame.java | 2 +- .../cavedroid/game/input/Joystick.kt | 4 +-- .../CloseGameWindowKeyboardInputHandler.kt | 2 +- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/android/assets/json/texture_regions.json b/android/assets/json/texture_regions.json index d071423..11459c3 100644 --- a/android/assets/json/texture_regions.json +++ b/android/assets/json/texture_regions.json @@ -41,6 +41,11 @@ "y": 26, "w": 26, "h": 26 + }, + "pause": { + "x": 104, + "w": 26, + "h": 26 } }, "allitems": { diff --git a/android/assets/json/touch_buttons.json b/android/assets/json/touch_buttons.json index 8111096..cbb9a15 100644 --- a/android/assets/json/touch_buttons.json +++ b/android/assets/json/touch_buttons.json @@ -1,16 +1,23 @@ { "alt": { - "x": -32, - "y": -32, - "w": 32, - "h": 32, + "x": -48, + "y": -48, + "w": 48, + "h": 48, "key": "L-Alt" }, "inv": { - "x": -64, - "y": -32, - "w": 32, - "h": 32, + "x": -96, + "y": -48, + "w": 48, + "h": 48, "key": "E" + }, + "pause": { + "x": -48, + "y": 0, + "w": 48, + "h": 48, + "key": "Escape" } } \ No newline at end of file diff --git a/android/assets/touch_gui.png b/android/assets/touch_gui.png index 83521da12644b16933cf94a6d54ab39827b4770b..62e4af5df547863ce2cb1ea1462b20073b347a96 100644 GIT binary patch delta 3141 zcmXw52{_bU7yr+YrN%NM%cqR8WFNDcnPkl}3@HX9OT1$uMne>(29t~>OSTje*|+S4 zL?uO;ic;TXU&fk{5TQRQpXloddoX@*uHaM}%hYis^3h)@4=D}tQ^456zJ*F|Cg00Bp! z@NhI9j)Uo=@dz9qh2cws3IzVI^S9pLizG6*k+utCI3_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CaveGame.java b/core/src/ru/deadsoftware/cavedroid/CaveGame.java index 0f9cf9e..1ba240c 100644 --- a/core/src/ru/deadsoftware/cavedroid/CaveGame.java +++ b/core/src/ru/deadsoftware/cavedroid/CaveGame.java @@ -42,7 +42,7 @@ public class CaveGame extends Game { } private void initConfig() { - int width = mTouch ? 320 : 480; + int width = 480; int height = (int) (width * ((float) Gdx.graphics.getHeight() / Gdx.graphics.getWidth())); mMainConfig.setMainComponent(mMainComponent); diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/Joystick.kt b/core/src/ru/deadsoftware/cavedroid/game/input/Joystick.kt index 4c04856..6cbc052 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/Joystick.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/Joystick.kt @@ -65,9 +65,9 @@ class Joystick( } companion object { - const val RADIUS = 24f + const val RADIUS = 48f const val SIZE = RADIUS * 2 - const val STICK_SIZE = 16f + const val STICK_SIZE = 32f } } \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt index b2d1244..6a8f019 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt @@ -19,7 +19,7 @@ class CloseGameWindowKeyboardInputHandler @Inject constructor( override fun checkConditions(action: KeyboardInputAction): Boolean { return action.actionKey is KeyboardInputActionKey.OpenInventory && - action.isKeyDown && gameWindowsManager.getCurrentWindow() != GameUiWindow.NONE + !action.isKeyDown && gameWindowsManager.getCurrentWindow() != GameUiWindow.NONE } override fun handle(action: KeyboardInputAction) { -- 2.29.2