pause screen...

Posted By: Blink

pause screen... - 03/16/10 15:46

ok, I am wondering if it is possible. I have a splash screen code from AUM 41. I want to change it into pause screen because it only appears when the level loads and goes down when you press a button. I want to be able to hit a button on the keyboard and pause the game and the splash screen appears and can go away when you press that button again. I want it to be used anytime you wish because it will show the objectives of that level you are on. is this possible?

code per AUM 41

Code:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

bmap splash_pcx = <splash.pcx>; // Your Spash Pcx graphic

panel splash_pan 
{ 
   bmap = splash_pcx; 
   pos_x = 0; 
   pos_y = 0; 
   layer = 1; 
   flags = overlay, refresh; 
} 

starter show_splash()
{
   freeze_mode = 1; // stop all the entities in the level
   splash_pan.visible = on; // show the splash screen
   while (key_space == 0) {wait (1);} // wait until the "space" key is pressed
   while (key_space == 1) {wait (1);} // wait until the "space" key is released
   splash_pan.visible = off;
   freeze_mode = 0; // resume the gameplay
}


Posted By: alibaba

Re: pause screen... - 03/16/10 16:10

here i think this would work laugh


starter show_splash()
{
while(1)
{
while (key_space == 0) {wait (1);} // wait until the "space" key is pressed
while (key_space == 1) {wait (1);} // wait until the "space" key is released
freeze_mode = 1; // stop all the entities in the level
splash_pan.visible = on; // show the splash screen
while (key_space == 0) {wait (1);} // wait until the "space" key is pressed
while (key_space == 1) {wait (1);} // wait until the "space" key is released
splash_pan.visible = off;
freeze_mode = 0; // resume the gameplay
wait(1);
}
}
Posted By: JazzDude

Re: pause screen... - 03/16/10 18:30

If I understand what you want correctly, I'd do it this way:

Code:
function pause()
{ 
	if(freeze_mode == 2) // all frozen??
	{

		freeze_mode = 0; // go on
		splash_screen.visible = off;
                game_paused_txt.visible = off;  //if desired
	}
	else
	{
		freeze_mode = 2; // pause	
		splash_screen.visible = on;
                game_paused_txt.visible = on;  //if desired
       	}
} 

on_space = pause;  //toggles pause on and off


Posted By: Blink

Re: pause screen... - 03/16/10 20:30

Thanks alibaba and Rod, both methods worked perfectly. I appreciate the assist.
© 2024 lite-C Forums