Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
so something like
CREATE EVENT
ALARM 0 EVENT
DRAW EVENT
if time == "Start"
{
instance_destroy();
}
else
time -= 1;
if (time == 0)
{
time = "Start"
}
alarm[0] = room_speed;
Hope this helps.
Obj_pause - create:
// capture screen before pause
roombeforepause = surface_create(surface_get_width(application_surface),surface_get_height(application_surface));
surface_copy(roombeforepause,0,0,application_surface)
// Stop everything else from moving
instance_deactivate_all(true);
// I still need these so reactivate them
instance_activate_object(obj_musiccontroller)
instance_activate_object(obj_mouse)
// end of countdown:
alarm[0] = 120
Obj_pause – alarm[0]:
instance_activate_all();
surface_free(roombeforepause)
instance_destroy()
Obj_pause – draw:
// draw old room
if (surface_exists(roombeforepause)) {
draw_set_alpha(1)
draw_surface(roombeforepause,view_xview[0],0)
}
// dim out the screen
draw_set_alpha(0.5)
draw_set_colour(c_black)
draw_rectangle(0,0,room_width,room_height,false)
draw_set_alpha(1)
// draw your countdown here
In the create event, add:
time = 5:
alarm[1] = room_speed
In Alarm 1 add:
if time == "Start"
{
instance_destroy();
}
else
time -= 1;
if (time == 0)
{
time = "Start"
}
alarm[0] = room_speed;
In the draw event, where is says "// draw your countdown here", add:
draw_set_valign(fa_middle);
draw_set_halign(fa_center);
draw_text(view_wview/2,view_hview/2,time);
draw_set_valign(fa_top);
draw_set_halign(fa_left);
from Alarm 0, !REMOVE! :
instance_destroy()
This should do everything you've asked for. I hope it helps.
Another option would be to put at the top of each event:
If instance_exists(Obj_pause)
exit;
In all objects, practically the step events, mouse and key presses.
Depending on how you made the game, you may also need to set the speed and gravity of the object to 0. If you do change it to this, do not forget to remove the activation and deactivation codes from the Obj_pause as well as the surface capturing and drawing. Basically the Obj_pause will be as Soma and I have suggested.
instance_deactivate_all(true);
(make sure it is set to true) or it is being destroyed before it draws anything.
Or its not set to visible. Make sure that is ticked. Draw events don't run if it is not visible,