From 13d722dddcc83e75c1517f947f5f2fe891933100 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 27 Jul 2017 22:54:55 +0200 Subject: [PATCH] bug fix in game N --- app/src/main/assets/changelog.html | 5 +++-- .../java/de/tobiasbielefeld/brickgames/SharedData.java | 1 - .../java/de/tobiasbielefeld/brickgames/games/GameN.java | 5 +---- .../main/java/de/tobiasbielefeld/brickgames/ui/Main.java | 8 ++++++++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/main/assets/changelog.html b/app/src/main/assets/changelog.html index 2d1da4e..8349df4 100644 --- a/app/src/main/assets/changelog.html +++ b/app/src/main/assets/changelog.html @@ -1,7 +1,8 @@

Ver. 2.2

- - Added landscape support - - Added an entry in the settings to set a fixed orientation + - Added landscape support!
+ - Added an entry in the settings to set a fixed orientation
+ - Fixed an bug in Game N related to physical keyboard input

Ver. 2.1.1

diff --git a/app/src/main/java/de/tobiasbielefeld/brickgames/SharedData.java b/app/src/main/java/de/tobiasbielefeld/brickgames/SharedData.java index 6e1fee0..a0e575e 100644 --- a/app/src/main/java/de/tobiasbielefeld/brickgames/SharedData.java +++ b/app/src/main/java/de/tobiasbielefeld/brickgames/SharedData.java @@ -69,7 +69,6 @@ public class SharedData { public static SharedPreferences savedData; public static Random rand = new Random(); - public static DisplayMetrics metrics; public static LinearLayout.LayoutParams params; public static SharedPreferences.Editor edit; public static int[] soundList = new int[8]; diff --git a/app/src/main/java/de/tobiasbielefeld/brickgames/games/GameN.java b/app/src/main/java/de/tobiasbielefeld/brickgames/games/GameN.java index cb4c958..fb1bd33 100644 --- a/app/src/main/java/de/tobiasbielefeld/brickgames/games/GameN.java +++ b/app/src/main/java/de/tobiasbielefeld/brickgames/games/GameN.java @@ -260,10 +260,7 @@ private void onBreak() { for (int j = 0; j < BLOCK_DIMEN; j++) { //save current block on the field for (int i = 0; i < BLOCK_DIMEN; i++) { if (mNowBlock[i][j] != 0 && (X+i) > 0 && (Y+j) >= 0 && (X+i) < DIMENSION_WIDTH && (Y+j) < DIMENSION_HEIGHT) { - if (mTetrisField[X+i][Y+j] == 1) - sEvent = 4; - else - mTetrisField[X+i][Y+j] = 1; + mTetrisField[X+i][Y+j] = 1; } } } diff --git a/app/src/main/java/de/tobiasbielefeld/brickgames/ui/Main.java b/app/src/main/java/de/tobiasbielefeld/brickgames/ui/Main.java index 008522d..4d093c0 100644 --- a/app/src/main/java/de/tobiasbielefeld/brickgames/ui/Main.java +++ b/app/src/main/java/de/tobiasbielefeld/brickgames/ui/Main.java @@ -279,6 +279,14 @@ public boolean onKeyDown(int keyCode, KeyEvent event) { } if (pressedButtonID!=-1 && Game.sEvent == 0 && mPause!=1) { + + if (pressedButtonID<4) { + for (int i=0;i<4;i++){ + mButtonPressed[i]=0; + mButtonPressedCounter[i] = 0; + } + } + mButtonPressed[pressedButtonID] = 1; vibrate(); input = pressedButtonID + 1;