Level Archive

Talk about making games.

Level Archive

Postby raminjoon » Thu Aug 11, 2011 3:43 am

Okay I want to make a game like angry birds like how at first it has levels locked up in level archive and then it will unlock it after you hit each level. MY question is how to make that tile like the level archive where at first only the first level is unlocked and after you beat each level it unlocks other levels. but My question is the archive tile. how can I make that?
raminjoon
 
Posts: 40
Joined: Tue Jul 05, 2011 5:34 am
Location: Denver, Co.
Score: 3 Give a positive score

Re: Level Archive

Postby skydereign » Thu Aug 11, 2011 5:08 am

Well, I'd suggest either an array that holds if the level is unlocked, or a variable that holds how many levels you have unlocked (in this case called levels_beat). Since the second one requires no knowledge of arrays I'll explain that one. You'll use a clone of buttons that load the level. The clone.0 will load the first level, clone.1 the second and so on. I'm going to assume you have a load level function, but if you don't all it does is load up a certain level. Also just to make sure there is a variable cur_level that holds what the current level is. Here's what the mouse button down might look like.
level_select -> Mouse Button Down Left -> Script Editor
Code: Select all
if(levels_beat>=cloneindex)
{
    cur_level=cloneindex;
    load_level(cloneindex);
}


Now if you want them to be grayed out when you haven't unlocked them you can use draw actor, or activation events, and use this.
level_select -> Draw Actor -> Script Editor
Code: Select all
int unlocked = (levels_beat>=cloneindex)+127;
r=unlocked+128;
g=unlocked+128;
b=unlocked+128;


Now when you beat a new level (also determined by this script) you increase it by 1.
Code: Select all
levels_beat+=levels_beat==cur_level;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Level Archive

Postby raminjoon » Thu Aug 11, 2011 8:40 pm

thanks for this info bud and also one more question though does this level loader page has to be seperate file or can it be a tile connected to the game tile? in other words how can I make a tile scenario or is this something that
needs to be on a seperate file?
raminjoon
 
Posts: 40
Joined: Tue Jul 05, 2011 5:34 am
Location: Denver, Co.
Score: 3 Give a positive score

Re: Level Archive

Postby skydereign » Fri Aug 12, 2011 1:17 am

You can make it a separate file if you want, but I prefer to keep them in one file. If you created your menu in the same ged as your game, the level select should go into the same ged. Pretty much the level screen is just a part of your menu.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Level Archive

Postby raminjoon » Fri Aug 12, 2011 4:33 am

but here is my problem my friend how can I make a connected tile like a tile that will be changed into the game tile. please let me know if I am not making sense here.
raminjoon
 
Posts: 40
Joined: Tue Jul 05, 2011 5:34 am
Location: Denver, Co.
Score: 3 Give a positive score

Re: Level Archive

Postby skydereign » Fri Aug 12, 2011 5:25 am

As per your request, you are not making sense. You seem to not be using tile in the sense of gE tiles, and therefore can you explain what you do mean?
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest