Character select...

Non-platform specific questions.

Character select...

Postby Goomba » Sat Oct 06, 2012 6:24 am

Well here I am again asking questions hopinf for some easy answers... anyway, quick question... how do you make a character select? would I use variables some how? or an array? or what? I need to make a character select before each level... someone help! :(
Batman can't be killed - setosorcerer
he can only be neutered... - ASFJerome
User avatar
Goomba
 
Posts: 220
Joined: Wed Apr 25, 2012 2:55 am
Location: Beyond time and space...
Score: 7 Give a positive score

Re: Character select...

Postby skydereign » Sat Oct 06, 2012 7:13 am

Think of it this way, what is the character select, and what does it do? It is most likely a collection of characters (icons that represent each one), that when you click one, it selects that character. To set that up you need two things, the character icons, and a way for the game to know which character you selected.

The character icons could be done in many different ways. First is to have a single image with all the icons (but this means you can't use mouse button down on individual characters). Another way is to have multiple actors, each with the animation of a different actor (this uses a lot of actors, and since the actors are so similar, you could probably get away with using clones). Last way would be to use clones, each clone having a different player icon.

Whichever setup you choose, the game still needs a way of choosing which player was picked. You could just create the actor right on the mouse button down, but then you don't have a way of determining which player was picked after the event. So, the only way to really store information in a game is a variable. You mentioned arrays, but arrays are useful for storing lots of information. In this case we only want one thing, which player was chosen. That can be stored in a single variable, where different values represent different players.

So now that we know we want to use a single variable to determine which actor was picked, we need a way of organizing which players have what value (character a=0, character b=1, character c=2, ...). The best method for this depends on our solution we use for displaying the icons. I suggest using clones, with different animations for each icon. Since each clone has a different animation (and each animation has a different animindex), we can use that as a way of categorizing the characters. More specifically, we can set the player variable equal to the animindex of the icon we click.

When you decide on the character (set the variable), start the game, and create the character type represented by the variable.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Character select...

Postby Goomba » Mon Oct 15, 2012 12:21 am

OK a couple questions though... How would I set the variable to the icon? would I put each icon in a variable of it's own and do it that way?
Batman can't be killed - setosorcerer
he can only be neutered... - ASFJerome
User avatar
Goomba
 
Posts: 220
Joined: Wed Apr 25, 2012 2:55 am
Location: Beyond time and space...
Score: 7 Give a positive score

Re: Character select...

Postby skydereign » Tue Oct 16, 2012 12:04 am

Goomba wrote:How would I set the variable to the icon? would I put each icon in a variable of it's own and do it that way?

skydereign wrote:I suggest using clones, with different animations for each icon. Since each clone has a different animation (and each animation has a different animindex)

animindex is an actor variable that signifies what animation the current actor has. So your clones having unique icon images means they each have a unique animindex. Simply put, variable=animindex on mouse button down.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Character select...

Postby Goomba » Thu Oct 25, 2012 7:10 pm

ohhh... I get it now if each clone has a different image they will have different animindexes, and I can set the variables to them and when they are clicked they will create the specified actor, right? that makes sense... Thanx :D
Batman can't be killed - setosorcerer
he can only be neutered... - ASFJerome
User avatar
Goomba
 
Posts: 220
Joined: Wed Apr 25, 2012 2:55 am
Location: Beyond time and space...
Score: 7 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron