Inventory system is mostly working and I can pick up everything and use it.

This commit is contained in:
Zed A. Shaw 2025-01-04 13:32:26 -05:00
parent aaa6d9f9f3
commit 14b3ea7676
8 changed files with 56 additions and 47 deletions

View file

@ -34,7 +34,7 @@ void configure_world(DinkyECS::World &world, Map &game_map) {
world.set<Motion>(player.entity, {0, 0});
world.set<Combat>(player.entity, {100, 10});
world.set<Tile>(player.entity, {config.enemies["PLAYER_TILE"]["display"]});
world.set<LightSource>(player.entity, {70,1.0});
world.set<LightSource>(player.entity, {50,1.0});
world.set<Inventory>(player.entity, {5});
auto sword = world.entity();
@ -44,6 +44,13 @@ void configure_world(DinkyECS::World &world, Map &game_map) {
world.set<InventoryItem>(sword, {1, config.items["SWORD_RUSTY"]});
world.set<Weapon>(sword, {20});
auto torch = world.entity();
pos = game_map.place_entity(2);
world.set<Position>(torch, {pos.x+1, pos.y+1});
world.set<Tile>(torch, {config.items["TORCH_BAD"]["display"]});
world.set<InventoryItem>(torch, {1, config.items["TORCH_BAD"]});
world.set<LightSource>(torch, {70,2.0f});
auto enemy = world.entity();
world.set<Position>(enemy, {game_map.place_entity(1)});
world.set<Motion>(enemy, {0,0});
@ -61,6 +68,7 @@ void configure_world(DinkyECS::World &world, Map &game_map) {
world.set<Position>(gold, {game_map.place_entity(3)});
world.set<Loot>(gold, {100});
world.set<Tile>(gold, {config.items["CHEST_SMALL"]["display"]});
world.set<InventoryItem>(gold, {1, config.items["CHEST_SMALL"]});
auto wall_torch = world.entity();
world.set<Position>(wall_torch, {game_map.place_entity(4)});