diff --git a/Zoelda/src/main/Tile.java b/Zoelda/src/main/Tile.java index 281e5fc..f91154e 100644 --- a/Zoelda/src/main/Tile.java +++ b/Zoelda/src/main/Tile.java @@ -22,9 +22,12 @@ public class Tile extends Knoten { public static final int STONE_WALL_BOTTOM = 4; public static final int STONE_FLOOR = 5; public static final int DOOR = 6; - + public static final int STONE_FLOOR_SHADOW_LEFT = 7; + public static final int DOOR_LEFT_BOTTOM = 8; + public static final int DOOR_LEFT_TOP = 9; + private Bild img; // Bild, das gerendert wird - private int id; // Die id dises Tiles + private int id; // Die id dises Tiles// protected float posX, posY; // Position dieses Tiles private static Bild[] images; @@ -53,7 +56,7 @@ public class Tile extends Knoten { } private static void loadImages() { - images = new Bild[7]; + images = new Bild[10]; for (int i = 0; i < images.length; i++) { try { BufferedImage buff = ImageIO.read(Tile.class.getResourceAsStream(getPathFromId(i))); @@ -62,9 +65,6 @@ public class Tile extends Knoten { if (i == 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); @@ -93,7 +93,13 @@ public class Tile extends Knoten { case STONE_FLOOR: return "/res/images/tiles/TestTest.png"; case DOOR: - return "/res/images/tiles/door.png"; + return "/res/images/tiles/door_left_bottom.png"; + case STONE_FLOOR_SHADOW_LEFT: + return "/res/images/tiles/stone_floor_shadow_left.png"; + case DOOR_LEFT_BOTTOM: + return "/res/images/tiles/door_left_bottom.png"; + case DOOR_LEFT_TOP: + return "/res/images/tiles/door_left_top.png"; } return null; } diff --git a/Zoelda/src/main/World.java b/Zoelda/src/main/World.java index 38be69e..68d6139 100644 --- a/Zoelda/src/main/World.java +++ b/Zoelda/src/main/World.java @@ -24,7 +24,7 @@ public class World extends Knoten { dungeon = new ArrayList<>(50); - ImageMap start = new ImageMap("/res/images/maps/map2.png"); + ImageMap start = new ImageMap("/res/images/maps/map2a.png"); dungeon.add(start); currentMap = start; start.generate(dungeon, DoorTile.BOTTOM); diff --git a/Zoelda/src/main/maps/ImageMap.java b/Zoelda/src/main/maps/ImageMap.java index 9d2a92f..24f0e93 100644 --- a/Zoelda/src/main/maps/ImageMap.java +++ b/Zoelda/src/main/maps/ImageMap.java @@ -13,9 +13,13 @@ import main.Tile; public class ImageMap extends Map { + //Erstellung der abzulesenden Tiles (einem Tile wird eine farbe zugewiesen) + private static PixelTile[] pixels = { new PixelTile(Tile.STONE_WALL, new Color(100, 100, 100)), new PixelTile(Tile.STONE_FLOOR, new Color(127, 127, 127)), new PixelTile(Tile.VOID, new Color(0, 0, 0)), - new PixelTile(Tile.DOOR, new Color(255, 0, 0)) }; + new PixelTile(Tile.DOOR, new Color(255, 0, 0)), new PixelTile(Tile.DOOR_LEFT_TOP, new Color(255, 150, 0)) , + new PixelTile(Tile.DOOR_LEFT_BOTTOM, new Color(69, 150, 0)), new PixelTile(Tile.STONE_WALL_BOTTOM, new Color(145, 145, 145)), + new PixelTile(Tile.STONE_FLOOR_SHADOW_LEFT, new Color(251, 251, 129))}; public DoorTile topDoor; public DoorTile leftDoor; @@ -27,7 +31,8 @@ public class ImageMap extends Map { static { maps = new ImageMap[8]; for (int i = 0; i < maps.length; i++) { - maps[i] = new ImageMap("/res/images/maps/map" + (i + 1) + ".png"); + System.out.println("/res/images/maps/map" + (i + 1) + "a.png"); + maps[i] = new ImageMap("/res/images/maps/map" + (i + 1) + "a.png"); } } @@ -49,7 +54,14 @@ public class ImageMap extends Map { break; } } - if (id == Tile.DOOR) { + if (id == Tile.DOOR_LEFT_BOTTOM) { + DoorTile door = new DoorTile(x, y, this); + tiles[x][y] = door; + leftDoor = door; + door.setSide(DoorTile.LEFT); + } + + if (id == Tile.DOOR ) { DoorTile door = new DoorTile(x, y, this); tiles[x][y] = door; if (x == 7) { diff --git a/Zoelda/src/res/images/maps/map1a.png b/Zoelda/src/res/images/maps/map1a.png new file mode 100644 index 0000000..7901ac1 Binary files /dev/null and b/Zoelda/src/res/images/maps/map1a.png differ diff --git a/Zoelda/src/res/images/maps/map2a.png b/Zoelda/src/res/images/maps/map2a.png new file mode 100644 index 0000000..97d10c9 Binary files /dev/null and b/Zoelda/src/res/images/maps/map2a.png differ diff --git a/Zoelda/src/res/images/maps/map2a.png~ b/Zoelda/src/res/images/maps/map2a.png~ new file mode 100644 index 0000000..8ddc8f1 Binary files /dev/null and b/Zoelda/src/res/images/maps/map2a.png~ differ diff --git a/Zoelda/src/res/images/maps/map3a.png b/Zoelda/src/res/images/maps/map3a.png new file mode 100644 index 0000000..102ac9e Binary files /dev/null and b/Zoelda/src/res/images/maps/map3a.png differ diff --git a/Zoelda/src/res/images/maps/map4a.png b/Zoelda/src/res/images/maps/map4a.png new file mode 100644 index 0000000..ccf161a Binary files /dev/null and b/Zoelda/src/res/images/maps/map4a.png differ diff --git a/Zoelda/src/res/images/maps/map5a.png b/Zoelda/src/res/images/maps/map5a.png new file mode 100644 index 0000000..468cb45 Binary files /dev/null and b/Zoelda/src/res/images/maps/map5a.png differ diff --git a/Zoelda/src/res/images/maps/map6a.png b/Zoelda/src/res/images/maps/map6a.png new file mode 100644 index 0000000..68f87a5 Binary files /dev/null and b/Zoelda/src/res/images/maps/map6a.png differ diff --git a/Zoelda/src/res/images/maps/map7a.png b/Zoelda/src/res/images/maps/map7a.png new file mode 100644 index 0000000..58f39dd Binary files /dev/null and b/Zoelda/src/res/images/maps/map7a.png differ diff --git a/Zoelda/src/res/images/maps/map8a.png b/Zoelda/src/res/images/maps/map8a.png new file mode 100644 index 0000000..91b19ba Binary files /dev/null and b/Zoelda/src/res/images/maps/map8a.png differ diff --git a/Zoelda/src/res/images/red-potion.png b/Zoelda/src/res/images/red-potion.png new file mode 100644 index 0000000..3b41eb8 Binary files /dev/null and b/Zoelda/src/res/images/red-potion.png differ diff --git a/Zoelda/src/res/images/tiles/.stone_wall_bottom.png-autosave.kra b/Zoelda/src/res/images/tiles/.stone_wall_bottom.png-autosave.kra new file mode 100644 index 0000000..570d716 Binary files /dev/null and b/Zoelda/src/res/images/tiles/.stone_wall_bottom.png-autosave.kra differ diff --git a/Zoelda/src/res/images/tiles/adswaw.png b/Zoelda/src/res/images/tiles/adswaw.png new file mode 100644 index 0000000..5279d0f Binary files /dev/null and b/Zoelda/src/res/images/tiles/adswaw.png differ diff --git a/Zoelda/src/res/images/tiles/door.png b/Zoelda/src/res/images/tiles/door.png deleted file mode 100644 index 92edddf..0000000 Binary files a/Zoelda/src/res/images/tiles/door.png and /dev/null differ diff --git a/Zoelda/src/res/images/tiles/door_left.png b/Zoelda/src/res/images/tiles/door_left.png new file mode 100644 index 0000000..d7d493a Binary files /dev/null and b/Zoelda/src/res/images/tiles/door_left.png differ diff --git a/Zoelda/src/res/images/tiles/door_left_bottom.png b/Zoelda/src/res/images/tiles/door_left_bottom.png new file mode 100644 index 0000000..99d077d Binary files /dev/null and b/Zoelda/src/res/images/tiles/door_left_bottom.png differ diff --git a/Zoelda/src/res/images/tiles/door_left_top.png b/Zoelda/src/res/images/tiles/door_left_top.png new file mode 100644 index 0000000..03027ec Binary files /dev/null and b/Zoelda/src/res/images/tiles/door_left_top.png differ diff --git a/Zoelda/src/res/images/tiles/door_right.png b/Zoelda/src/res/images/tiles/door_right.png new file mode 100644 index 0000000..f2a31e7 Binary files /dev/null and b/Zoelda/src/res/images/tiles/door_right.png differ diff --git a/Zoelda/src/res/images/tiles/door_top.png b/Zoelda/src/res/images/tiles/door_top.png new file mode 100644 index 0000000..d1d85fe Binary files /dev/null and b/Zoelda/src/res/images/tiles/door_top.png differ diff --git a/Zoelda/src/res/images/tiles/stone_floor_shadow_left.png b/Zoelda/src/res/images/tiles/stone_floor_shadow_left.png new file mode 100644 index 0000000..e085985 Binary files /dev/null and b/Zoelda/src/res/images/tiles/stone_floor_shadow_left.png differ diff --git a/Zoelda/src/res/images/tiles/stone_wall_bottom.png b/Zoelda/src/res/images/tiles/stone_wall_bottom.png index 5279d0f..7e842b5 100644 Binary files a/Zoelda/src/res/images/tiles/stone_wall_bottom.png and b/Zoelda/src/res/images/tiles/stone_wall_bottom.png differ