PDA

View Full Version : picking avatars


Lav
12-30-2008, 03:52 PM
I've been having a problem in my game when i try to let the player pick an avatar and i succesfully put the choices of the 2 players avatars in 2 variables (choiceAvatar1) and (choiceAvatar2) and moved to the next frame where the next part of the game begins.

Now i have 3 different pions and depending on what avatar is picked i want to show the correct pion on stage, but it only wants to work for the first one.


switch(choiceAvatar1)
{
case avatar1: choicePion1 = pion1;
break;
case avatar2: choicePion1 = pion2;
break;
case avatar3: choicePion1 = pion3;
break;
}

switch(choiceAvatar2)
{
case avatar1: choicePion2 = pion1;
break;
case avatar2: choicePion2 = pion2;
break;
case avatar3: choicePion2 = pion3;
break;
}

switch(choicePion1)
{
case pion1: pion1.visible = true;
break;
case pion2: pion2.visible = true;
break;
case pion3: pion3.visible = true;
break;
}

switch(choicePion2)
{
case pion1: pion1.visible = true;
break;
case pion2: pion2.visible = true;
break;
case pion3: pion3.visible = true;
break;
}