Original Post
Hi all,
Just trying to get my app working so that if the user doesn''t touch the ESC key, the game automatically switches between displaying the game titles, and displaying the high scores..
ie.
However it just doesn''t work. I get super fast state changes between the two (ie. it flickers between TITLE and HIGHSCORE state at a high speed)..
How have others approached this?
float fTime = DXUtil_Timer(TIMER_GETAPPTIME);
switch(eState){
case TITLE_STATE:
if((int)fTime % 3 == 0){
//3 seconds have elapsed, go to the high scores
eState = HIGHSCORE_STATE;
}
break;
case HIGHSCORE_STATE:
if((int)fTime % 3 == 0){
//3 seconds have elapsed go to the title state
eState = TITLE_STATE;
}
break;
}