I'm trying to make my game pause if the user presses the 'P' button, and then unpause again with the P button. The pausing works when it's only pausing:
game_state = PAUSED;
I've currently tried the following with pausing and unpausing - none have worked:
switch(game_state)
{
case RUNNING:
{
game_state = PAUSED;
break;
}
case PAUSED:
{
game_state = RUNNING;
break;
}
default:
{
game_state = PAUSED;
break;
}
}
if(game_state == PAUSED)
game_state = RUNNING;
else if(game_state == RUNNING)
game_state = PAUSED;
if(game_state == RUNNING)
game_state = 500;
else if(game_state == PAUSED)
game_state = RUNNING;
if(game_state == 500)
game_state = PAUSED;
I've also tried other things similar to the ones above. Does anyone know a way for this to work?