From 7aa013cc7f943488ea89e7b8c5d431397236c9ad Mon Sep 17 00:00:00 2001 From: "Malin.sieckmann" Date: Thu, 24 Jun 2021 14:44:37 +0200 Subject: [PATCH] Stone Texture floor added + added into corridor --- Zoelda/src/main/Tile.java | 11 +++++++++-- Zoelda/src/main/World.java | 14 +------------- Zoelda/src/main/maps/Corridor.java | 2 +- Zoelda/src/res/images/tiles/Test.png | Bin 0 -> 230 bytes Zoelda/src/res/images/tiles/stone_floor.png | Bin 211 -> 574 bytes .../src/res/images/tiles/stone_wall_bottom.png | Bin 342 -> 540 bytes 6 files changed, 11 insertions(+), 16 deletions(-) create mode 100644 Zoelda/src/res/images/tiles/Test.png diff --git a/Zoelda/src/main/Tile.java b/Zoelda/src/main/Tile.java index 2cb98ec..4717e5c 100644 --- a/Zoelda/src/main/Tile.java +++ b/Zoelda/src/main/Tile.java @@ -19,6 +19,7 @@ public class Tile extends Knoten { public static final int WALL_BOTTOM = 2; public static final int STONE_WALL = 3; public static final int STONE_WALL_BOTTOM = 4; + public static final int STONE_FLOOR = 5; private Bild img; // Bild, das gerendert wird private int id; // Die id dises Tiles @@ -39,11 +40,15 @@ public class Tile extends Knoten { if (id == GRASS) { buff = buff.getSubimage(16 * (int) (Math.random() * 8), 0, 16, 16); } + if (id == STONE_FLOOR) { + buff = buff.getSubimage(16 * (int) (Math.random() * 10), 0, 16, 16); + } // Skalieren BufferedImage scaled = new BufferedImage(World.SCALE, World.SCALE, BufferedImage.TYPE_INT_RGB); scaled.getGraphics().drawImage(buff, 0, 0, World.SCALE, World.SCALE, null); img = new Bild(x * World.SCALE, y * World.SCALE, scaled); - + + } catch (IOException e) { e.printStackTrace(); } @@ -63,9 +68,11 @@ public class Tile extends Knoten { case WALL_BOTTOM: return "/res/images/tiles/wall_bottom.png"; case STONE_WALL: - return "/res/images/tiles/stone_wall.png"; + return "/res/images/tiles/test.png"; case STONE_WALL_BOTTOM: return "/res/images/tiles/stone_wall_bottom.png"; + case STONE_FLOOR: + return "/res/images/tiles/Stone_floor.png"; } return null; } diff --git a/Zoelda/src/main/World.java b/Zoelda/src/main/World.java index ce2ffe7..f9d7a5d 100644 --- a/Zoelda/src/main/World.java +++ b/Zoelda/src/main/World.java @@ -21,23 +21,11 @@ public class World extends Knoten { public World() { // Map initialisieren - currentMap = new TestMap(); + currentMap = new Corridor(); // Map zu EA hinzufügen add(currentMap); - // und Entities auch - Player player = new Player(); - add(player.actionFigur); - currentMap.getEntities().add(player); - - Spider spider = new Spider(); - // und Spinnen auch - add(spider.actionFigur); - currentMap.getEntities().add(spider); - Snake snake = new Snake(); - add(snake.actionFigur); - currentMap.getEntities().add(snake); // Alle Entities als ticker registrieren (triggert dann die update methoden) for (Entity e : currentMap.getEntities()) { diff --git a/Zoelda/src/main/maps/Corridor.java b/Zoelda/src/main/maps/Corridor.java index 565f749..c2bf148 100644 --- a/Zoelda/src/main/maps/Corridor.java +++ b/Zoelda/src/main/maps/Corridor.java @@ -17,7 +17,7 @@ public class Corridor extends Map { add(map[x][y]); } else { - map[x][y] = new Tile(0, x, y); + map[x][y] = new Tile(5, x, y); add(map[x][y]); } } diff --git a/Zoelda/src/res/images/tiles/Test.png b/Zoelda/src/res/images/tiles/Test.png new file mode 100644 index 0000000000000000000000000000000000000000..ba2cd98901ffe15f8f826ce31d3aaa8a583fddbb GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ydu{YLoEE0LqaeAIq$%jux8aN zC&PrVv%VHQc5-Iolsfz3`SbRqhQ2;N<`V)Fo@s}#n~>kItWC@B?EL*TtfxPIDllHK zgF)rvlat0f+-lkmh!_Uh3KZ^?4u6ouqI8BKAVG;;Y2ATV>4tTTv%S~d-_a{*EurVY zmzd)0Fe{P4vS6ij$C71E6S@QTIAm!ZFS->P)000mO1^@s6kp*;E00009a7bBm001r{ z001r{0eGc9b^rhX8hTV%bW~|{Y-Iod2$>5m$AF9HA>!vu@Bk*MMT0019) zR9JLDb#!QNasU7bne$D|$;?v-&P+|t&P~kA0{|<+1*_&#-%$Vn0iQ`kK~!i%?V2%) zgfJ9_Gs~7XqM(J1Sa|>&!P>?Xco(nZ3A}-&2e1+mM6j|E+g)BDuA}Z~qE&o>!C~_L z2l?}nosJvdfT6f%w@f#+Uh zKsk=H>CUoj{w<24`8%8;5x@sSB{KA37)aN3R60!)(RKYT&E9qk&;f+-T=ye@BC{Z| z=F|H=w)(MxgjK<3?bw6!>#P{#k literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!3<9q#}Etukx)D9Y0 zG92Z8B4OkqEToz6fTzLL`tiHJ?SVl`nGKDM44d~FpS~xY+X}Rk!PC{xWt~$(696Ox BKOX=9 diff --git a/Zoelda/src/res/images/tiles/stone_wall_bottom.png b/Zoelda/src/res/images/tiles/stone_wall_bottom.png index 21d5f5c18b8846188ac5e3060d5a0932840f2038..587818397446fe3df343b8afe29ed762a56c939d 100644 GIT binary patch delta 515 zcmV+e0{s2f0-OYpBYyx1a7bBm001r{001r{0eGc9b^rhXAbM0-bW~|{Y-Iod2$?G` z$Pt287uxg(d};gV zeuytV*GK??z0jFKEUifs(~gjACVOr(sGgo*IzS-=kMp?(mr_8QrqJ3@KS*!r%YhK| z5DL(IQF>j6D2h;3XBcBJF%xK`ui$S7x*NKlSm$|8;GQ-FIiPJCSZj%pHTvQ^?5x-A z1%+U>THmOU5r4WIORND{*9};#u4{^>u~;lHpH11p2}zPjR#qJ zG(kh|Vp4FRVq@fP6p@75iN37C(+h0ZwNrvUw)X zSov!XeQxfskj$Vc3L%K&7+E$)+gf-RXd4x+wYm;4C44gHJ;iKgTa4$K6G3^|0x0iz zXb{q&c)jCdXFNCk{`M+1f3Ar4JPc1!EJNP}PoF_7WUZ4S>*ewRhr@(VJ~-&aQr z1R=emD0BmCnq^tEi4Xt*+4p_Doinx&VF?H|!HikgRoC0ac;meL=L{SnTTnlrPt8FP zh~d}pU_27uAvOQ4S)V=-9*^(z2nBq6p5;iGBVx2B_`1uH_y^pNKjJrBv-mvnu@xc! O0000