Mostly working spatical map with 2 level collision/space structure. Not the best implementation but this is the idea.
This commit is contained in:
parent
fd53f92fe6
commit
d6326c9e41
7 changed files with 60 additions and 31 deletions
|
@ -91,15 +91,20 @@ DinkyECS::Entity WorldBuilder::configure_entity_in_map(DinkyECS::World &world, j
|
|||
// NOTE: aiming_at is set by the rayview since it knows that
|
||||
world.set<Position>(item, {pos.x, pos.y});
|
||||
|
||||
if(entity_data["inventory_count"] > 0) {
|
||||
// BUG: See #72, but this will change to a setting for collision
|
||||
int inv_count = entity_data.contains("inventory_count") ? (int)entity_data["inventory_count"] : 0;
|
||||
bool has_collision = true;
|
||||
|
||||
if(inv_count > 0) {
|
||||
world.set<InventoryItem>(item, {entity_data["inventory_count"], entity_data});
|
||||
has_collision = false;
|
||||
}
|
||||
|
||||
if(entity_data.contains("components")) {
|
||||
components::configure_entity(world, item, entity_data["components"]);
|
||||
}
|
||||
|
||||
$collision->insert(pos, item);
|
||||
$collision->insert(pos, item, has_collision);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue