sharks Posted May 30, 2018 Share Posted May 30, 2018 Hi guys, I've worked on a part of the system which loads multiple layers for a given tile map for a key "Map A" (All of them are static). Now at some time, I'd like to move the user to the next map with key "Map B". What's the best way to destroy a tilemap/layers and recreate the world? Thanks, S Link to comment Share on other sites More sharing options...
samme Posted May 30, 2018 Share Posted May 30, 2018 Restart scene and pass data, maybe. Link to comment Share on other sites More sharing options...
sharks Posted May 31, 2018 Author Share Posted May 31, 2018 Alright, will give it a try tonight. Thanks. :) Link to comment Share on other sites More sharing options...
B3L7 Posted May 31, 2018 Share Posted May 31, 2018 From what I can tell Phaser seems to handle cleanup pretty well as I have run into a lot of errors whenever I have tried to manually destroy objects in the shutdown method of the secene. I've been leaving the objects in place for now as I'll worry about memory management later on when I get closer to completion. I've been working on a template some time now that might be of help. It's a work in progress but it handles loading tilemaps dynamically as you have mentioned: Phaser 3 Tilemap & File Pack Project Template Link to comment Share on other sites More sharing options...
sharks Posted June 1, 2018 Author Share Posted June 1, 2018 You guys were absolutely correct. Stopping & Creating a scene works wonderfully and it's the solution I'm going with. Thanks! Link to comment Share on other sites More sharing options...
grizzlyslayer Posted February 7, 2021 Share Posted February 7, 2021 Hey guys, I'm making an partly open world rpg game similar to the original pokemon games. I want to know how to switch between tilemaps just by walking to a certain point on the map. For example: I want to get to the next city and i need to walk along a path; when i get to the end of the path for that tilemap i want to go to the next tilemap which will be the city. Does anyone know how i would do that? Link to comment Share on other sites More sharing options...
Recommended Posts