Ready to refactor the tilemap so I can stylize different parts of the maps generated.

master
Zed A. Shaw 1 week ago
parent 96a585220b
commit f45dbe8c48
  1. 6
      assets/config.json
  2. 4
      assets/tiles.json
  3. 2
      tilemap.cpp

@ -95,17 +95,17 @@
"frame_width": 256, "frame_width": 256,
"frame_height": 256 "frame_height": 256
}, },
"wall": "moss_wall":
{"path": "assets/glowing_moss_wall-256.png", {"path": "assets/glowing_moss_wall-256.png",
"frame_width": 256, "frame_width": 256,
"frame_height": 256 "frame_height": 256
}, },
"lava_floor": "floor":
{"path": "assets/floor_tile_test-256.png", {"path": "assets/floor_tile_test-256.png",
"frame_width": 256, "frame_width": 256,
"frame_height": 256 "frame_height": 256
}, },
"floor": "lava_floor":
{"path": "assets/lava_floor-256.png", {"path": "assets/lava_floor-256.png",
"frame_width": 256, "frame_width": 256,
"frame_height": 256 "frame_height": 256

@ -11,14 +11,14 @@
"foreground": [230, 20, 30], "foreground": [230, 20, 30],
"background": [230, 20, 120], "background": [230, 20, 120],
"collision": true, "collision": true,
"display": 9608 "display": 8820
}, },
"WALL_PLAIN": { "WALL_PLAIN": {
"texture": "assets/wall_texture_test-256.png", "texture": "assets/wall_texture_test-256.png",
"foreground": [230, 20, 30], "foreground": [230, 20, 30],
"background": [230, 20, 120], "background": [230, 20, 120],
"collision": true, "collision": true,
"display": 37 "display": 9608
}, },
"WALL_VINES": { "WALL_VINES": {
"texture": "assets/wall_with_vines-256.png", "texture": "assets/wall_with_vines-256.png",

@ -48,7 +48,7 @@ void TileMap::set_tile(size_t x, size_t y, string tile_name) {
void TileMap::load(matrix::Matrix &walls) { void TileMap::load(matrix::Matrix &walls) {
for(matrix::each_cell it{walls}; it.next();) { for(matrix::each_cell it{walls}; it.next();) {
string tile_name = walls[it.y][it.x] == SPACE_VALUE ? "FLOOR_TILE" : "WALL_MOSS"; string tile_name = walls[it.y][it.x] == SPACE_VALUE ? "FLOOR_TILE" : "WALL_PLAIN";
set_tile(it.x, it.y, tile_name); set_tile(it.x, it.y, tile_name);
} }
} }

Loading…
Cancel
Save