ftdhfhtgfh
Member
Can someone please tell me how I could pause and unpause the game I am working on?
So far I created an object named pause_button that when pressed displays a small pause screen. The pause screen should contain a button that closes the pause screen when pressed.
here is the code I have so far:
Object pause_button --> Events: -Create:
-Left pressed:
Object pause_screen --> Events: -Create:
-Draw:
-Left pressed:
The problem I am having is that I can't add an unpause button to the pause screen. All I can do is add a sprite that doesn't do anything when clicked.
So far I created an object named pause_button that when pressed displays a small pause screen. The pause screen should contain a button that closes the pause screen when pressed.
here is the code I have so far:
Object pause_button --> Events: -Create:
GML:
mid_point=room_width/2;
start_point=mid_point-155;
bar_Ypos=120;
global.enable_pause=false;
Code:
global.enable_pause=true;
GML:
mid_point=room_width/2;
start_point=mid_point-155;
bar_Ypos=120;
GML:
if (global.enable_pause==true)
{
busy=true;
draw_sprite(sp_grey_bkg,0,mid_point+1,bar_Ypos+382);
draw_sprite(sp_pause_menu,0,mid_point,bar_Ypos+350);
draw_sprite(sp_continue,0,mid_point,bar_Ypos+290);
GML:
busy=false;
global.enable_pause=false;
The problem I am having is that I can't add an unpause button to the pause screen. All I can do is add a sprite that doesn't do anything when clicked.
Attachments
-
106.8 KB Views: 12