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 0000000..ba2cd98 Binary files /dev/null and b/Zoelda/src/res/images/tiles/Test.png differ diff --git a/Zoelda/src/res/images/tiles/stone_floor.png b/Zoelda/src/res/images/tiles/stone_floor.png index 5638a31..70eadc3 100644 Binary files a/Zoelda/src/res/images/tiles/stone_floor.png and b/Zoelda/src/res/images/tiles/stone_floor.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 21d5f5c..5878183 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