diff --git a/bin/Tetris.apk b/bin/Tetris.apk index 2c6f07e..907527b 100644 Binary files a/bin/Tetris.apk and b/bin/Tetris.apk differ diff --git a/bin/classes.dex b/bin/classes.dex index 55fba63..496623f 100644 Binary files a/bin/classes.dex and b/bin/classes.dex differ diff --git a/bin/classes/mangavalk/tetris/CanvasView.class b/bin/classes/mangavalk/tetris/CanvasView.class index c1c2872..8e9b0ba 100644 Binary files a/bin/classes/mangavalk/tetris/CanvasView.class and b/bin/classes/mangavalk/tetris/CanvasView.class differ diff --git a/bin/dexedLibs/google-play-services_lib-0f09ee896a674b9292f9df3250c11de4.jar b/bin/dexedLibs/google-play-services_lib-0f09ee896a674b9292f9df3250c11de4.jar index 5061c21..bc5235c 100644 Binary files a/bin/dexedLibs/google-play-services_lib-0f09ee896a674b9292f9df3250c11de4.jar and b/bin/dexedLibs/google-play-services_lib-0f09ee896a674b9292f9df3250c11de4.jar differ diff --git a/bin/resources.ap_ b/bin/resources.ap_ index b49b2fa..94a837c 100644 Binary files a/bin/resources.ap_ and b/bin/resources.ap_ differ diff --git a/src/mangavalk/tetris/CanvasView.java b/src/mangavalk/tetris/CanvasView.java index e973dfb..05473c0 100644 --- a/src/mangavalk/tetris/CanvasView.java +++ b/src/mangavalk/tetris/CanvasView.java @@ -292,11 +292,11 @@ public class CanvasView extends View boolean GamePlaying = false; boolean GameOver = false; - final int GS_STOPPED = 0; - final int GS_LOADING = 1; - final int GS_PLAYING = 2; - final int GS_GAMEOVER = 3; - final int GS_PAUSED = 4; + final int GS_STOPPED = 0; + final int GS_LOADING = 1; + final int GS_PLAYING = 2; + final int GS_GAMEOVER = 3; + final int GS_PAUSED = 4; int GameState = GS_STOPPED; // Add Settings. @@ -1242,7 +1242,7 @@ public class CanvasView extends View { if (!GameOver) { - if (moveX >= 28 && moveX <= 55 && moveY >= 143 && moveY <= 155) // Menu + if (moveX >= 28 && moveX <= 55 && moveY >= 143 && moveY <= 155) // Start { if (GameState == GS_PLAYING) onPause(); @@ -1260,63 +1260,68 @@ public class CanvasView extends View { if (GameState == GS_PLAYING) { - if (!GameOver) + InputsGamePlaying(x, y, Released); + } + } + } + + private void InputsGamePlaying(float x, float y, boolean Released) + { + int moveX = (int)((x / Width) * 90); + int moveY = (int)((y / Height) * 160); + + if (!Released) + { + if (moveX >= 1 && moveX <= 11 && moveY >= 122 && moveY <= 133) // Left + { + if(CanBlockGoLeft()) { - if (!Released) + MoveBlockLeft(); + this.postInvalidate(); + } + } + else if (moveX >= 55 && moveX <= 70 && moveY >= 122 && moveY <= 137) // Rotate Left + { + RotateBlockLeft(); + this.postInvalidate(); + } + else if (moveX >= 74 && moveX <= 88 && moveY >= 115 && moveY <= 137) // Rotate Right + { + RotateBlockRight(); + this.postInvalidate(); + } + else if (moveX >= 21 && moveX <= 33 && moveY >= 122 && moveY <= 133) // Right + { + if(CanBlockGoRight()) + { + MoveBlockRight(); + this.postInvalidate(); + } + } + } + if (moveX >= 11 && moveX <= 21 && moveY >= 133 && moveY <= 144) // Down + { + if (!Released) + { + // Soft Drop + if (CanBlockGoDown()) + { + MoveBlockDown(); + this.postInvalidate(); + } + OldInputTime = (int)System.currentTimeMillis(); + } + else + { + int CurrentTime = (int)System.currentTimeMillis(); + if ((CurrentTime - OldInputTime) >= 250) + { + // Hard Drop + while (CanBlockGoDown()) { - if (moveX >= 1 && moveX <= 11 && moveY >= 122 && moveY <= 133) // Left - { - if(CanBlockGoLeft()) - { - MoveBlockLeft(); - this.postInvalidate(); - } - } - else if (moveX >= 55 && moveX <= 70 && moveY >= 122 && moveY <= 137) // Rotate Left - { - RotateBlockLeft(); - this.postInvalidate(); - } - else if (moveX >= 74 && moveX <= 88 && moveY >= 115 && moveY <= 137) // Rotate Right - { - RotateBlockRight(); - this.postInvalidate(); - } - else if (moveX >= 21 && moveX <= 33 && moveY >= 122 && moveY <= 133) // Right - { - if(CanBlockGoRight()) - { - MoveBlockRight(); - this.postInvalidate(); - } - } - } - if (moveX >= 11 && moveX <= 21 && moveY >= 133 && moveY <= 144) // Down - { - if (!Released) - { - // Soft Drop - if (CanBlockGoDown()) - { - MoveBlockDown(); - this.postInvalidate(); - } - OldInputTime = (int)System.currentTimeMillis(); - } - else - { - int CurrentTime = (int)System.currentTimeMillis(); - if ((CurrentTime - OldInputTime) >= 250) - { - // Hard Drop - while (CanBlockGoDown()) - { - MoveBlockDown(); - } - this.postInvalidate(); - } - } + MoveBlockDown(); } + this.postInvalidate(); } } }