From 11eef601e0d69d00e6b3dd788b030dd0b58c8036 Mon Sep 17 00:00:00 2001 From: zhe Date: Mon, 22 Nov 2021 12:35:26 +0100 Subject: [PATCH] Stein nach links und rechts bewegen. --- out/production/Tetris/Tetris/Board$1.class | Bin 961 -> 1116 bytes out/production/Tetris/Tetris/GameGui.class | Bin 2374 -> 2374 bytes src/Tetris/Board.java | 12 +++++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/out/production/Tetris/Tetris/Board$1.class b/out/production/Tetris/Tetris/Board$1.class index 05771a8018591506dfef95c008719f458c2be90c..779abc71b9a7159c129024461ab42972d6874b73 100644 GIT binary patch delta 551 zcmYk4OD}U#6o#MO)_2-tqwaT~Yh8*~)t!&ey<(z~FeG$fBvErCzo3RokF>hH={8ucpWLZ|M zs9j~vvd(1T(!8uE4etKIK`x)~9!>r-sbtDf)wj8wJ3TqdCl-(QPY!1?{h8n8Qt{QB zE*u9&ddlU1hA06!v`hujsE#O3Gqu#oYJK4;(0f#+` zH?n;Y9jpyU7?%$YGRzPY!g&&GkYY=2^Jm!X_pn+1(k?@GNM{M=O^SnbiV4s~x5SX# PVvJ@{E+#BLf&Y8}`>INQ delta 395 zcmYk2J5Iw;5Jk^R92}bmN%)vQgnS@z2(b->Z^0svprK?PsaQd%*+V3RED9tfDr!m^ zHiDS3CBz%Od*_aQXU6_2zqywmKQFJqAr~G#O`mBRnzek|?D%Z6tI$#CDufC>mpzxh z%l_o5XX1gSMr5f_wahT<5?c}utn@vy3^}%(D4cR;IVT#wo6qrgA!_S9gQXxlh!Lt) z?IKDmHRj~${CHTbj}}DxS+$8ri$&2vrYpkBq7bKgjl>G8>Xh0DCwnVNal$7|O6e}= zsr!dVf;@Mxb9Pe7H<~`mbWCVN3x}#Y!+r)0hBFMB3|APm8167=Gdy9?VR+A=%kYaqkCB~0pOK%zVDd_i P8dhTl4hECSTAVTf-0cnf delta 59 zcmX>mbWCVN3x}!(!+r)$hBFLW3|APm8SXIXFg#( delayTime){ + x +=deltax; + deltax= 0; y++; beginTime=System.currentTimeMillis(); } @@ -56,6 +60,7 @@ public class Board extends JPanel implements KeyListener g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(Color.lightGray); + //shape mit 2-Forschleife for(int row=0;row< shape.length;row++){ for(int col = 0;col< shape[0].length;col++){ @@ -85,8 +90,13 @@ public class Board extends JPanel implements KeyListener public void keyPressed(KeyEvent e) { if(e.getKeyChar() == KeyEvent.VK_SPACE){ delayTime=fast; + }else if(e.getKeyChar() == KeyEvent.VK_ENTER){ + deltax = 2; + } + else if(e.getKeyChar() == KeyEvent.VK_ESCAPE){ + deltax = -2; + } } - } @Override public void keyReleased(KeyEvent e) {