From 5de88e7fae08961e2119fbf89af1186cc2646642 Mon Sep 17 00:00:00 2001 From: Mykola Fesenko Date: Tue, 30 Sep 2025 10:51:52 +0200 Subject: [PATCH] 30.09 ptp --- Chip$1.class | Bin 0 -> 886 bytes Chip.class | Bin 237 -> 1826 bytes Chip.java | 26 +++++- Chip.~ava | 30 ++++++- Game.class | Bin 777 -> 2606 bytes Game.java | 59 +++++++++++-- Game.~ava | 60 +++++++++++-- Muehle.class | Bin 5038 -> 6063 bytes Muehle.java | 204 ++++++++++++++++++++++++++++----------------- Muehle.~ava | 202 +++++++++++++++++++++++++++----------------- Muehle.~fm | 2 +- MuehleButton.class | Bin 1877 -> 1609 bytes 12 files changed, 408 insertions(+), 175 deletions(-) create mode 100644 Chip$1.class diff --git a/Chip$1.class b/Chip$1.class new file mode 100644 index 0000000000000000000000000000000000000000..2374eda25a73f129ebe00e9b4f547ca7d38cb447 GIT binary patch literal 886 zcmaiy-A@xi6vfZ9h5cZK6%|B95UaK&aV0*MG!lZrq*N13U(Iwowu{Rw+1(N!{g+G> z6CaGv{!zv=+d}(b^kL`B$GyKjcjo^3{rv}kJv1DYP_|I~~dN8tz6w{SyX-EiK246;yZ6-4@Mlm|!2C{qXLO6M-k-SV)4RpN(I_hTinRcrq< zsafw@SQA*AL@7fG3f^IXNClkQxT<>BcuV@kF0~`AI-}E`O5e(!`O$Ja31!@sX=K)u z&5F4f0lUbr?lgH7M=BpC{Wmg|rz%$|PdEPKP+;|{h#7lyPHV@}K+AlT(m|)-%wBWz zl01_(scQG~=?y^KtKj(L=)=9XCffezy&i}YYz4J+)ZEI&*#zO463 zYnATDGRstkO+JbZf!h$iZ@Pw!ROYvUJ3P6|S&Letx{d9x5RGrJK66#VJ&yCtG!g3@ zSH@Aej}5LEU(f{q0L(G$lh0s2K1YLnK{Z&r@de@n*QQX@C+6H@M^C}_71$=_0qyQl zw-{?^NMX>9+*@&#^AakC!1!ml$yZ8E_)^C@`9MF~|rD)cd)P%G?vpjPZGqE2-u Ht~vb!@bk4R literal 0 HcmV?d00001 diff --git a/Chip.class b/Chip.class index 9099b766b61430ec54a7bad81ff4e759b4bad545..3590f970b2f0bdd18781f1bf38830bfdd0241bb1 100644 GIT binary patch literal 1826 zcmZ`)iBcO!5Pbs@Lh_o!aU9M74gqO#P;6tcEkbNd9E!z}fE6njUZgRsv#coXic0<} zNg-SnSLFlpQK`HhiPM-WZTI%^=59Y0vR@ z)9X8LbU9S$n0I|QTu^9Friw9i(vsbC5615%5JN)pt|`Qm1u#$6F+9*Ha=5`maAU1rZ8~ACn#%Q zrw<&Ltg_R_Je)(o7BZoCBTCy0x;W6G-8Xbm$9a zBy+i3vps1GU*axJWfOI-8}CD81mnJi89Y#k1v*@EJx^gcc@^Oeq20QJISUW*h!?Qy z>}#G?Sf*reGnkLzD+>$wnlKlryZ%8vOs~pKnG4~yt**b=T-?qU^4aH$IfcHHQ_o%7 z*6#<}uzYIa8L|r9PNj1GLKS9D*L3;ndZTD#|KUD?G2e;QD&4zQ3buTh5M0%Z);{?07||=E{4^7zy{>K<>@#6|=bs zQaVM6f^#l!6nwMToQ-PWhHllDMd9zfi4lsw&RrdD%5*9WB~up}H>cKkSyN)OTCbHg zM~$&@Auuh2qHt|Z2jQv~?&N0WeP7qIo)ZK*z!=w~&8&%%$)l!Z$Bg7I8_CTzlDldo zH`7S&l#yHuO30^!*&Ec_@GbX;i;C~~+$3n6ix{V;YQKfD-yv3_5^un=2OGFy4>fSh zPBqYP_eC2Rw)BHJY@unJW$MWX?}mZng!hjF$Lbds2#T z7Sn%>+!^sM6L6nkGbH}Nkhx`!>pdmYi=TNM2L``f4J{p$J`EpZ4W(U46It)85lPL1(+DPfFwwo0jPi*Nb-Q$tU#I<$YW&S1CmS(`~Ysk40`|o diff --git a/Chip.java b/Chip.java index 878ec49..0d502c4 100644 --- a/Chip.java +++ b/Chip.java @@ -1,6 +1,9 @@ import javafx.scene.paint.Color; import javafx.scene.shape.Shape; import javafx.scene.shape.Circle; +import javafx.event.Event; +import javafx.event.EventHandler; +import javafx.scene.input.MouseEvent; /** * * Beschreibung @@ -10,6 +13,7 @@ import javafx.scene.shape.Circle; */ public class Chip { + public Game game; public Color color; @@ -24,7 +28,7 @@ public class Chip { public Circle circle; - public Chip(relX,relY,absX,absY, Color color) { + public Chip(int relX, int relY,double absX, double absY, Color color, Game game) { relativeX = relX; relativeY = relY; @@ -39,9 +43,29 @@ public class Chip { circle = new Circle(absoluteX, absoluteY, radius); circle.setFill(this.color); + this.game = game; + circle.addEventHandler(MouseEvent.MOUSE_CLICKED, mouse_clicked); + } + public void setPositionX(double X) { + absoluteX = X; + circle.setCenterX(absoluteX); + } + public void setPositionY(double Y) { + absoluteY = Y; + circle.setCenterY(absoluteY); + } public Shape getShape() { return circle; } + EventHandler mouse_clicked = new EventHandler() { + public void handle(MouseEvent handle) { + chip_clicked(); + } + + }; + public void chip_clicked() { + game.chip_clicked(this); +} } // end of Chip diff --git a/Chip.~ava b/Chip.~ava index c960522..dee2eb1 100644 --- a/Chip.~ava +++ b/Chip.~ava @@ -1,6 +1,9 @@ import javafx.scene.paint.Color; import javafx.scene.shape.Shape; import javafx.scene.shape.Circle; +import javafx.event.Event; +import javafx.event.EventHandler; +import javafx.scene.input.MouseEvent; /** * * Beschreibung @@ -10,6 +13,7 @@ import javafx.scene.shape.Circle; */ public class Chip { + public Game game; public Color color; @@ -24,7 +28,7 @@ public class Chip { public Circle circle; - public Chip(relX,relY,absX,absY, Color color) { + public Chip(int relX, int relY,double absX, double absY, Color color, Game game) { relativeX = relX; relativeY = relY; @@ -35,11 +39,33 @@ public class Chip { radius = 20; - circle = new Circle(absoluteX,absoluteY,radius); + this.color = color; + circle = new Circle(absoluteX, absoluteY, radius); + circle.setFill(this.color); + + this.game = game; + circle.addEventHandler(MouseEvent.MOUSE_CLICKED, mouse_clicked); } + public void setPositionX(double X) { + absoluteX = X; + circle.setCenterX(absoluteX); + } + public void setPositionY(double Y) { + absoluteX = Y; + circle.setCenterX(absoluteY); + } public Shape getShape() { return circle; } + EventHandler mouse_clicked = new EventHandler() { + public void handle(MouseEvent handle) { + chip_clicked(); + } + + }; + public void chip_clicked() { + game.chip_clicked(this); +} } // end of Chip diff --git a/Game.class b/Game.class index e9f485a2367afe3fe560ca62a0e36c507fbaa163..330f55a3b6c39c1f3bfcd1dfbc36c1662f09f44e 100644 GIT binary patch literal 2606 zcmai0X>-$76g`UV$TlL2Nm3FMmWIW4D29|$z=4v5C14;Wse|c~%8p0`ik-@GAl>(t z?)yT&mv5aZL(EWS`UCo-Iz3nNme5W!W4)*M?sD$E=U(NnzyJ6XzzBW`qXj+{ehmS% zD(JYTFY8H5FU%(|=B^oeM?vebSumaB3VgA6CWxSdz|4Z_7$JnQL4~GaBia=BPwR_@ zg3f%|wvB=_UA7C8mcC-x3L@!-)hWj|3-c*a?$FSQh=TAuHD^nX?oeNukgF~Y-Ey_z zhIpFIFPKXuIe$#UX7@a2>G|v4xr#mon_LfN$F!0owym$E&5{#FFMOiauVE{;DNu7| z$0-&{3c5W+Yvo-~J2X5lvVpqKof>vwcMWE)sM~W2`dkB7ZzfB5qhK&$E5)*toYV^j zt;7&lkbX+UDm%ty z=4D)N4r+L6%?;(B#$gplG#o`r!Dh)r9oCX=7M$c*(JIt*1T9D0^io z$$8SfO>MvhTvRcs;aOZ_P}M~Jw-++sHWrJ^G~6BY_|nuDsrVJi*0hG_q;G-+3HI zHXoHjn1i9>s)l(itm*5im6BsDQi_bNcY;|=PO>o_wx^*llEWFq!?+Gh#iE7+inSJ7 zD@d9wiJHaI`C}8pgben#p2%{z@K3^VG?cN-J}4Q^WU*vQLCI%-Y}}JRC_*b5UR^Jg z4dQj7lXNlfJMP&#aZ8lTAzJN__z|u2B znS-O=eA$#Iuvu?j&E_pLf8F5J>5QeDr-`f8>Io@mTYINqeM`#tB+-FbXA$qg-5naWW#&-Mf)M~+dd~T&p5TzgO zMBTw>r+k+XMHfAH<9*(0o)>(85Ba9xBYa#%aGX{o($>V_Dh3)>z4-fxHR@XE@uaF2 zD34pT&XJE#@M+c7Z_Jn2nn~P4`)yp}5{jt5qCYWs4}19A%U_beC-34=1;cmH_b)dm zctg#B3dRO2n0SEmEwos{lz{U!g)D(@W5C;yz)t>~up5`Khkd%Y3GhrE@C-h~=LGr% ztpwmp^mOrsACW5dTg+XESJ8*aWTRW+n*+Tni*osBFwq;V;Q0z(Xe6hNIKYo$Cz9yH ze%Id_w+zv`zbL+B5u~_Le8rt4CW@~y|3O$+erZ5ks?AlPSq-`)6^5q z_F6_B;AN(x0mZA+5IK6VDeU$-jCOpFA81U$kNBx-G*8E3bl@)XtcF>^wLz{+U3ev5 zK}q&Ey#39FqX-EG93slY=)n=v{AiQIfx5#1HwtmcZ%)-=mhL1Iy){N?iO6f@`W@2U oC4Hl`o||FT;uw>5g8xa4x^6rM_g39V5&dY11ZehW?ptvCAK9`pyZ`_I delta 421 zcmYL^xlRI67=^#fHkn1mk;Pq9To}X!G}bDG7PiLD0GR|L5fg@3Qdn7-U+MB|cJ z_yE3)Z(#gqFw&fV?tkWd_uR+SUBdYK`S=75*u6Jy_spAS%X2Rp&DM2Sp-yxRQWj}! zg;{Uc8kYl4C(ES9l*KeN{&%#pKgYbrf<=x+g>~9T zuuNWK#bT8;zZ}a)tA#Va6hHPK;#I$q$n~QrMi`Y^igE04N(GsL6DJ|ME~ir>@&#Gv z9p%{CE4q^u9Se2hNvsG3QJa{kE^5kyERuqEWMd8D6xooIq7(bco3ee*MEph;4R)R*JGPB2<0>!tgSD diff --git a/Game.java b/Game.java index e9b3b2d..4af8618 100644 --- a/Game.java +++ b/Game.java @@ -1,4 +1,7 @@ import javafx.scene.shape.Shape; +import java.util.ArrayList; +import javafx.scene.layout.Pane; +import javafx.scene.paint.Color; /** * * Beschreibung @@ -8,19 +11,57 @@ import javafx.scene.shape.Shape; */ public class Game { - + public String currentTurnPlayer = "White"; - public int white_chips = 7; - public int black_chips = 7; + public int game_state = 0; // 0 == players placing their chips; 1 = players moving their chips; 2 = player can remove chip + public int white_chips = 9; + public int black_chips = 9; - public void addShape(Shape shape); + public ArrayList buttons = new ArrayList(); + public ArrayList chips = new ArrayList(); + public Pane game_board; + public Chip current_selection; - public void start() { - + public void start(Pane gameBoard) { + game_board = gameBoard; } public void chip_button_clicked(MuehleButton button) { - System.out.println(button.absoluteX); - } - + if (game_state == 0) { + if (currentTurnPlayer == "White") { + addChip(button.relativeX,button.relativeY,button.absoluteX,button.absoluteY,Color.WHITE); + white_chips--; + + } + else { + addChip(button.relativeX,button.relativeY,button.absoluteX,button.absoluteY,Color.BLACK); + black_chips--; + } + game_board.getChildren().remove(button.getShape()); + nextTurn(); + } // end of if + + + + } + public void addChip(int relX, int relY,double absX, double absY, Color color) { + Chip chip = new Chip(relX,relY,absX,absY,color,this); + addShape(chip.getShape()); + } + public void addShape(Shape newShape) { + game_board.getChildren().add(newShape); + + } + public void chip_clicked(Chip chip) { + System.out.println(chip.relativeX); + + } + public void nextTurn() { + if (currentTurnPlayer == "White") { + currentTurnPlayer = "Black"; + } + else { + currentTurnPlayer = "White"; + } // end of if-else + } } \ No newline at end of file diff --git a/Game.~ava b/Game.~ava index d373e68..e1dfaa6 100644 --- a/Game.~ava +++ b/Game.~ava @@ -1,3 +1,7 @@ +import javafx.scene.shape.Shape; +import java.util.ArrayList; +import javafx.scene.layout.Pane; +import javafx.scene.paint.Color; /** * * Beschreibung @@ -7,19 +11,57 @@ */ public class Game { - + public String currentTurnPlayer = "White"; - public int white_chips = 7; - public int black_chips = 7; + public int game_state = 0; // 0 == players placing their chips; 1 = players moving their chips + public int white_chips = 9; + public int black_chips = 9; - public void addShape; + public ArrayList buttons = new ArrayList(); + public ArrayList chips = new ArrayList(); + public Pane game_board; + public Chip current_selection; - public void start() { - + public void start(Pane gameBoard) { + game_board = gameBoard; } public void chip_button_clicked(MuehleButton button) { - System.out.println(button.absoluteX); - } - + if (game_state == 0) { + if (currentTurnPlayer == "White") { + addChip(button.relativeX,button.relativeY,button.absoluteX,button.absoluteY,Color.WHITE); + white_chips--; + + } + else { + addChip(button.relativeX,button.relativeY,button.absoluteX,button.absoluteY,Color.BLACK); + black_chips--; + } + game_board.getChildren().remove(button.getShape()); + nextTurn(); + } // end of if + + + + } + public void addChip(int relX, int relY,double absX, double absY, Color color) { + Chip chip = new Chip(relX,relY,absX,absY,color,this); + addShape(chip.getShape()); + } + public void addShape(Shape newShape) { + game_board.getChildren().add(newShape); + + } + public void chip_clicked(Chip chip) { + System.out.println(chip.relativeX); + + } + public void nextTurn() { + if (currentTurnPlayer == "White") { + currentTurnPlayer = "Black"; + } + else { + currentTurnPlayer = "White"; + } // end of if-else + } } \ No newline at end of file diff --git a/Muehle.class b/Muehle.class index 1ac5c902818524403643f88f226687345769f3f2..693f132c1b3d049b12f3bf9bd27dde9a74cbab7c 100644 GIT binary patch literal 6063 zcma)A3wTu35&qB3W_Po>NjAxD$f7(%gd~6g;%o816@PDl(413^0P9E~1yHKE`5JgnbG+_3G zO#w%^HQFz5a^vykYh5T7D9@S@Hin`DiRv{*#Pq-`ZTC^vDx;5|rE0ZtI?53sx0_t9 z*eFM9J+$K_9VcUgKv8GR*t}5=Z|sN~u}+#%QJHN>#yYjqg-JRl;}ii;rquZ3%Shu+ z)iD*P3FLR1iRC?^aA(Yn2%I*$R4^J2n?V`nc=hUzxEUKXI>KgSD4w9}(*=sNTyKtc zn)#?il?yX;%)~5#Q|t-HS497f&d#Obus~VG2Fu>+uo3CzdKYo&+RF7VR11`3t<)m- z(ph)?J4_P5S+{eKMR;&J=F3c3z-_O{_I-^(=MuH`^_6XMBhJ*Z2sHw^@q`ge2uv6= zJu|$OZEh@PWLwR6VzQk$`BuA6^8U81XZnL^YJ{f*4y*jcy9F3c6 z&5H+U9xEj6$T5^kPYR^wCLPVvc(*h@ln669S7MEhFJi4?S`ii)m)54r$70hVIlWcK zd9o%Q@t){rSxW14oG+ESq*8NB!h`kL;KBtuF2t9{)=9q+qRY#p;b@G-8td*5m{ifw z&@d*=Go~@k*JG0o1Du<)b_HWOC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z(k+$P);g&*^UKs;@x$UYin!T|M9$atR zD9HYJ#fBH(!}p0MByn+M`kZ^|e~1UVFBg~jI!>XZ?Ie042KrB7FglGSQ#jJ#WG>S( znGG%jd+Xf>_SJg~?621h9H`f)F&YcGL!OWp(x>pgh8#18uD#!MnmHMKkjZ`fw%_#g zEbcY^20oI(M@|1UI%7F}rttBsn*XXAJ?RS3R)4xHL~BQSLb@EKnSdFvaRM_qfopIA zvvH2tI2;LczYTN04U=o;+Az5@FuB*j*zBwJrn45+UZ`Sb~WED>3ltDSW0O zXa))TSu<#ZevYXKW_|fT7!2rvu4{1~lsI{2o{f`dq-C-sP~I#csvb*Z)tQwpnVaml z)HO`Q)-|s9U|dx-@P%2w%W#e`urJP%Nr-$i--gIHke)H0pT!uDIUGC{z9;c8i?MhL zk2Vz0y@Cu*%3mBS3iAt1X9k%EFwb?2z^BuMOCNHug^h!(^KM*ob?u ziI>A>OmO!!w%{pjWgl(BPjM?QB1S6NEh4HZ5Wo%TDVBB`R>!AHgDtoNvjEAKdu;UdXW;C1|!qvY~+%!A}MKg)@n zy|_ACCNm5t?Pn?OE{1n#7RC9mP@Ers!`~qSn!MF!Q0q9;7+fT`FJEO#c}IcCy>h=W x&Hu!klsWM)jtbrTxBbOC6#oGUozV*iPv|XN7K+fg8RTyP&U}PV%n^Q={{ System.exit(0)); primaryStage.setTitle("Muehle"); @@ -49,87 +50,136 @@ public class Muehle extends Application { primaryStage.show(); } // end of public Muehle public void setTopLabel(String value) { - lTop.setText(value); + lTop.setText(value); } // start methods public Pane draw_game_board() { - - Color bg_color = Color.rgb(255,255,0); - Color stroke_color = Color.RED; - Double circle_offset = 100.0; - - ArrayList shapes = new ArrayList(); - - - - - Pane board = new Pane(); - double topLeftX = (1080/2)-400; - double topLeftY = 720-(720/2)-300; - double topRightX =(1080/2)+200; - double topRightY = (720/2)+300; - - Rectangle bg = new Rectangle(topLeftX,topLeftY,topRightX,topRightY); - bg.setFill(bg_color); - shapes.add(bg); - - - Rectangle circle1 = new Rectangle(topLeftX,topLeftY,topRightX,topRightY); - circle1.setStroke(stroke_color); - circle1.setStrokeWidth(10); - circle1.setFill(new Color(0.0,0.0,0.0,0.0)); - shapes.add(circle1); - - Rectangle circle2 = new Rectangle(topLeftX + 100,topLeftY + 100,topRightX - 200,topRightY - 200); - circle2.setStroke(stroke_color); - circle2.setStrokeWidth(10); - circle2.setFill(new Color(0.0,0.0,0.0,0.0)); - shapes.add(circle2); - - Rectangle circle3 = new Rectangle(topLeftX + 200,topLeftY + 200,topRightX - 400,topRightY - 400); - circle3.setStroke(stroke_color); - circle3.setStrokeWidth(10); - circle3.setFill(new Color(0.0,0.0,0.0,0.0)); - shapes.add(circle3); - - Line line1 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topLeftY,(topLeftX+topRightX) /2 + topLeftX/2,250); - line1.setStroke(stroke_color); - line1.setStrokeWidth(10); - shapes.add(line1); - - Line line2 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topRightY+50,(topLeftX+topRightX) /2 + topLeftX/2,520); - line2.setStroke(stroke_color); - line2.setStrokeWidth(10); - shapes.add(line2); - - Line line3 = new Line(topLeftX,topRightY/2+50,topLeftX+200,topRightY/2+50); - line3.setStroke(stroke_color); - line3.setStrokeWidth(10); - shapes.add(line3); - - Line line4 = new Line(topLeftX+550,topRightY/2+50,topLeftX+200+540,topRightY/2+50); - line4.setStroke(stroke_color); - line4.setStrokeWidth(10); - shapes.add(line4); - - - MuehleButton button1 = new MuehleButton(0,0,100,100,Color.BLUE,game); - shapes.add(button1.getShape()); - - for (int i = 0; i < shapes.size() ;i++ ) { - board.getChildren().add(shapes.get(i)); - } // end of for - - - return board; + Color bg_color = Color.rgb(255,255,0); + Color stroke_color = Color.RED; + Double circle_offset = 100.0; + + ArrayList shapes = new ArrayList(); + + + + + Pane board = new Pane(); + double topLeftX = (1080/2)-400; + double topLeftY = 720-(720/2)-300; + double topRightX =(1080/2)+200; + double topRightY = (720/2)+300; + + Rectangle bg = new Rectangle(topLeftX,topLeftY,topRightX,topRightY); + bg.setFill(bg_color); + shapes.add(bg); + + + Rectangle circle1 = new Rectangle(topLeftX,topLeftY,topRightX,topRightY); + circle1.setStroke(stroke_color); + circle1.setStrokeWidth(10); + circle1.setFill(new Color(0.0,0.0,0.0,0.0)); + shapes.add(circle1); + + Rectangle circle2 = new Rectangle(topLeftX + 100,topLeftY + 100,topRightX - 200,topRightY - 200); + circle2.setStroke(stroke_color); + circle2.setStrokeWidth(10); + circle2.setFill(new Color(0.0,0.0,0.0,0.0)); + shapes.add(circle2); + + Rectangle circle3 = new Rectangle(topLeftX + 200,topLeftY + 200,topRightX - 400,topRightY - 400); + circle3.setStroke(stroke_color); + circle3.setStrokeWidth(10); + circle3.setFill(new Color(0.0,0.0,0.0,0.0)); + shapes.add(circle3); + + Line line1 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topLeftY,(topLeftX+topRightX) /2 + topLeftX/2,250); + line1.setStroke(stroke_color); + line1.setStrokeWidth(10); + shapes.add(line1); + + Line line2 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topRightY+50,(topLeftX+topRightX) /2 + topLeftX/2,520); + line2.setStroke(stroke_color); + line2.setStrokeWidth(10); + shapes.add(line2); + + Line line3 = new Line(topLeftX,topRightY/2+50,topLeftX+200,topRightY/2+50); + line3.setStroke(stroke_color); + line3.setStrokeWidth(10); + shapes.add(line3); + + Line line4 = new Line(topLeftX+550,topRightY/2+50,topLeftX+200+540,topRightY/2+50); + line4.setStroke(stroke_color); + line4.setStrokeWidth(10); + shapes.add(line4); + + + + + for (int i = 0; i < shapes.size() ;i++ ) { + board.getChildren().add(shapes.get(i)); + + } // end of for + + drawMuehleButtons(board,topLeftX,topLeftY,topRightX,topRightY); + return board; + + } + + public void drawMuehleButtons(Pane board, double topLeftX,double topLeftY,double topRightX,double topRightY) { + ArrayList shapes = new ArrayList(); + Color button_color = Color.BLUE; + + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(0,i,topLeftX,topLeftY+ i*325,button_color,game); + shapes.add(button.getShape()); } + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(1,i,topRightX -230,topLeftY+ i*100,button_color,game); + shapes.add(button.getShape()); + } - public void addShape(Shape newShape) { - game_board.getChildren().add(newShape); + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(2,i,topRightX + 140,topLeftY+ i*325,button_color,game); + shapes.add(button.getShape()); + } + + + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(0,i,topLeftX + 100,topLeftY+ i*220 +100,button_color,game); + shapes.add(button.getShape()); + } + + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(2,i,topRightX +40,topLeftY+ i*220 +100,button_color,game); + shapes.add(button.getShape()); + } + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(1,i,topRightX -230,topLeftY+ i*100 +460,button_color,game); + shapes.add(button.getShape()); + } + + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(0,i,topLeftX +200,topLeftY+ i*130 +200,button_color,game); + shapes.add(button.getShape()); + } + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(2,i,topLeftX +540,topLeftY+ i*130 +200,button_color,game); + shapes.add(button.getShape()); + } + + game.buttons.addAll(shapes); + for (int i = 0; i < shapes.size() ;i++ ) { + board.getChildren().add(shapes.get(i)); - } + } + + } + public void addShape(Shape newShape) { + game_board.getChildren().add(newShape); + + } // end methods diff --git a/Muehle.~ava b/Muehle.~ava index 2fc464c..208e656 100644 --- a/Muehle.~ava +++ b/Muehle.~ava @@ -29,18 +29,20 @@ public class Muehle extends Application { public void start(Stage primaryStage) { - game = new Game(); - game.start(); + Pane root = new Pane(); + game = new Game(); game_board = draw_game_board(); root.getChildren().addAll(lTop,game_board); Scene scene = new Scene(root, 1080, 820); + game.start(game_board); + //lTop.setAlignment(); setTopLabel("Test Label"); - + primaryStage.setOnCloseRequest(e -> System.exit(0)); primaryStage.setTitle("Muehle"); @@ -48,87 +50,135 @@ public class Muehle extends Application { primaryStage.show(); } // end of public Muehle public void setTopLabel(String value) { - lTop.setText(value); + lTop.setText(value); } // start methods public Pane draw_game_board() { - - Color bg_color = Color.rgb(255,255,0); - Color stroke_color = Color.RED; - Double circle_offset = 100.0; - - ArrayList shapes = new ArrayList(); - - - - - Pane board = new Pane(); - double topLeftX = (1080/2)-400; - double topLeftY = 720-(720/2)-300; - double topRightX =(1080/2)+200; - double topRightY = (720/2)+300; - - Rectangle bg = new Rectangle(topLeftX,topLeftY,topRightX,topRightY); - bg.setFill(bg_color); - shapes.add(bg); - - - Rectangle circle1 = new Rectangle(topLeftX,topLeftY,topRightX,topRightY); - circle1.setStroke(stroke_color); - circle1.setStrokeWidth(10); - circle1.setFill(new Color(0.0,0.0,0.0,0.0)); - shapes.add(circle1); - - Rectangle circle2 = new Rectangle(topLeftX + 100,topLeftY + 100,topRightX - 200,topRightY - 200); - circle2.setStroke(stroke_color); - circle2.setStrokeWidth(10); - circle2.setFill(new Color(0.0,0.0,0.0,0.0)); - shapes.add(circle2); - - Rectangle circle3 = new Rectangle(topLeftX + 200,topLeftY + 200,topRightX - 400,topRightY - 400); - circle3.setStroke(stroke_color); - circle3.setStrokeWidth(10); - circle3.setFill(new Color(0.0,0.0,0.0,0.0)); - shapes.add(circle3); - - Line line1 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topLeftY,(topLeftX+topRightX) /2 + topLeftX/2,250); - line1.setStroke(stroke_color); - line1.setStrokeWidth(10); - shapes.add(line1); - - Line line2 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topRightY+50,(topLeftX+topRightX) /2 + topLeftX/2,520); - line2.setStroke(stroke_color); - line2.setStrokeWidth(10); - shapes.add(line2); - - Line line3 = new Line(topLeftX,topRightY/2+50,topLeftX+200,topRightY/2+50); - line3.setStroke(stroke_color); - line3.setStrokeWidth(10); - shapes.add(line3); - - Line line4 = new Line(topLeftX+550,topRightY/2+50,topLeftX+200+540,topRightY/2+50); - line4.setStroke(stroke_color); - line4.setStrokeWidth(10); - shapes.add(line4); - - - MuehleButton button1 = new MuehleButton(0,0,100,100,Color.BLUE,game); - shapes.add(button1.getShape()); - - for (int i = 0; i < shapes.size() ;i++ ) { - board.getChildren().add(shapes.get(i)); - } // end of for - - - return board; + Color bg_color = Color.rgb(255,255,0); + Color stroke_color = Color.RED; + Double circle_offset = 100.0; + + ArrayList shapes = new ArrayList(); + + + + + Pane board = new Pane(); + double topLeftX = (1080/2)-400; + double topLeftY = 720-(720/2)-300; + double topRightX =(1080/2)+200; + double topRightY = (720/2)+300; + + Rectangle bg = new Rectangle(topLeftX,topLeftY,topRightX,topRightY); + bg.setFill(bg_color); + shapes.add(bg); + + + Rectangle circle1 = new Rectangle(topLeftX,topLeftY,topRightX,topRightY); + circle1.setStroke(stroke_color); + circle1.setStrokeWidth(10); + circle1.setFill(new Color(0.0,0.0,0.0,0.0)); + shapes.add(circle1); + + Rectangle circle2 = new Rectangle(topLeftX + 100,topLeftY + 100,topRightX - 200,topRightY - 200); + circle2.setStroke(stroke_color); + circle2.setStrokeWidth(10); + circle2.setFill(new Color(0.0,0.0,0.0,0.0)); + shapes.add(circle2); + + Rectangle circle3 = new Rectangle(topLeftX + 200,topLeftY + 200,topRightX - 400,topRightY - 400); + circle3.setStroke(stroke_color); + circle3.setStrokeWidth(10); + circle3.setFill(new Color(0.0,0.0,0.0,0.0)); + shapes.add(circle3); + + Line line1 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topLeftY,(topLeftX+topRightX) /2 + topLeftX/2,250); + line1.setStroke(stroke_color); + line1.setStrokeWidth(10); + shapes.add(line1); + + Line line2 = new Line((topLeftX+topRightX) /2 + topLeftX/2,topRightY+50,(topLeftX+topRightX) /2 + topLeftX/2,520); + line2.setStroke(stroke_color); + line2.setStrokeWidth(10); + shapes.add(line2); + + Line line3 = new Line(topLeftX,topRightY/2+50,topLeftX+200,topRightY/2+50); + line3.setStroke(stroke_color); + line3.setStrokeWidth(10); + shapes.add(line3); + + Line line4 = new Line(topLeftX+550,topRightY/2+50,topLeftX+200+540,topRightY/2+50); + line4.setStroke(stroke_color); + line4.setStrokeWidth(10); + shapes.add(line4); + + + + + for (int i = 0; i < shapes.size() ;i++ ) { + board.getChildren().add(shapes.get(i)); + + } // end of for + + drawMuehleButtons(board,topLeftX,topLeftY,topRightX,topRightY); + return board; + + } + + public void drawMuehleButtons(Pane board, double topLeftX,double topLeftY,double topRightX,double topRightY) { + ArrayList shapes = new ArrayList(); + Color button_color = Color.BLUE; + + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(0,i,topLeftX,topLeftY+ i*325,button_color,game); + shapes.add(button.getShape()); } + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(1,i,topRightX -230,topLeftY+ i*100,button_color,game); + shapes.add(button.getShape()); + } - public void addShape(Shape newShape) { - game_board.getChildren().add(newShape); + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(2,i,topRightX + 140,topLeftY+ i*325,button_color,game); + shapes.add(button.getShape()); + } + + + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(0,i,topLeftX + 100,topLeftY+ i*220 +100,button_color,game); + shapes.add(button.getShape()); + } + + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(2,i,topRightX +40,topLeftY+ i*220 +100,button_color,game); + shapes.add(button.getShape()); + } + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(1,i,topRightX -230,topLeftY+ i*100 +460,button_color,game); + shapes.add(button.getShape()); + } + + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(0,i,topLeftX +200,topLeftY+ i*130 +200,button_color,game); + shapes.add(button.getShape()); + } + for (int i = 0; i < 3; i++) { + MuehleButton button = new MuehleButton(2,i,topLeftX +540,topLeftY+ i*130 +200,button_color,game); + shapes.add(button.getShape()); + } + + for (int i = 0; i < shapes.size() ;i++ ) { + board.getChildren().add(shapes.get(i)); - } + } + + } + public void addShape(Shape newShape) { + game_board.getChildren().add(newShape); + + } // end methods diff --git a/Muehle.~fm b/Muehle.~fm index 92bd0a6..67ab3c9 100644 --- a/Muehle.~fm +++ b/Muehle.~fm @@ -1,4 +1,4 @@ -object FGUIForm_1: TFXGUIForm +object FGUIForm: TFXGUIForm Tag = 180 Left = 240 Top = 154 diff --git a/MuehleButton.class b/MuehleButton.class index 47119e079af7babd55b1f18611f7c9e081bd16e6..8e3f9af3d69863a756e0780f6a2e8d550207cd98 100644 GIT binary patch delta 66 zcmcc0can$e)W2Q(7#J8F8DchaePNzFn`Js9^JZh#35?3j3=u#HCWc6cC?L(kz{tSP O5DjE;fmuKX0|NkG?+ix( delta 259 zcmX@fbCr+l)W2Q(7#J8F84@>gePNaqNlZy`&dE&9b}dWIEAdFoOUX$sVq}ohm^fcr zQ!|W_fjt8zCgzi$oR|}qSd^KVl#?1#S&$k6VlXn;0~Je67H3vs(hQsYhj}I=%jRh; z6Bz3m86p@W8JHM+fc8Z)Fauc(4E$PK81yzVSOF=XZ43?@fkMm-zCe--EN#ia$6&?a z2jq)Elr#7<1ORzJjSNu?f((od(Lgp2kcNnO0a>0vHWNb((41H>D~=%^NV6~q10Bzh O0Az9j6|n