You can now go down stairs to new levels, but when you do you become stairs or a random monster.

This commit is contained in:
Zed A. Shaw 2025-01-24 13:47:00 -05:00
parent c14efee9ea
commit 2825faf038
7 changed files with 100 additions and 49 deletions

View file

@ -226,12 +226,16 @@ void WorldBuilder::place_entities(DinkyECS::World &world) {
auto &config = world.get_the<GameConfig>();
// configure a player as a fact of the world
auto player_data = config.enemies["PLAYER_TILE"];
auto player_ent = configure_entity_in_map(world, $map, player_data, 0);
// configure player in the world
Player player{player_ent};
world.set_the<Player>(player);
world.set<Inventory>(player.entity, {5});
if(world.has_the<Player>()) {
fmt::println("PLAYER ALREADY EXISTS LEAVING ALONE");
} else {
auto player_data = config.enemies["PLAYER_TILE"];
auto player_ent = configure_entity_in_map(world, $map, player_data, 0);
// configure player in the world
Player player{player_ent};
world.set_the<Player>(player);
world.set<Inventory>(player.entity, {5});
}
randomize_entities(world, config);
}