Can now go down a level.
This commit is contained in:
parent
360402cb3c
commit
44e474b023
3 changed files with 19 additions and 6 deletions
|
|
@ -190,11 +190,17 @@ void WorldBuilder::place_doors(DinkyECS::World& world, GameConfig& config) {
|
|||
}
|
||||
|
||||
void WorldBuilder::place_stairs(DinkyECS::World& world, GameConfig& config) {
|
||||
auto player = world.get_the<Player>();
|
||||
auto player_pos = world.get<Position>(player.entity);
|
||||
|
||||
auto& device_config = config.devices.json();
|
||||
auto entity_data = device_config["STAIRS_DOWN"];
|
||||
|
||||
auto at_end = $map.$dead_ends.back();
|
||||
configure_entity_in_map(world, entity_data, at_end);
|
||||
// auto at_end = $map.$dead_ends.back();
|
||||
configure_entity_in_map(world, entity_data, {
|
||||
player_pos.location.x+1,
|
||||
player_pos.location.y
|
||||
});
|
||||
}
|
||||
|
||||
void WorldBuilder::configure_starting_items(DinkyECS::World &world) {
|
||||
|
|
@ -203,11 +209,11 @@ void WorldBuilder::configure_starting_items(DinkyECS::World &world) {
|
|||
|
||||
auto healing = System::spawn_item(world, "REPAIR_KIT");
|
||||
inventory.add("inv0", healing);
|
||||
world.make_constant(healing);
|
||||
|
||||
auto sword = System::spawn_item(world, "SWORD_1");
|
||||
inventory.add("hand_main", sword);
|
||||
|
||||
world.make_constant(healing);
|
||||
world.make_constant(sword);
|
||||
}
|
||||
|
||||
void WorldBuilder::place_entities(DinkyECS::World &world) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue