Autor Tema: Here is a good pause system  (Leído 2945 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado MisterN

  • Hero Member
  • *****
  • Mensajes: 650
  • Karma: 4
    • Ver Perfil
Here is a good pause system
« en: Julio 24, 2011, 07:10:08 pm »
I have made a good pause system if you wish to use from it
Código: [Seleccionar]
process Pause_Menu()
private

PAUSED_text_1;

PAUSED_text_2;

PAUSED_background;

key_a_is_already_pressed;

begin
loop
if(key(_a))
if (!key_a_is_already_pressed)
if(paused)
paused=false; //say "unpaused";

//deletes what you see as the pause menu
delete_text(PAUSED_text_1);
delete_text(PAUSED_text_2);
delete_draw(PAUSED_background);

//Un-pauses everything that is level related
signal( Type "PUT PROCESS HERE" , s_wakeup_tree );
else
paused=true; //say "paused";

set_text_color(rgb(128,128,128));//The text color will be gray
text_z = -1;
PAUSED_text_1=Write (0, 160, 120, 1, "PAUSED");
text_z = -1;
PAUSED_text_2=Write (0, 160, 140, 1, "Press Y to Quit");

drawing_color(rgb(0,64,64));//The background will be a dark blue/green-ish color
drawing_z(0);
PAUSED_background=draw_box(0,0,320,240);

//Pauses everything that is level related
signal( Type "PUT PROCESS HERE" , s_freeze_tree );
end
end
key_a_is_already_pressed = true;//as long as a is held down, this is true
else
key_a_is_already_pressed = false;//once a is released, this is false
if(key(_y))
if(paused)
Exit("Bye",0);
else end
end
end
frame;
end
end
werg

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4038
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: Here is a good pause system
« Respuesta #1 en: Julio 28, 2011, 01:28:22 am »
Thanks!

Desconectado MisterN

  • Hero Member
  • *****
  • Mensajes: 650
  • Karma: 4
    • Ver Perfil
Re: Here is a good pause system
« Respuesta #2 en: Julio 28, 2011, 12:33:14 pm »
some of the commands may be a little weird (like press Y for quit) but thats because most pc games back thena ctually had that and my game uses that to quit (for now) XD
werg