Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
bug fix in game N
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasBielefeld committed Jul 27, 2017
1 parent 9cd3bf2 commit 13d722d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions app/src/main/assets/changelog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<h3>Ver. 2.2</h3>
<p>
- Added landscape support
- Added an entry in the settings to set a fixed orientation
- Added landscape support!<br>
- Added an entry in the settings to set a fixed orientation<br>
- Fixed an bug in Game N related to physical keyboard input
</p>

<h3>Ver. 2.1.1</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/de/tobiasbielefeld/brickgames/ui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 13d722d

Please sign in to comment.