I'd do it something like this:
bool pause;
if ( pause == 0){
//perform all of the level junk, blah blah blah...
//... and also put this in here somewhere to pause the game:
if ( dbReturnKey() ) {
pause = 1;
}
}
if (pause == 1) {
//You can have a simple Enter in Enter out pause menu by just
//adding one line of code in this...
dbSprite ( sprite number, X, Y, Image of pause screen );
//...Or you could fill this with code that runs an item menu
//like in Legend of Zelda...
// and then you add this to exit the menu:
if (dbReturnKey()){
pause = 0;
}
}
If you do this, all of the code for the levels has to be put in the "{ }"s of the argument "if (pause == 0)", so that if "pause" is equal to 1, everything in the level will just freeze in place.
Hope that helps!
Join the dark side. We have cookies!