Page 1 of 1
Restore level without loadGame()

Posted:
Fri Dec 10, 2010 3:56 pm
by akr
I have a lot of tile based actors on my game level. They get moved/removed while playing.
Want to bring this game (bouldercrash) to iphone and android. Therefore I want to have one
datafile without loadGame() each time to restart.
Any ideas how I can restore actors even when they get destroyed during gameplay with less effort (for restart)?
Re: Restore level without loadGame()

Posted:
Sat Dec 18, 2010 12:09 am
by skydereign
One way that will work is to build the levels through a global function. That way, to restart a level, or load any, delete the current level, and then recreate it. Pretty self explanatory I think. Now if you already created the levels within gameEditor, and not using a level array, then you can make the game create a text file with the proper values, which you can later copy into gameEditor and add the variable declaration.
You could also save them all into a text file, and load that up, but that wouldn't help too much either, as you want only one file.
Re: Restore level without loadGame()

Posted:
Sat Dec 18, 2010 5:03 am
by jimmynewguy
Well sky your kinda right since he only said without the loadgame function (i think because it blacks the screen, ect.) so if he used external files (like such
viewtopic.php?f=6&t=6011&p=49212&hilit=loading+maps#p49212) it would work the way i think he wants

Re: Restore level without loadGame()

Posted:
Sat Dec 18, 2010 5:39 am
by skydereign
Well I suggested both methods, through script and through exterior files. For iphone/android it would be better to create the levels within global code, as you want to keep the number of files to one .dat and the save file.
Re: Restore level without loadGame()

Posted:
Sat Dec 18, 2010 11:30 am
by akr
Thanks for all the good ideas. I am thinking about a way in the CreateActor() script. Btw: Right, I dont want to use external files.
The coolest thing would be a CreateActor() script which creates actors in the visible game area depending on a levelcount and
a activation regions.
So I hold lets say 10 levels in different activations regions. Advantage is a low memory consumption and reusability.
STOP: That doesnt work because activation areas get activated when visible. Dont want to have my original levels visible.
Hmmmmm.
I have a array of my playfield. But that holds only type of actor.
Question: When I use that array and I figure out the name of the actor. Can I then create that actor in the visible area?
Hmm, this array gets filled on start through the createActor() script. So in the beginning its empty. This is because I want to use ge as level editor.....