The Daily Click ::. Forums ::. Klik Coding Help ::. multi-level game coding design
 

Post Reply  Post Oekaki 
 

Posted By Message

Kokocipher



Registered
  03/06/2008
Points
  439
18th April, 2010 at 19:52:55 -

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?

Thanks.

 
http://blog.kokoarcade.com

Fish20



Registered
  03/12/2007
Points
  263

VIP MemberPS3 OwnerI like Aliens!I'm a Storm TrooperIt's-a me, Mario!I am an April FoolPicture Me This Round 48 Winner!
18th April, 2010 at 20:07:19 -

Clone the frame? I have no idea what you mean by your question. Please explain more.

 
All your base are in another castle, take this.

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
18th April, 2010 at 20:34:19 -

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.

Edited by Silveraura

 
http://www.facebook.com/truediamondgame

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
18th April, 2010 at 20:36:22 -

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.

 
.

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
19th April, 2010 at 09:07:19 -

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.

Image

Kokocipher



Registered
  03/06/2008
Points
  439
19th April, 2010 at 23:06:58 -

thanks for all the great answers .

I think I'll go with using global events as loading level files is still too advanced for me at this point.

What about the behavior editor? can that be used somehow to lessen repetitive work?

Edited by Kokocipher

 
http://blog.kokoarcade.com

Ricky

loves Left For Dead 2

Registered
  28/12/2006
Points
  4075

Has Donated, Thank You!Game of the Week WinnerVIP MemberWii OwnerHero of TimeGOTM Winner! - November 2009I am an April Fool
19th April, 2010 at 23:53:58 -

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

 
-

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
20th April, 2010 at 00:13:51 -

INI level editor might work! Flash supports INI, doesn't it?

 

  		
  		

Ricky

loves Left For Dead 2

Registered
  28/12/2006
Points
  4075

Has Donated, Thank You!Game of the Week WinnerVIP MemberWii OwnerHero of TimeGOTM Winner! - November 2009I am an April Fool
20th April, 2010 at 01:09:52 -

not in a way to allow for you to upload your levels with the game, it's generated by the game and stored in the browser cache

 
-

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
20th April, 2010 at 01:50:15 -

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...

(3,2)(4,3)(6,32)(3,11)/(1,1)

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
20th April, 2010 at 01:55:05 -

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.

Edited by OMC

 

  		
  		

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
20th April, 2010 at 01:56:45 -

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

 
n/a

Xgoff



Registered
  22/02/2009
Points
  135
20th April, 2010 at 01:57:03 -


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

Edited by Xgoff

 
Image

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
20th April, 2010 at 03:49:32 -

I've already built a system that allows my flash game to upload custom levels to a database. I'm just too busy to finish it.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click