World builder now loads the tile map json and usese the keys to figure out how to randomize the floor configurations.
This commit is contained in:
parent
6b4bc6cc11
commit
03c5546cdf
12 changed files with 45 additions and 39 deletions
12
save.cpp
12
save.cpp
|
@ -85,16 +85,12 @@ void save::from_file(fs::path path, DinkyECS::World &world_out, Map &map_out) {
|
|||
|
||||
void save::load_configs(DinkyECS::World &world) {
|
||||
Config config("./assets/config.json");
|
||||
world.set_the<Config>(config);
|
||||
Config enemies("./assets/enemies.json");
|
||||
|
||||
auto map = config["map"];
|
||||
world.set_the<Config>(config);
|
||||
world.set_the<MapConfig>({
|
||||
map["WALL_TILE"],
|
||||
map["FLOOR_TILE"],
|
||||
map["PLAYER_TILE"],
|
||||
map["ENEMY_TILE"],
|
||||
map["BG_TILE"],
|
||||
map["WATER_TILE"],
|
||||
enemies["PLAYER_TILE"]["display"],
|
||||
enemies["ENEMY_TILE"]["display"],
|
||||
});
|
||||
|
||||
auto enemy = config["enemy"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue