add player entity (draft)

This commit is contained in:
MihailRis
2024-07-07 22:19:15 +03:00
parent 939cfdd851
commit 77c9c5cdb7
6 changed files with 39 additions and 13 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ Level::Level(
this->world->getNextInventoryId(), DEF_PLAYER_INVENTORY_SIZE
);
auto player = spawnObject<Player>(
glm::vec3(0, DEF_PLAYER_Y, 0), DEF_PLAYER_SPEED, inv
glm::vec3(0, DEF_PLAYER_Y, 0), DEF_PLAYER_SPEED, inv, 0
);
uint matrixSize = (
+2 -1
View File
@@ -111,7 +111,8 @@ std::unique_ptr<Level> World::load(
auto player = level->spawnObject<Player>(
glm::vec3(0, DEF_PLAYER_Y, 0),
DEF_PLAYER_SPEED,
level->inventories->create(DEF_PLAYER_INVENTORY_SIZE)
level->inventories->create(DEF_PLAYER_INVENTORY_SIZE),
0
);
player->deserialize(players->map(i).get());
level->inventories->store(player->getInventory());