left door added/ improved, 3D wall added, shadow added
@@ -22,9 +22,12 @@ public class Tile extends Knoten {
|
|||||||
public static final int STONE_WALL_BOTTOM = 4;
|
public static final int STONE_WALL_BOTTOM = 4;
|
||||||
public static final int STONE_FLOOR = 5;
|
public static final int STONE_FLOOR = 5;
|
||||||
public static final int DOOR = 6;
|
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 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
|
protected float posX, posY; // Position dieses Tiles
|
||||||
|
|
||||||
private static Bild[] images;
|
private static Bild[] images;
|
||||||
@@ -53,7 +56,7 @@ public class Tile extends Knoten {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void loadImages() {
|
private static void loadImages() {
|
||||||
images = new Bild[7];
|
images = new Bild[10];
|
||||||
for (int i = 0; i < images.length; i++) {
|
for (int i = 0; i < images.length; i++) {
|
||||||
try {
|
try {
|
||||||
BufferedImage buff = ImageIO.read(Tile.class.getResourceAsStream(getPathFromId(i)));
|
BufferedImage buff = ImageIO.read(Tile.class.getResourceAsStream(getPathFromId(i)));
|
||||||
@@ -62,9 +65,6 @@ public class Tile extends Knoten {
|
|||||||
if (i == GRASS) {
|
if (i == GRASS) {
|
||||||
buff = buff.getSubimage(16 * (int) (Math.random() * 8), 0, 16, 16);
|
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
|
// Skalieren
|
||||||
BufferedImage scaled = new BufferedImage(World.SCALE, World.SCALE, BufferedImage.TYPE_INT_RGB);
|
BufferedImage scaled = new BufferedImage(World.SCALE, World.SCALE, BufferedImage.TYPE_INT_RGB);
|
||||||
scaled.getGraphics().drawImage(buff, 0, 0, World.SCALE, World.SCALE, null);
|
scaled.getGraphics().drawImage(buff, 0, 0, World.SCALE, World.SCALE, null);
|
||||||
@@ -93,7 +93,13 @@ public class Tile extends Knoten {
|
|||||||
case STONE_FLOOR:
|
case STONE_FLOOR:
|
||||||
return "/res/images/tiles/TestTest.png";
|
return "/res/images/tiles/TestTest.png";
|
||||||
case DOOR:
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class World extends Knoten {
|
|||||||
|
|
||||||
dungeon = new ArrayList<>(50);
|
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);
|
dungeon.add(start);
|
||||||
currentMap = start;
|
currentMap = start;
|
||||||
currentMap.start();
|
currentMap.start();
|
||||||
|
|||||||
@@ -13,9 +13,13 @@ import main.Tile;
|
|||||||
|
|
||||||
public class ImageMap extends Map {
|
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)),
|
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.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 topDoor;
|
||||||
public DoorTile leftDoor;
|
public DoorTile leftDoor;
|
||||||
@@ -27,7 +31,8 @@ public class ImageMap extends Map {
|
|||||||
static {
|
static {
|
||||||
maps = new ImageMap[8];
|
maps = new ImageMap[8];
|
||||||
for (int i = 0; i < maps.length; i++) {
|
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;
|
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);
|
DoorTile door = new DoorTile(x, y, this);
|
||||||
tiles[x][y] = door;
|
tiles[x][y] = door;
|
||||||
if (x == 7) {
|
if (x == 7) {
|
||||||
|
|||||||
BIN
Zoelda/src/res/images/maps/map1a.png
Normal file
|
After Width: | Height: | Size: 223 B |
BIN
Zoelda/src/res/images/maps/map2a.png
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
Zoelda/src/res/images/maps/map2a.png~
Normal file
|
After Width: | Height: | Size: 232 B |
BIN
Zoelda/src/res/images/maps/map3a.png
Normal file
|
After Width: | Height: | Size: 217 B |
BIN
Zoelda/src/res/images/maps/map4a.png
Normal file
|
After Width: | Height: | Size: 208 B |
BIN
Zoelda/src/res/images/maps/map5a.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
Zoelda/src/res/images/maps/map6a.png
Normal file
|
After Width: | Height: | Size: 193 B |
BIN
Zoelda/src/res/images/maps/map7a.png
Normal file
|
After Width: | Height: | Size: 203 B |
BIN
Zoelda/src/res/images/maps/map8a.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
Zoelda/src/res/images/red-potion.png
Normal file
|
After Width: | Height: | Size: 593 B |
BIN
Zoelda/src/res/images/tiles/.stone_wall_bottom.png-autosave.kra
Normal file
BIN
Zoelda/src/res/images/tiles/adswaw.png
Normal file
|
After Width: | Height: | Size: 545 B |
|
Before Width: | Height: | Size: 227 B |
BIN
Zoelda/src/res/images/tiles/door_left.png
Normal file
|
After Width: | Height: | Size: 523 B |
BIN
Zoelda/src/res/images/tiles/door_left_bottom.png
Normal file
|
After Width: | Height: | Size: 351 B |
BIN
Zoelda/src/res/images/tiles/door_left_top.png
Normal file
|
After Width: | Height: | Size: 502 B |
BIN
Zoelda/src/res/images/tiles/door_right.png
Normal file
|
After Width: | Height: | Size: 535 B |
BIN
Zoelda/src/res/images/tiles/door_top.png
Normal file
|
After Width: | Height: | Size: 276 B |
BIN
Zoelda/src/res/images/tiles/stone_floor_shadow_left.png
Normal file
|
After Width: | Height: | Size: 151 B |
|
Before Width: | Height: | Size: 545 B After Width: | Height: | Size: 450 B |