DEADSOFTWARE

Higher touch resolution
authorfredboy <fredboy@protonmail.com>
Thu, 9 May 2024 08:35:59 +0000 (15:35 +0700)
committerfredboy <fredboy@protonmail.com>
Thu, 9 May 2024 08:35:59 +0000 (15:35 +0700)
android/assets/json/texture_regions.json
android/assets/json/touch_buttons.json
android/assets/touch_gui.png
core/src/ru/deadsoftware/cavedroid/CaveGame.java
core/src/ru/deadsoftware/cavedroid/game/input/Joystick.kt
core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt

index d0714239ccdd839e0fbd2408c06efc99d2125c1f..11459c3b2c601bfdd5ad98f15c7e98d0e492dbba 100644 (file)
       "y": 26,
       "w": 26,
       "h": 26
+    },
+    "pause": {
+      "x": 104,
+      "w": 26,
+      "h": 26
     }
   },
   "allitems": {
index 81110960852f4d23dcf725050beab9a746a98634..cbb9a151f2b4cdb9fba1096c3ddf820b411399ef 100644 (file)
@@ -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
index 83521da12644b16933cf94a6d54ab39827b4770b..62e4af5df547863ce2cb1ea1462b20073b347a96 100644 (file)
Binary files a/android/assets/touch_gui.png and b/android/assets/touch_gui.png differ
index 0f9cf9ed11fe827ae38dc784ddc1da9be322a18c..1ba240c5a60808e38e6100e0d66f9d0b905f5bfc 100644 (file)
@@ -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);
index 4c04856b61fb84f135871269502c62124d0f2264..6cbc0526014d3f187e8e1ae8f0190dbcb52a43bf 100644 (file)
@@ -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
index b2d1244aa91dbc0a903142733a8e58921d645111..6a8f019f68dd70e17b0bac61fdbd0a58b6c1e63b 100644 (file)
@@ -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) {