Commit b620fd6a authored by cbeausei's avatar cbeausei

Map generation + graphics

Black Image added
In map generation, try to avoid having corridors starting at corners of
a room
parent f2107273
......@@ -102,7 +102,7 @@ public class SpriteLoader {
wallTileBImage1 = ImageIO.read(getClass().getResource("/assets/dungeon_set_1/walls/0150_top_wall_horz.bmp"));
stairsTileBImage1 = ImageIO.read(getClass().getResource("/assets/dungeon_set_1/stairs/stairs2.bmp"));
// errorTileBImage = ImageIO.read(getClass().getResource("/assets/ErrorTile_64_64.png"));
errorTileBImage = ImageIO.read(getClass().getResource("/assets/Test_Error_Tiles/mauve_degrade_64_64.png"));
errorTileBImage = ImageIO.read(getClass().getResource("/assets/Test_Error_Tiles/black_64_64.bmp"));
} catch (IOException e) {
e.printStackTrace();
......
......@@ -54,8 +54,8 @@ public class BasicMapGenerators {
}
private static int distanceBetweenTwoSurface(Surface surface1,Surface surface2) {
int dY=max(surface1.y1-surface2.y2+1,0)+max(surface2.y1-surface1.y2+1,0);
int dX=max(surface1.x1-surface2.x2+1,0)+max(surface2.x1-surface1.x2+1,0);
int dY=max(surface1.y1-surface2.y2+2,0)+max(surface2.y1-surface1.y2+2,0);
int dX=max(surface1.x1-surface2.x2+2,0)+max(surface2.x1-surface1.x2+2,0);
if (dY>0 && dX>0) return (dX+dY+6);
else return (dX+dY);
......@@ -63,8 +63,8 @@ public class BasicMapGenerators {
private static LinkedList<Surface> creationCorridor(Surface room1,Surface room2) {
int dNorth=max(room2.y1-room1.y2-1,0);
int dY=max(room2.y1-room1.y2+1,0)+max(room1.y1-room2.y2+1,0);
int dX=max(room2.x1-room1.x2+1,0)+max(room1.x1-room2.x2+1,0);
int dY=max(room2.y1-room1.y2+2,0)+max(room1.y1-room2.y2+2,0);
int dX=max(room2.x1-room1.x2+2,0)+max(room1.x1-room2.x2+2,0);
LinkedList<Surface> corridors=new LinkedList<>();
//System.out.println("dX="+dX+" dY="+dY);
if (dX==0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment