diff --git a/.idea/Tetris.iml b/.idea/Tetris.iml index 70c8c92..17a9d40 100644 --- a/.idea/Tetris.iml +++ b/.idea/Tetris.iml @@ -10,7 +10,7 @@ - + diff --git a/.idea/aws.xml b/.idea/aws.xml new file mode 100644 index 0000000..b63b642 --- /dev/null +++ b/.idea/aws.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/out/production/Tetris/Tetris/Board$1.class b/out/production/Tetris/Tetris/Board$1.class index e79c06e..97ac4b3 100644 Binary files a/out/production/Tetris/Tetris/Board$1.class and b/out/production/Tetris/Tetris/Board$1.class differ diff --git a/out/production/Tetris/Tetris/Board.class b/out/production/Tetris/Tetris/Board.class index 59105a7..bff153a 100644 Binary files a/out/production/Tetris/Tetris/Board.class and b/out/production/Tetris/Tetris/Board.class differ diff --git a/out/production/Tetris/Tetris/GameGui.class b/out/production/Tetris/Tetris/GameGui.class index 20bd047..e978cdb 100644 Binary files a/out/production/Tetris/Tetris/GameGui.class and b/out/production/Tetris/Tetris/GameGui.class differ diff --git a/src/Tetris/Stein.java b/src/Tetris/Stein.java index 6854ce7..87d83be 100644 --- a/src/Tetris/Stein.java +++ b/src/Tetris/Stein.java @@ -56,6 +56,7 @@ public class Stein { } } } + linieLöschen(); board.setCurrenStein(); return; } @@ -91,18 +92,35 @@ public class Stein { } } } - if (!collision) { + if (!collision) { y++; + } + } + else { + collision = true; } - - } else { - collision = true; - } beginTime = System.currentTimeMillis(); } } + +public void linieLöschen(){ + int bollomLine = board.getBoard().length - 1; + for(int topLine = board.getBoard().length - 1; topLine > 0; topLine--){ + int anZahl = 0; + for(int col = 0; col < board.getBoard()[0].length; col++){ + if(board.getBoard()[topLine][col] != null) { + anZahl++; + } + board.getBoard()[bollomLine][col] = board.getBoard()[topLine][col]; + } + if(anZahl < board.getBoard()[0].length){ + bollomLine--; + } + } +} + public void render(Graphics g){ for(int row=0;row< coords.length;row++){ for(int col = 0;col< coords[0].length;col++){ diff --git a/userhighscore.db b/userhighscore.db index 8982bc8..64a2497 100644 Binary files a/userhighscore.db and b/userhighscore.db differ