• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker (SOLVED) Building a Pause Game code

Vinsane

Member
Hey there,

I'm currently stuck on creating a pause system for my game. My game currently runs on a timeline based system and because of this it is causing me a bit of grief when allowing the player to pause the game.

I would like to know if there is a way I can pause an individual timelines speed?
Here is my current little system I thought up,

if global.pausecycle = 1
{
global.pause = 1
}

if global.pausecycle = 0
{
global.pause = 0
global.pausecycle = 0
WE NEED TO PAUSE THE CURRENT ROOMS TIMELINE
I would assume it would be
(timelinename1).timeline_speed = 0;
(timelinename2).timeline_speed = 0;
(timelinename3).timeline_speed = 0;
but that does not work
}

if global.pause = 1
{


}


else

{

}

if global.pausecycle = 2
{
global.pause = 0
global.pausecycle = 0
(timelinename1).timeline_speed = 1;
(timelinename2).timeline_speed = 1;
(timelinename3).timeline_speed = 1;
}


Can anyone please assist me on this because I would rather my game have a pause function just because the player may need to step away from the PC.

Thanks,

Sincerely,
Vince
 

Vinsane

Member
I think I might have solved the issue by replacing (timelinename1).timeline_speed = 1; with (timelineobject).timeline_speed = 1;. so pretty much I used the actual timeline instance instead of the timelines name itself. I will keep everyone posted.
 
Top