Level screen map
Hello guys, I'm trying to develop a level screen map, something like the one on Candy Crush (see in the bottom).
How do you guys think I should load the level after choosing it from the level map? Having a json and load it from there? Something like {"level":"1", "moves":"20", "goal":"3000"}.
Has anyone developed this or is there any tutorial I could have a look?
Posted Aug 19, 2020, 9:06 AM UTC
It comes down to the size of the level data and the performance needs of the application. For the example you gave, you can load hundreds of levels in little time and keep it all in memory. But, if each level requires a lot more storage, and you have a lot of levels, loading them all up front might be prohibitively slow or take too much memory. It really comes down to the circumstances.
What would be the best solution if I wanted to load more storage?
"Best" depends on your game. Most likely, you can just load them all into memory. Try it and see. However, if you want to get fancy..
Have 1 file that defines just the info you need for the map screen. Load that at startup. Then, keep separate files for each level with the details. When you enter a level, load the detail file.
All the files can still be json. Your basic structure still works, just split the files up and load them when needed.