Changes to integrate new wall

This commit is contained in:
Malin.sieckmann
2021-06-23 20:25:45 +02:00
parent 956e4e1d7e
commit f3a133219c
4 changed files with 8 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ public class Tile extends Knoten {
public static final int GRASS = 0;
public static final int WALL_TOP = 1;
public static final int WALL_BOTTOM = 2;
public static final int STONE_WALL = 3;
private Bild img; // Bild, das gerendert wird
private int id; // Die id dises Tiles
@@ -60,6 +61,8 @@ public class Tile extends Knoten {
return "/res/images/tiles/wall_top.png";
case WALL_BOTTOM:
return "/res/images/tiles/wall_bottom.png";
case STONE_WALL:
return "/res/images/tiles/stone_wall.png";
}
return null;
}
@@ -77,7 +80,7 @@ public class Tile extends Knoten {
public boolean isCollidable() {
// Alle Tiles durch die man nicht laufen soll müssen hier true zurückgeben,
// sonst werden sie bei der Collisiondetection nicht berücksichtigt.
return id == WALL_TOP;
return id == WALL_TOP || id == STONE_WALL ;
}
/**

View File

@@ -5,6 +5,7 @@ import java.util.ArrayList;
import ea.Knoten;
import main.entities.Entity;
import main.entities.Player;
import main.maps.Corridor;
import main.entities.Spider;
import main.maps.Map;
import main.maps.TestMap;
@@ -14,6 +15,7 @@ import main.maps.TestMap;
*/
public class World extends Knoten {
public static final int SCALE_FACTOR = 4; // Der Basis Zoomfaktor
public static final int SCALE = SCALE_FACTOR * Tile.getSize(); // Eine Gameunit ist so viele pixel lang
@@ -25,8 +27,8 @@ public class World extends Knoten {
entities = new ArrayList<>(100);
// Map initialisieren
currentMap = new TestMap();
// Map zu EA hinzufügen
currentMap = new Corridor();
// Map zu EA hinzuf<EFBFBD>gen
add(currentMap);
// und Entities auch

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B