i made a test if im doing a "return" right, but its obviously i didnt, here is the codes.
main
while(LoopGDK())
{
dbSync();
dbCLS();
open_menu(phase);
if(open_menu(phase) == 2)
{
phase = 2;
}
else if(open_menu(phase) == 1)
{
phase =1;
}
if(phase == 2)
{
dbText(50, 50, "phase 2");
}
else if(phase == 1)
{
dbText(40, 40, "phase 1");
}
if(dbEscapeKey())
{
break;
}
}
return
int open_menu(int phase)
{
if(dbSpaceKey() == 1 && phase == 2)
{
return 1;
}
if(dbMouseClick() == 1 && phase == 1)
{
return 2;
}
}
so here what i wanted to do is, whenever i press space, the phase will return 1 (1 is the default). and whenever i click mouse it will return 2.
but what happened is it is continuously changing from one phase to another whenever i click or press.
so confused. i was trying to solve it myself but took me hours already and don't want to waste time.
-Excellence deals with weak people-