From 3817308e0c5b3eab85053efba79be2987f877c5d Mon Sep 17 00:00:00 2001 From: JonasDernedde Date: Mon, 24 Jan 2022 09:10:21 +0100 Subject: [PATCH] =?UTF-8?q?Linie=20L=C3=B6schen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/Tetris.iml | 2 +- .idea/aws.xml | 11 ++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 ++++ .idea/runConfigurations.xml | 10 -------- out/production/Tetris/Tetris/Board$1.class | Bin 705 -> 705 bytes out/production/Tetris/Tetris/Board.class | Bin 3658 -> 3658 bytes out/production/Tetris/Tetris/GameGui.class | Bin 2090 -> 3131 bytes src/Tetris/Stein.java | 28 +++++++++++++++++---- userhighscore.db | Bin 8192 -> 8192 bytes 9 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 .idea/aws.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/runConfigurations.xml 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 e79c06e6e427e43b36a45cb4e8f27c2c5ee52da1..97ac4b3c0e6fb95ec0a53b6d27cd11c7648ea4a8 100644 GIT binary patch delta 35 pcmX@edXRO4G83yC11E#~A{9zHr`i2L8bB)$K-t5n@D`RGns<84ApDLXvmp_+iP6 zv21o&HTR^=7whJaO$WA|33i<+vhr=$LODjsOT^9DJ)-R6Q;@(-n?vcU9?P#g%oGW6 z$~b4*bxxdsc`is%B14%hmmKL_R6pQ`D=OS6>r@eHw3VOSiWhz`kJ1WX$DXk?bl;1% aHTB+C7HP4CJ%li#4ZhXdzu&VlFQ41-}XXxZ%yF_I)mDbf^K;FLvbEYW9$U$SPJ zb+bp#Jdrm)Y??oI9N2Z{*mu$#$jENROH5Iggj=>p%yLY?iG=QksmPadRVMDZP$N#A z8P1sJoD3JN5|ZbV0#_VzO;vqe^N>dI>sM?~+jrg7m$v`?50w@&W&i*H diff --git a/out/production/Tetris/Tetris/GameGui.class b/out/production/Tetris/Tetris/GameGui.class index 20bd047bff9251e090882c0be4a3390b1e814d3e..e978cdbfa67ab509b2194640922a9c29a953f7d8 100644 GIT binary patch delta 1592 zcmaKs*>eL5lcy7#WIU9r~wUw3yBzr6NyX=ifbp+36soB$C=LN zHlm`q;WB~?g5rXTYeXVK6%RgIzWM0C;Hz)O^4yszNXmrjs&nqS_k3r$-?@FV?%eA9 zZ~vY>543a6VLg2|_uA}o2+S$RMW_AoBJIc`l@+=Jq{1@kTD;&c_hrE z4z&!}Jmyf3YmC7#LpBMARmOJk3~bn}MvT}Sw@HQ>HQ~o>QbwnZ$Qa=pF>dp?Lz79^ zNY?D+!URT7)Jx${m@H2^JjK%v&ycrycJ_Ra>ag6DqA@n=PP!3yDu{TKUM7fa9SV|u zCYHh%$D>OFx0xW(mH~z3O)9Rsl$W9=9=Jne zz3zCwJDBncRo0qN2m1=wS!Wtht$66!oUo=}2xWnHh=n^tl-?W%Huu zB@WoUta*i3HLvk{;h42C+`&Q38@yTg(`u@Ji?=le4rt!tkmfM&7FLGV<`46pVnx3f zWRtl_x1095Cz6`?4e|qyXg=hq<`_ri7RpYYzMD;GHnK_c5g#k6x};$*t2xdmin>nU z4{|})9q;vmy?!EBTg9h!d?xC1%?ZBHe92cfCpBO5P1xpJ&37C*wJ-Fm)#dO#KL{nw zm%6l;0Y_M#Rn)pgruw|>u%AtP3B{%oHTh`E(g7Bby3$P~7Bj85W|_PfV20HzmmHTO z>x$|TFNpj3iR_T4xT3jSM#>eob`FkuLxGG_T`@p$FFqqfmR3}F)5*Z*N6jgI*6g51 zin-{P%uM=YUL;l=L%CLWSUUH!Gm6X77cHA#gp8Q)kL4%Eg|8hM8Q-pyo6C7Q#qZ_b zih0WcOAKvyGl`U!Ycj}*@$yuc%9E+cj4a$)1ni#~_m(`&8{(HeHHW2~OM)+87hYaD zZ~`6c zxi6l{b1Z6QUZ)_UpiWaIpDgAJhpPU%x}oAMt+2VWp`xL3j<(q%V2j8>Ru>N1yYp@Q zEvf#IM7PTBZAI|B=-b7DdG27Vgl^>zI_Z++-OO<(+vI2K%FDb?!e?W`^ni0Ch5wJOBUy delta 573 zcmYk3%T5$Q6o$X<9;v1%mCS-@VnRq*jp&HXC<=;#En#We#L;#pk^yQiXlysvlfPZ&MD4o>MUzU zY}p07yJ+Q7hvKr&72AGP5!iUu$~7xvRzk&fO{2ZAo^hMG;ZwA6LUD8Td%=l6yF0ur zlkpF?t$m8fFwHGPmVJg6G7ia!U^bXfm*Q8COgYnWp`9`Le$ zmOF;K+>76Njmi5wFg&DeSm2Rik;m~@uc3F5Ck|T%!%C@GPUnNEFh5f?EZNGZJTp9J z+3c+JwYS iJBOr0iggatA$R0i;Rr|N`vZApr|c4P-X&g_V}Ag}mtBeg 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 8982bc85df0e692d43d8784c90c2e8ed132db9bf..64a249798c08a52d9833e6f1e8f0367ee4290152 100644 GIT binary patch delta 59 zcmZp0XmFSy&FDQ*#+lK3W5N=CW&!@J$?O8MEd0g%S(^<7ocM*=1(-!SJQDM&IQW^x PIlS`o5{oC-$~OZ5!5I$F delta 37 tcmZp0XmFSy&FDE%#+lJ`W5N=CW