I'm making a space rpg game, and the player must travel to different locations and complete certain tasks.
I have a gamemap layout that has about 30000 tiles, and each tile has it's own location variable number (e.g location=2,location=2324, etc.) and type number (comets=6, planet=9).
whenever the players wants to go to a certain location, it will take the player to the location layout based on the sprite's location number.
Suppose the player wants to land on location#1543 and it's the player first time landing on this location.
I know how to generate elements in this new location, but I don't know how to save all the elements positions, angles, instance variables, etc, so that when the player decides to visit this location again, the layout can load all the elements/variables that were inside this layout.
Any ideas on how I can program this?
Here is a capx :
https://www.dropbox.com/s/gbdfr94oyy8y7 ... .capx?dl=0
Develop games in your browser. Powerful, performant & highly capable.
You need to use local storage to save your initial Universe, with an Array of the frames & UIDs. Then on the next startup you check if this exists first and reload the player's universe. You would then use the same trick, but I'd suggest a dictionary for loading each location, since the player will never hit all 30k locations, so you just need to save the locations that are visited at least once. If you place everything in a Family, and name each object type, you can read in the data and rebuild the same layout.