From 8d0ab1bf7b2166b7f327021eced3119ec62d8c48 Mon Sep 17 00:00:00 2001 From: zhe Date: Mon, 22 Nov 2021 12:52:03 +0100 Subject: [PATCH] Stein bewegen sich im Rahmen des Spielfelds --- out/production/Tetris/Tetris/Board$1.class | Bin 1116 -> 1230 bytes out/production/Tetris/Tetris/Board.class | Bin 2726 -> 3267 bytes out/production/Tetris/Tetris/GameGui.class | Bin 2374 -> 2374 bytes src/Tetris/Board.java | 11 ++++++++--- src/Tetris/GameGui.java | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/out/production/Tetris/Tetris/Board$1.class b/out/production/Tetris/Tetris/Board$1.class index 779abc71b9a7159c129024461ab42972d6874b73..b4a4e198cc7e5831f3f352b4eac1c9956ed4f9aa 100644 GIT binary patch delta 677 zcmZ9KO>Yu$5XOJI&;rXUs1>!?O0kwwT3KFN+M<2+r6L|oYO3J^sU+4IX@Ka#LlcQ7 zkL%6Ei=TkR7~-KPPagaPCVmhT;|v(vxSKpP^UO2<>@)lS;r||Z^zHYTLm%JW8G$hbsw8HH@InYi`zC^D!8Li;;v1ZW%sL5am(ho`_>GuWgN%As_pL9 zTdm2g7V+uwcD>!)Yo#|DwdUhuvQjBOt-YwFYcJdB&Bn7vvv@S&xLtF?lX0@{m{~A# z?gKLx%^yE<-dQ|S=R`d+UrLq?e9iiPZSQ%Tm~1GF!6{5xo*090SY1k`OoVgNJ?}1f zVh0zbw)*T80TPV%`>F~NWlW-GI%~)~&Ly1`?kC>!XA=ctDK8*Q`t*jh*St^rBu1NIC P{Yh|9GD~zJiSqmbY@X z1U`2tDP|P2iaAAD5h^N*NKy5udCYq(9KI--wMEM?b<0IASq2&MxNEt`lI1?jmItg@ z9x5IwR(WiBqF7V8&W2@^dVFkN#)&f@SDZp;%i!0o<;7Z%wXP&% z+%|36(l({(d-JJZn0#TTFEfo3nVB-lxAsGSLjOSf8&W3ib9Sv4Ky;9;d+xdSyr1V> z{o}L0egfcSycb6di?S4CS(3$(<(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%Li4&I-DlR7yT~1h%2bq(wByFSi8_FmF*TeTv5;lTH&Ce+H6%YvfAD}Fu zl|DduLYqf0o+xptUnmvNpo+^X9xtFG94J5!YXzuq$ak}VRbivGfXZ;!b3*Sdo zVjjkQgc3|xeGjV(sG+fD0c&o%MIIy#vq<12lwchUtVb7WF@QRZ@V8);4YhcX%e)iU zc-;=sQ}>R5!+3*Qi2&R?o|-`^bznZ+bPsErG%dV{tXC9+X()HCW0O?~_K{Tn{g?-<%x zbBmcYqrNs3QoDpLpw_kiF4hXMN)$~<$ak`6m2PN|Zgla76C9zR@5*Y9ZX;K>^W3dG z?;)PJm#4KUIb5Hi_Z4*G3-T{%`5Jxrp8PhByPZ1Be(XRGI@m#tT}>cL$%k3Wp7a$Z zvHGNIiyal|C_35GF0O7x`D4_o$NUlf6YY=S=ig%}^$43586CTs#6#F#ZjoSWdA_AI z0fTNuYdvEzlVY`fv@0Adh8Urbgs5&>K%KGW8{&);s3f44yHv^Z0K@#}VTAoktcYD* zj9tALTTY=tg_tDvKS>0&PbV2=k~2&)_CiUFGWPxiQ^|FU@Eme>KkL_iq~LQ$>@{SS z8_xr?AN>MmZXUp!#m&+dZ?o@*7uq~n+`NzXKsM{)#9gRUC1bp!{}n?o77)kKVgYT$ zpmaG9-aK0PxB9(-2E6U!jJF70K9n5J(yJq{nS2c6;2mt9$L5gsNBRy7>9le?5_CPP Vn9!g!!gU``@=5UCuMjyu{{RHF{A>UK diff --git a/out/production/Tetris/Tetris/GameGui.class b/out/production/Tetris/Tetris/GameGui.class index bb90d6d5b067eb155cf25ba91084b872c62eb43f..3f12ae5eb2682c9ebaecf8321a9343cf83c1b8ae 100644 GIT binary patch delta 21 bcmX>mbWCW%UnVBCjsNel0jbUR+0z*TVm$~a delta 21 ccmX>mbWCW%Una&c8~@*915%ssv!^ox0C92&!2kdN diff --git a/src/Tetris/Board.java b/src/Tetris/Board.java index 8cfb576..4b48eee 100644 --- a/src/Tetris/Board.java +++ b/src/Tetris/Board.java @@ -15,7 +15,7 @@ public class Board extends JPanel implements KeyListener private static int FPS =60; private static int delay =FPS/1000; - public static final int BOARD_WIDTH=10; + public static final int BOARD_WIDTH=11; public static final int BOARD_HEIGHT=20; public static final int BLOCK_SIZE=30; @@ -40,9 +40,14 @@ public class Board extends JPanel implements KeyListener @Override public void actionPerformed(ActionEvent e) { - if(System.currentTimeMillis() -beginTime > delayTime){ + if(!(x + deltax + shape[0].length >11) && !(x + deltax<0)) + { x +=deltax; - deltax= 0; + } + + deltax= 0; + if(System.currentTimeMillis() -beginTime > delayTime){ + y++; beginTime=System.currentTimeMillis(); } diff --git a/src/Tetris/GameGui.java b/src/Tetris/GameGui.java index a90d4e2..2e5059b 100644 --- a/src/Tetris/GameGui.java +++ b/src/Tetris/GameGui.java @@ -3,7 +3,7 @@ import javax.swing.*; import java.awt.*; public class GameGui { - public static final int width= 500, height =650; + public static final int width= 550, height =650; private Board board; private JFrame frame;