There countless tutorials and examples on the click site, but 99.99% only offer ONE level (one frame) of game play. SO the question is, "What if you want to make multiple levels?" If you were planning to make multiple levels sharing the same physics and engine, what is it you have to do in terms of coding?
The absolute best way to do this would be to avoid the amateurish process of copying the frame over and over again. Your best bet would be to start off on a strong foot and learn how to create a level editor. Then make it so that you can load levels in succession inside the same single frame.
Cons:
It's up to you to create an editor to make your levels in. The idea here is to AVOID the frame editor - for making your own levels.
You need to plan ahead for what your editor needs to be capable of. It's harder to plan on the spot and add features as you go.
You need to work into your game, loading the very levels your editor created. This can be a daunting task for new people, especially when it's so much easier to use the frame editor to create in-depth levels. However the reward for your hardware is defiantly just.
Pros:
Your editor will be strictly your own, which means you can custom tailor it to best suit level construction for YOUR game.
- For example, maybe it would be easier for you to make levels if you could select an object and then just keep placing it every time you click, as opposed to constantly clicking and dragging. If so, make your editor do that instead.
You get much more flexibility in loading your level the way you want.
- For example, say you have check points and you don't want to reset the whole level when you load, but instead just want to reload specific items. Do it! One of the biggest cons to using the frame editor and copying the frames, is debugging. If you find a glitch in the engine for one frame, guaranteed, that glitch is in every single other frame. So on a game with 50 levels, if you find a bug in how the player jumps, you best be prepared to go in to each of the 50 levels and fix it. Good luck.
With building your own level editor and loading your levels at runtime, you've reduced the game down to a single frame, which means fixing any glitches is as simple as fixing it one time and it's done. Invest a little bit of time, to save ages of tedious labor.
The most commonly used method is to just copy the events from frame to frame. Of course you could use one HUGE frame and use various sections for various levels. Another option is to use a custom editor to make your levels load at runtime from an array using the text blitter to paste tiles, or just pasting active objects as tiles. The third option is a bit more complex but I'm sure someone can help you out.
This is why most people create level editors - to handle the repetitive part of doing it all over again.
Coding-wise, I prefer to externalize my engines, i.e. put them in Lua and let MMF handle the interface. So, if you have a bug in the engine, you don't have to fix it in every level. If you don't want to externalize it, just put the engine in global events. I'm not so fond of level editors; they seem to limit things too much, but they're the easiest solution.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Global Events and behaviors work, however they don't work with qualifiers. I agree with Silverfire, the best way to do it is to make a level editer. Not only does it make events easier to debug. It also makes it way easier to make the levels quickly.
This is one thing I hate about the flash runtime, no external files, so no way use a level editor
i have a flash editor theory. suppose you save your levels as a long block of sting. for example each tile would have the coordinates (X,Y) for each one in a row and when you reach the edge of the level there's a break such as "/" which tells the game to move the loader object down the next row. An example...
Hmmm... There could conceivably be a system made that uses php scripts to send level strings to a database... But I'm not sure any small flash project is worth it!
AND HOLD ON! I just realized that this thread didn't even mention flash.
Well OMC disrupted my edit, but here's the rest...
And on loop you set the string parser to each set of parenthesis and get each number between the comma. "," is the delimiter. So first loop it would read it to place object ID 1 (which could be a grass tile) to coordinates (3,2). In addition members could create their own levels and paste their code in the comments to be loaded by other people
Originally Posted by Ricky Global Events and behaviors work, however they don't work with qualifiers. I agree with Silverfire, the best way to do it is to make a level editer. Not only does it make events easier to debug. It also makes it way easier to make the levels quickly.
This is one thing I hate about the flash runtime, no external files, so no way use a level editor
if you're allowed to use edit boxes then you can just do the copy/paste thing a lot of flash games use for their custom levels, along with some string-based level format as mentioned before