Tilemap doesn't use hardcoded path instead uses generated path from Game.cpp
This commit is contained in:
parent
6bdaefdeb9
commit
f20e711380
@ -46,8 +46,8 @@ public:
|
||||
{
|
||||
// TILESON ~~~~~~~~~~~
|
||||
|
||||
//const std::filesystem::path jsonPath = std::filesystem::u8path(mapPath);
|
||||
const std::filesystem::path jsonPath = std::filesystem::u8path("/Users/ayoungblood/Projects/KaijuSaveEarth/assets/maps/kaiju-city-map.json");
|
||||
const std::filesystem::path jsonPath = std::filesystem::u8path(mapPath);
|
||||
//const std::filesystem::path jsonPath = std::filesystem::u8path("/Users/ayoungblood/Projects/KaijuSaveEarth/assets/maps/kaiju-city-map.json");
|
||||
map = t.parse(jsonPath);
|
||||
//std::cout << "Trying to load json tile map from: " << jsonPath << std::endl;
|
||||
if(map->getStatus() == tson::ParseStatus::OK)
|
||||
|
@ -191,7 +191,8 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
|
||||
levelMap.y = 0;
|
||||
|
||||
// printf("Trying to load Tilemap\n");
|
||||
gameScene.addComponent<TileMapComponent>("assets/maps/kaiju-city-map.json","kaiju-city","Tile Layer 1","Collision",gScale,player.getComponent<TransformComponent>().position.x+player.getComponent<TransformComponent>().width/2,player.getComponent<TransformComponent>().position.y+player.getComponent<TransformComponent>().height/2); //150,100
|
||||
std::string mapPath = Game::projPath + "assets/maps/kaiju-city-map.json";
|
||||
gameScene.addComponent<TileMapComponent>(mapPath,"kaiju-city","Tile Layer 1","Collision",gScale,player.getComponent<TransformComponent>().position.x+player.getComponent<TransformComponent>().width/2,player.getComponent<TransformComponent>().position.y+player.getComponent<TransformComponent>().height/2); //150,100
|
||||
gameScene.addGroup(groupMap);
|
||||
// printf("Completed loading Tilemap\n");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user