state error >.<

i dont understand why it wont work it says it cant convert...when i tried to load my menu function it doesn't load my menu any more.


here is the problem where my error lies my menu should open here but it states that it cann't convert from 'const int to state' i am guessing i need to use some other varible but int,char,float none of them work in the sittuation and i cant understand why they wont work so what should i do in order to figure out what i am doing wrong then i can resolve the problem, the error happens in this line

currentstate = mainmenu or so i am told by VS. below i have pasted the line of problem and the lines just above and below to see if something i have done before or after has had unexpected results







const int MAINMENU = 1;
const int SINGLEPLAYER = 2;



////////////////////////////////
//MAINMENU SWITCHING
{
currentstate = MAINMENU;
bool bcontinueGame = true;

while (bcontinueGame)
{
switch(currentstate)
{
case MAINMENU:
bcontinueGame = MAINMENU;
case SINGLEPLAYER:
bcontinueGame = SINGLEPLAYER;
case QUIT:
break;
default:
break;
};
}
}
Last edited on
you need to define currentstate as an int

as well as QUIT

and you need to change bcontinueGame as false when QUIT is applied
Last edited on
okay fixed it thanks heaps now all i got to do is get rid of this warning for a loss of dat from a int to float conversion.

but thats for me to figure out and learn from =D


Topic archived. No new replies allowed.