Games Levels using X2 - Part 2

developer_123

Active Member
Licensed User
Longtime User
This is the continuation of the thread https://www.b4x.com/android/forum/threads/levels-using-x2.121681/

In the previous thread I asked how to make a change of levels and Erel told me to restore it following the example of Mario, however how what I need is to erase all the elements (bodies, characters, floor, walls etc.), and then load a new TileMap json file. I tried to introduce in a new button called "level 2" with the code -
TileMap.Initialize (X2, File.DirAssets, "second-level.json", Null) - and after that create each new object in the same code as my button, hoping it will update with the new objects, but this it didn't happen.

My logic tells me that I must first delete all the elements of the first level, and somehow disable the first TileMap json file that I initially loaded.

I do not know if I'm on the right track with what I intend with this to delete level 1 and load level 2. I appreciate any related clue or forum.
 
Top