owen Posted August 23, 2014 Share Posted August 23, 2014 Hi, another newbie question sorry. When my player loses a life I want to rebuild the map from scratch, so I want to re-run the code that loads the map (tile layer and object layer). No problem doing this except that I simply get another load of objects in addition to the current ones (duplicating instead of replacing them). This happens because I'm not wiping out the current map/layers before reloading. So my question is how do I destroy or kill the map, so that I can restart the level afresh without duplication? In effect I want to re-run the 'create()' function (or part of it at least) but on a clean slate. Is there an accepted/easy way of doing this? Can I kill/destroy an entire map or at least the layer(s)? ThanksOwen Link to comment Share on other sites More sharing options...
Heppell08 Posted August 23, 2014 Share Posted August 23, 2014 Destroy the layer the recreate the map as normal. owen 1 Link to comment Share on other sites More sharing options...
Recommended Posts