From f3ae86d08a1b3a70f67700e30c8d94c2ad50ead0 Mon Sep 17 00:00:00 2001 From: Newe666 Date: Sat, 22 Jan 2022 15:18:03 +0100 Subject: [PATCH 1/3] Stein.txt + enum Steintypen + Blockbuilder(Wie die steine generiert werden)+ stein constructor angepasst --- out/production/Tetris/Tetris/Board.class | Bin 3658 -> 3159 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/out/production/Tetris/Tetris/Board.class b/out/production/Tetris/Tetris/Board.class index 59105a7317aabd8bf00ce01fca0f6a2602f89f19..23304ca1ac01f658db9e4ce5b8ced79bd35cbbba 100644 GIT binary patch delta 1569 zcmZvb*>@CG5XOH!Jwtaoo!A4Ch0KhRgb10KA%MgMg5ru%qXaQAf{r9)F(fer+|W@8 zxB_asFA(Dr4Q?bdIY-XXcOHE8$#ZNAOP|wKb?a7rU){QO&&PhL%AEi6 zhaZ6reCuE`;E-a_V#s1kiL4*77*@T{V#H?D!Dh_nQJZm_{WcRe2W$>%#A6nZJ1k{T z7f)C`sro64Lk^WZ?Xa9@)RR%`S+$;XSi(TJ<~*hJ zuc-B^!y1lR99Pc?6|bpyUBw#;>|4BP@z$B&ehsbdV4KTrY%_3o^i7Np?oVwUO^^4w zw6SH;*E!KQIO1|WH~1IKxcN5k_+{a?id(qVz#B>*Os5V^3=XHZr$>56_xWStn*I%} zHz+TLtZz}GJu2RH*~Dg-_mq4qH@dvf2QDA#@?Lhje8fqYQ=GJza`~8PmrwZA6u}dcQW(JAXP-Z*-(ESW796y5%k%xlPs8TqW9I zqu3!@Wqozg`WjhZTeQATVx(;FE37q@rIIIo6M4I2|BNLTO!~X6{>(X+ch6CAj>_)F z1*#UPKFf;6?^%(h=1h*OU1S3#B3BZo3QxGIiPKJk9_rZ3O&p?w!`#gs66FTy+{sPwxbBd&Vv{NodfZkoLDBY?kuqY;H$M+(WEQkr&f2$}80?8v{f)Blql z)>+AAV~omdhlO#rF}Xl((li^hTrU60EOp5_>a(oUqLNt}{Fc(@=&EGg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/Tetris/Board.java | 6 ++-- src/Tetris/Stein.java | 64 +++---------------------------------------- 2 files changed, 7 insertions(+), 63 deletions(-) diff --git a/src/Tetris/Board.java b/src/Tetris/Board.java index 3b944d7..8e18d23 100644 --- a/src/Tetris/Board.java +++ b/src/Tetris/Board.java @@ -22,7 +22,7 @@ public class Board extends JPanel implements KeyListener private Timer loop; private Color[][] board = new Color[BOARD_HEIGHT][BOARD_WIDTH]; - private Stein [] steine=new Stein[7]; + private Stein [] steine=new Stein[6]; private Stein currenStein; private Random ran; @@ -33,7 +33,7 @@ private Color[] colors ={Color.decode("#ff00bf"),Color.decode("#0000ff"),Color.d public Board() { ran = new Random(); - /*steine[0]= new Stein(new int[][]{ + steine[0]= new Stein(new int[][]{ {1,1,1}, {0,1,0} @@ -63,7 +63,7 @@ private Color[] colors ={Color.decode("#ff00bf"),Color.decode("#0000ff"),Color.d {1,1,1,1} }, this,colors[6]); - currenStein= steine[0];*/ + currenStein= steine[0]; loop = new Timer(delay, new ActionListener() { int n = 0; diff --git a/src/Tetris/Stein.java b/src/Tetris/Stein.java index feea645..be3e1b4 100644 --- a/src/Tetris/Stein.java +++ b/src/Tetris/Stein.java @@ -1,13 +1,9 @@ package Tetris; import java.awt.*; -import java.io.File; -import java.io.FileNotFoundException; -import java.util.Scanner; public class Stein { - SteineTyp Block; - private int x = 4, y = -2; + private int x = 4, y = 0; private int normal = 850; private int fast = 50; private int rotation; @@ -15,7 +11,6 @@ public class Stein { private int delayTime = normal; private int deltax = 0; private boolean collision = false; - private int size; public static final int BOARD_WIDTH = 11; public static final int BOARD_HEIGHT = 20; @@ -25,61 +20,10 @@ public class Stein { private Board board; private Color color; - public Stein() { - /* this.coords = coords; + public Stein(int[][] coords, Board board, Color color) { + this.coords = coords; this.board = board; - this.color = color;*/ - //Ewen Kerbs still in progress - // Hier werden die verschiedene steine auf deren typ "analysiert" und dann ausgewertet wie viel platz die aufm spielbrett benötigen - Block = SteineTyp.randomSteine(); - switch (Block) - { - case I: - size = 4; - break; - case O: - size =2; - break; - default: - size =3; - break; - } - } - - //ewen Kerbs still in progress - public int[][][] BlockBuilder(SteineTyp type) throws FileNotFoundException { - int[][][] size; - switch(type) - { - case I: - /* 3 dimensionales array um die rotations zu erkennen + */ - size = new int[4][4][4]; - break; - case O: - size = new int[4][2][2]; - break; - default: - size = new int[4][3][3]; - break; - } - File file = new File("Steine/"+type+".txt"); - Scanner leser = new Scanner(file); - //i= 4 verschiedene stein varianten (1=0° 2=90° 3=180°4=270°) - for (int varianten = 0; varianten < 4 ; varianten++) { - for (int j = 0; j < size[0].length; j++) { - if(leser.hasNext()) - { - String[] srow = leser.next().split(""); - int[] row = new int[size[0].length]; - for (int k = 0; k Date: Sat, 22 Jan 2022 18:22:23 +0100 Subject: [PATCH 3/3] stand vor dem 20.1 --- out/production/Tetris/Tetris/Board.class | Bin 3159 -> 3658 bytes src/Tetris/Board.java | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/out/production/Tetris/Tetris/Board.class b/out/production/Tetris/Tetris/Board.class index 23304ca1ac01f658db9e4ce5b8ced79bd35cbbba..59105a7317aabd8bf00ce01fca0f6a2602f89f19 100644 GIT binary patch literal 3658 zcmai0`+HM&8ULJ|BP)<@VE3{=B6?@r8DQw_iRhj|~bQGIf$m+z?@w}W~5D#7yU%n^H zOBPHEH2Ea+!Cc)ie4#to8L2Q2u^p;+E7gLC`}qRbobmX zO)c|oCRd8)=jQV{FIUpAsk@%bBL#PUHj^ywmw0r>&b5$VWUXhaHBmXQ@v+wNlAApH zm^)vI%RK8XO)SlOEK_@fX73!0MUHt(hvcC2YYeijZhH*}!9h(Y3LYUxUCq3Vds)v_ zH_J^X`Owwh-_O!?SF=#gq4@4Q&j<5BGFz#T70)jelHTEr)WcGII|X4jzKmlwj^Y>r zT0xC^weck!tkV>9Yz!gF!iZoUdK!%F>2!bpblS#G@UC3xR)0EOKBd$9=!&rHQ{KvH zdiV5hp$VnTCkpoT+ZX|x%25UyfN0||jxeaHn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G${joFJ^};t}1lx{Mw% z;A|~$w&po|WG{lbZ0RLZK)OJ`GfyAANT0{OGLI`+!C;+|7ceEWKV5XPXn`fFEE(;P zB$ybUXY(+7@@-limxcefs{9}0(wloUHhqOh)0Aruc;2RYn&)Vantu$>Q=tVKMQ_I= V9w92hdu1a;KP{pi38@q<-`|U#;rajo diff --git a/src/Tetris/Board.java b/src/Tetris/Board.java index 8e18d23..ce96f18 100644 --- a/src/Tetris/Board.java +++ b/src/Tetris/Board.java @@ -22,7 +22,7 @@ public class Board extends JPanel implements KeyListener private Timer loop; private Color[][] board = new Color[BOARD_HEIGHT][BOARD_WIDTH]; - private Stein [] steine=new Stein[6]; + private Stein [] steine=new Stein[7]; private Stein currenStein; private Random ran;