diff --git a/.gitignore b/.gitignore index 2f4698c..6220630 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ ### IntelliJ IDEA ### out/ +.idea/ +*.iml !**/src/main/**/out/ !**/src/test/**/out/ .kotlin @@ -25,7 +27,6 @@ bin/ ### VS Code ### .vscode/ -.idea/ ### Mac OS ### .DS_Store \ No newline at end of file diff --git a/assets/maps/testmap2.map b/assets/maps/testmap2.map new file mode 100644 index 0000000..e74591e --- /dev/null +++ b/assets/maps/testmap2.map @@ -0,0 +1,50 @@ +12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 13 12 12 12 12 12 12 13 12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 13 12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 13 12 12 13 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 13 12 12 12 12 12 12 13 12 12 12 12 12 12 13 12 12 12 12 12 12 +12 12 12 12 12 13 22 20 20 20 20 20 20 20 23 12 12 12 22 20 20 20 20 20 20 20 20 23 12 12 12 22 20 20 20 20 20 20 20 20 20 20 23 12 12 12 12 12 12 12 +12 12 12 12 12 12 18 41 40 40 40 40 40 41 19 20 20 20 21 41 10 10 11 10 10 10 10 19 20 20 20 21 41 10 35 33 33 33 33 33 33 36 17 12 12 13 12 12 12 12 +12 12 13 12 12 12 18 41 40 39 39 39 40 41 41 41 41 41 41 41 10 14 15 15 15 16 10 41 41 41 41 41 41 41 31 26 26 26 26 26 26 30 17 12 12 12 12 12 12 12 +12 12 12 12 12 12 18 41 40 39 39 39 40 41 41 41 41 41 41 41 10 17 12 12 12 18 10 41 41 41 41 41 41 41 31 26 26 26 26 26 26 30 17 12 12 12 12 12 12 12 +12 12 12 13 12 12 18 41 40 39 39 39 40 41 41 41 41 41 41 41 10 17 12 12 12 18 11 41 41 41 41 41 41 41 31 26 26 26 26 26 26 30 17 12 13 12 12 12 12 12 +12 12 12 12 13 12 18 41 40 39 39 39 40 41 41 41 41 41 41 41 10 19 20 20 20 21 10 41 41 41 41 41 41 41 31 26 26 26 26 26 26 30 17 12 12 12 12 12 12 12 +12 12 12 12 12 12 18 41 40 40 39 40 40 41 41 41 41 41 41 41 11 10 35 33 36 10 10 41 41 41 41 41 41 41 37 28 28 29 26 27 28 38 17 13 12 12 12 12 12 12 +12 12 12 12 12 12 18 41 41 41 10 41 41 41 41 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 41 41 31 26 30 14 15 25 12 12 12 12 12 12 12 +12 12 12 12 13 12 18 41 41 41 10 41 41 41 41 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 41 41 31 26 30 17 12 12 12 12 13 12 12 12 12 +12 12 12 12 12 12 24 15 16 41 10 41 41 41 41 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 41 41 31 26 30 17 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 12 18 41 10 41 41 41 41 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 41 41 31 26 30 17 12 12 12 12 12 13 12 12 12 +12 12 13 12 12 12 12 22 21 41 10 41 41 41 41 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 35 33 34 26 30 17 12 12 13 12 12 12 12 12 12 +12 12 12 12 12 12 12 18 10 10 10 41 41 41 41 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 31 26 26 26 30 17 12 12 12 12 12 12 12 12 12 +12 12 12 13 12 12 12 18 10 41 41 41 41 41 41 41 41 41 41 41 41 10 31 26 30 10 41 41 41 41 41 41 41 41 41 31 26 27 28 38 17 12 13 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 18 10 41 41 41 10 35 33 33 33 33 33 33 33 33 34 26 32 33 33 33 33 33 33 33 33 33 33 34 26 30 10 41 17 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 13 12 18 10 41 41 41 11 31 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 30 10 14 25 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 13 18 10 10 41 41 10 37 28 28 28 28 28 28 28 28 29 26 27 28 28 28 28 28 28 28 28 28 28 29 26 30 10 17 12 13 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 24 16 10 41 41 10 41 41 41 41 41 41 41 41 10 31 26 30 10 41 41 41 41 41 41 41 41 41 31 26 30 10 17 12 12 12 12 13 12 12 12 12 12 +12 12 12 12 12 12 12 12 18 10 41 41 10 41 41 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 31 26 30 11 17 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 13 12 22 21 10 41 41 10 10 10 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 31 26 30 10 17 12 12 12 13 12 12 12 12 12 12 +12 12 12 12 12 12 12 18 10 10 41 41 41 41 10 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 31 26 30 10 17 12 12 12 12 12 12 12 12 12 12 +12 12 12 13 12 12 12 18 10 41 41 41 41 41 10 41 41 41 41 41 41 41 31 26 30 41 41 10 41 41 41 41 41 41 41 31 26 30 10 17 12 13 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 18 10 41 41 41 41 41 10 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 10 41 41 41 41 31 26 30 10 17 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 13 18 10 10 10 10 10 10 10 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 10 41 41 41 41 37 28 38 10 17 12 12 12 12 13 12 12 12 12 12 +12 12 12 12 12 12 12 18 10 10 11 10 10 10 10 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 41 10 41 14 25 12 12 13 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 24 16 10 10 10 10 10 10 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 10 10 10 17 12 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 13 12 12 18 10 10 10 10 11 10 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 10 10 10 17 12 12 12 12 12 12 12 13 12 12 12 +12 12 12 12 12 12 12 12 18 11 10 10 10 10 10 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 10 10 11 17 12 12 13 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 12 18 10 10 10 10 10 10 41 41 41 41 41 41 41 31 26 30 41 41 41 41 41 41 41 41 41 41 10 10 10 17 12 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 13 12 12 22 21 41 41 41 41 41 41 41 41 41 41 41 41 41 37 28 38 41 41 41 41 41 41 41 41 41 41 11 10 10 19 23 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 18 41 41 41 41 41 41 41 41 41 41 41 10 10 10 10 10 10 10 10 41 41 41 41 41 41 41 10 10 10 10 10 19 23 12 12 12 13 12 12 12 12 12 +12 12 12 12 12 12 13 18 41 41 41 41 41 41 41 41 41 41 10 10 10 10 10 10 10 10 10 10 41 41 10 41 41 10 10 10 10 10 10 10 17 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 18 10 41 41 41 41 41 41 41 41 41 10 11 10 10 10 10 10 11 10 10 41 41 41 41 10 10 10 10 10 11 10 10 17 12 13 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 18 10 41 41 41 41 10 41 41 41 41 10 10 11 10 10 10 10 10 10 10 10 41 41 41 10 10 10 10 10 41 10 10 17 12 12 12 12 12 12 12 12 12 +12 12 13 12 12 12 12 18 10 41 41 41 41 41 41 41 41 41 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 41 10 10 10 10 10 17 12 12 12 12 13 12 12 12 12 +12 12 12 12 12 12 12 18 10 41 41 41 41 10 41 14 15 15 16 10 10 10 10 10 11 10 10 14 15 15 16 10 10 10 10 10 10 10 11 10 17 12 12 12 12 12 12 13 12 12 +12 12 12 12 12 12 12 18 41 41 41 41 41 41 14 25 12 12 24 16 10 10 10 10 10 10 14 25 12 12 18 10 10 41 10 10 41 10 10 10 17 12 12 12 12 12 12 12 12 12 +12 12 12 12 13 12 12 24 15 15 15 15 15 15 25 12 12 12 12 24 15 15 15 15 15 15 25 12 13 12 24 16 10 11 10 10 10 10 14 15 25 12 13 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 12 24 15 15 15 15 15 15 25 12 12 12 12 12 12 12 13 12 12 12 +12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 12 13 12 12 12 12 12 12 +12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 +12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 12 12 12 12 +12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 \ No newline at end of file diff --git a/assets/tiles/earth.png b/assets/tiles/earth.png index 9255b38..b0fa299 100644 Binary files a/assets/tiles/earth.png and b/assets/tiles/earth.png differ diff --git a/assets/tiles/floor01.png b/assets/tiles/floor01.png new file mode 100644 index 0000000..a5baf5c Binary files /dev/null and b/assets/tiles/floor01.png differ diff --git a/assets/tiles/grass.png b/assets/tiles/grass.png deleted file mode 100644 index 8a1892f..0000000 Binary files a/assets/tiles/grass.png and /dev/null differ diff --git a/assets/tiles/grass00.png b/assets/tiles/grass00.png new file mode 100644 index 0000000..c7287dc Binary files /dev/null and b/assets/tiles/grass00.png differ diff --git a/assets/tiles/grass01.png b/assets/tiles/grass01.png new file mode 100644 index 0000000..3e503c3 Binary files /dev/null and b/assets/tiles/grass01.png differ diff --git a/assets/tiles/hut.png b/assets/tiles/hut.png new file mode 100644 index 0000000..a991a5d Binary files /dev/null and b/assets/tiles/hut.png differ diff --git a/assets/tiles/road00.png b/assets/tiles/road00.png new file mode 100644 index 0000000..ab98ed1 Binary files /dev/null and b/assets/tiles/road00.png differ diff --git a/assets/tiles/road01.png b/assets/tiles/road01.png new file mode 100644 index 0000000..2d4ef1d Binary files /dev/null and b/assets/tiles/road01.png differ diff --git a/assets/tiles/road02.png b/assets/tiles/road02.png new file mode 100644 index 0000000..dd6b0f2 Binary files /dev/null and b/assets/tiles/road02.png differ diff --git a/assets/tiles/road03.png b/assets/tiles/road03.png new file mode 100644 index 0000000..8d8aee2 Binary files /dev/null and b/assets/tiles/road03.png differ diff --git a/assets/tiles/road04.png b/assets/tiles/road04.png new file mode 100644 index 0000000..3324550 Binary files /dev/null and b/assets/tiles/road04.png differ diff --git a/assets/tiles/road05.png b/assets/tiles/road05.png new file mode 100644 index 0000000..1c9df82 Binary files /dev/null and b/assets/tiles/road05.png differ diff --git a/assets/tiles/road06.png b/assets/tiles/road06.png new file mode 100644 index 0000000..d7b7dbc Binary files /dev/null and b/assets/tiles/road06.png differ diff --git a/assets/tiles/road07.png b/assets/tiles/road07.png new file mode 100644 index 0000000..3efa81d Binary files /dev/null and b/assets/tiles/road07.png differ diff --git a/assets/tiles/road08.png b/assets/tiles/road08.png new file mode 100644 index 0000000..787f529 Binary files /dev/null and b/assets/tiles/road08.png differ diff --git a/assets/tiles/road09.png b/assets/tiles/road09.png new file mode 100644 index 0000000..8c0b4b1 Binary files /dev/null and b/assets/tiles/road09.png differ diff --git a/assets/tiles/road10.png b/assets/tiles/road10.png new file mode 100644 index 0000000..4dacc1b Binary files /dev/null and b/assets/tiles/road10.png differ diff --git a/assets/tiles/road11.png b/assets/tiles/road11.png new file mode 100644 index 0000000..dc400b2 Binary files /dev/null and b/assets/tiles/road11.png differ diff --git a/assets/tiles/road12.png b/assets/tiles/road12.png new file mode 100644 index 0000000..7ae8b1a Binary files /dev/null and b/assets/tiles/road12.png differ diff --git a/assets/tiles/table01.png b/assets/tiles/table01.png new file mode 100644 index 0000000..010ec75 Binary files /dev/null and b/assets/tiles/table01.png differ diff --git a/assets/tiles/tree.png b/assets/tiles/tree.png index b0d91ba..ffebd35 100644 Binary files a/assets/tiles/tree.png and b/assets/tiles/tree.png differ diff --git a/assets/tiles/wall.png b/assets/tiles/wall.png index d5f04bf..77b1221 100644 Binary files a/assets/tiles/wall.png and b/assets/tiles/wall.png differ diff --git a/assets/tiles/water.png b/assets/tiles/water.png deleted file mode 100644 index 7f48fd6..0000000 Binary files a/assets/tiles/water.png and /dev/null differ diff --git a/assets/tiles/water00.png b/assets/tiles/water00.png new file mode 100644 index 0000000..f245736 Binary files /dev/null and b/assets/tiles/water00.png differ diff --git a/assets/tiles/water01.png b/assets/tiles/water01.png new file mode 100644 index 0000000..0ed1e69 Binary files /dev/null and b/assets/tiles/water01.png differ diff --git a/assets/tiles/water02.png b/assets/tiles/water02.png new file mode 100644 index 0000000..b72a068 Binary files /dev/null and b/assets/tiles/water02.png differ diff --git a/assets/tiles/water03.png b/assets/tiles/water03.png new file mode 100644 index 0000000..2770eb3 Binary files /dev/null and b/assets/tiles/water03.png differ diff --git a/assets/tiles/water04.png b/assets/tiles/water04.png new file mode 100644 index 0000000..8ea63ce Binary files /dev/null and b/assets/tiles/water04.png differ diff --git a/assets/tiles/water05.png b/assets/tiles/water05.png new file mode 100644 index 0000000..deeeeb8 Binary files /dev/null and b/assets/tiles/water05.png differ diff --git a/assets/tiles/water06.png b/assets/tiles/water06.png new file mode 100644 index 0000000..719c4b0 Binary files /dev/null and b/assets/tiles/water06.png differ diff --git a/assets/tiles/water07.png b/assets/tiles/water07.png new file mode 100644 index 0000000..75c25de Binary files /dev/null and b/assets/tiles/water07.png differ diff --git a/assets/tiles/water08.png b/assets/tiles/water08.png new file mode 100644 index 0000000..fd2879e Binary files /dev/null and b/assets/tiles/water08.png differ diff --git a/assets/tiles/water09.png b/assets/tiles/water09.png new file mode 100644 index 0000000..37989ca Binary files /dev/null and b/assets/tiles/water09.png differ diff --git a/assets/tiles/sand.png b/assets/tiles/water10.png similarity index 61% rename from assets/tiles/sand.png rename to assets/tiles/water10.png index 10971d4..31f6c40 100644 Binary files a/assets/tiles/sand.png and b/assets/tiles/water10.png differ diff --git a/assets/tiles/water11.png b/assets/tiles/water11.png new file mode 100644 index 0000000..58b6b45 Binary files /dev/null and b/assets/tiles/water11.png differ diff --git a/assets/tiles/water12.png b/assets/tiles/water12.png new file mode 100644 index 0000000..a3b143b Binary files /dev/null and b/assets/tiles/water12.png differ diff --git a/assets/tiles/water13.png b/assets/tiles/water13.png new file mode 100644 index 0000000..8e0a1da Binary files /dev/null and b/assets/tiles/water13.png differ diff --git a/src/de/miaurizius/jgame2d/tile/TileManager.java b/src/de/miaurizius/jgame2d/tile/TileManager.java index 42b9fac..0e319f4 100644 --- a/src/de/miaurizius/jgame2d/tile/TileManager.java +++ b/src/de/miaurizius/jgame2d/tile/TileManager.java @@ -18,10 +18,10 @@ public class TileManager { public TileManager(GamePanel panel) { this.panel = panel; - tile = new Tile[10]; + tile = new Tile[50]; mapTileNum = new int[panel.maxWorldCol][panel.maxWorldRow]; getTileImage(); - loadMap("testworld"); + loadMap("testmap2"); } public void initializeTile(int i, String name, boolean col) { @@ -35,12 +35,57 @@ public class TileManager { } public void getTileImage() { - initializeTile(0, "grass", false); - initializeTile(1, "wall", true); - initializeTile(2, "water", true); - initializeTile(3, "earth", false); - initializeTile(4, "tree", true); - initializeTile(5, "sand", false); + // PLACEHOLDER + initializeTile(0, "grass00", false); + initializeTile(2, "grass00", false); + initializeTile(3, "grass00", false); + initializeTile(4, "grass00", false); + initializeTile(5, "grass00", false); + initializeTile(6, "grass00", false); + initializeTile(7, "grass00", false); + initializeTile(8, "grass00", false); + initializeTile(9, "grass00", false); + + // GRASS + initializeTile(10, "grass00", false); + initializeTile(11, "grass01", false); + + // WATER + initializeTile(12, "water00", true); + initializeTile(13, "water01", true); + initializeTile(14, "water02", true); + initializeTile(15, "water03", true); + initializeTile(16, "water04", true); + initializeTile(17, "water05", true); + initializeTile(18, "water06", true); + initializeTile(19, "water07", true); + initializeTile(20, "water08", true); + initializeTile(21, "water09", true); + initializeTile(22, "water10", true); + initializeTile(23, "water11", true); + initializeTile(24, "water12", true); + initializeTile(25, "water13", true); + + // ROAD + initializeTile(26, "road00", false); + initializeTile(27, "road01", false); + initializeTile(28, "road02", false); + initializeTile(29, "road03", false); + initializeTile(30, "road04", false); + initializeTile(31, "road05", false); + initializeTile(32, "road06", false); + initializeTile(33, "road07", false); + initializeTile(34, "road08", false); + initializeTile(35, "road09", false); + initializeTile(36, "road10", false); + initializeTile(37, "road11", false); + initializeTile(38, "road12", false); + + // WORLD + initializeTile(39, "earth", false); + initializeTile(40, "wall", true); + initializeTile(41, "tree", true); + BufferedImage scaledImage; for (Tile tile : tile) {