Nice graphics... but that's a really cheap way to pause.
Here's a pause(ord('P')) script that goes in the P key event.
var paused,selected,option;
paused=true
selected=0
option[0]="This is the first option"
option[1]="This is the second option"
option[2]="This is the third option"
option[3]="This is the fourth option"
option[4]="Exit"
while paused=true{
sleep(1000/room_speed)
io_handle()
if keyboard_check_pressed(argument0) {paused=false;break;}
if keyboard_check(vk_down) and selected<4 selected+=1
if keyboard_check(vk_up) and selected>0 selected-=1
if keyboard_check_pressed(vk_enter) {event_user(selected);paused=false;break;}
draw_clear_alpha(c_white,0)
draw_set_halign(fa_left)
draw_set_valign(fa_top)
draw_set_color(c_black)
draw_set_alpha(.4)
draw_rectangle(0,0,room_width,room_height,false)
draw_set_alpha(1)
draw_set_color(c_white)
draw_text(view_xview+5,view_yview+5,"PAUSED"
)
for (i=0;i<5;i+=1){
if i=selected draw_text(view_xview+5,view_yview+5+18*(i+1)
,">"+option[i])
else draw_text(view_xview+5,view_yview+5+18*(i+1)
,option[i])
}
screen_refresh()
}
I took the liberty of re-doing the script so you could add a menu. It uses event_users 0, 1, 2, 3, and 4. Just put in there whatever you want the first, second, third, fourth, and fifth options to be.
If it's bugged, it's because I just wrote it. I recommend using a font to make it look better, and adding a menu too.
This makes the game take almost no CPU at all. Then again, it works just as well to use show_message if your message looks cool.. oh well, your choice.
This post has been edited by Tehsalemplz: 23 October 2006 - 01:07 AM