I'm pretty sure a lot of you get the idea for making a basic level editor, you just add stuff and play right off the bat, and once your done with the game the level goes poof, well its actually possible to save and load custom levels, here's how:
get yourself a few lists first:
-tile
-spawnX
-spawnY
-level
-levelspawns
now setup a basic tile movement and stamping feature so people can start designing the level
now here's where saving comes into play
every time a tile is placed it sets its direction, position, and costume number into the list "tile". before placing any tiles you'll have to make a new variable for double every tile in the list "tile", you should of course have this done by coding. Now when you add a tile it will add the position by what variable it is within the list "tile". depending on the position on the level it will add data into the corresponding place in the list. now first you'll add the costume number. next you'll want to add the direction of the tile to the NEXT variable. why the next one? because it would be much harder to decipher the direction and costume number out of one variable. though if you must you can do it with the blocks in numbers for separating words. now once you save it all this data will go into the "level" list. if there is another saved level make sure the code will be able to detect this and skip the corresponding number of tiles. now spawning works the same as adding directions and costume numbers. once you save, the spawn X and Y will be transfered to levelspawns
now here's loading:
loading is much more simple. all we have to do is read at the correct starting point on the list "level". once you do so just tell it to stamp the tile using the corresponding costume number and direction. the level loading should on average take at most 10 seconds. now spawning is added for the player to randomly select between the variables of the spawn points for the level when spawning.
that's pretty much it, if you were expecting code the answer is no, if you cannot read this and figure out how to code you are then not ready to use material this advanced
EDIT:
forgot to add exporting and importing levels
to export a level all you need to do is type out all the variables in "level" and "levelspawns"
next add a feature to enter digits into the list and then you can click run and it will construct the level
Last edited by dingdong (2010-01-24 14:36:39)
Offline
I don't need this right now, but it seems promising to those who use.
Offline
This technique works,but there's one problem you can't solve;what if you go to another game,and come back?
Offline
Brass45 wrote:
This technique works,but there's one problem you can't solve;what if you go to another game,and come back?
oh right I forgot about this feature, you can solve it, hold I'll re-edit the main post
Offline
dingdong wrote:
Brass45 wrote:
This technique works,but there's one problem you can't solve;what if you go to another game,and come back?
oh right I forgot about this feature, you can solve it, hold I'll re-edit the main post
How does that help if you go to another webpage?I mean the kind of saving like in bloons TD4 and pretty much every game known to mankind.
Offline