resume game state after cutscene

TheBasedAbel

  • Posts: 24
Okay so from a functional standpoint what I want to do is have a normal gameplay scene, then when a certain something happens it freezes the action of the current scene, displays a little cutscene and then resumes the previous scene.

An example might be that you're in a one room dungeon with a boss and you're fighting him and you notice a door to your left, you go to the door (which pauses the boss fight and triggers a cutscene of you trying to break open the door or something) and then the game reverts and unpauses at the second just before you tried to enter the door.

Any ideas would help very much, thanks guys :)

Meestar

  • Posts: 654
Well, for the freezing there is a pause/unpause game block.
PM me if you require help.  I'm always glad to help out!

Tuo

  • *
  • Posts: 2469
How I did this in my game (pauses when a new enemy type shows up) was to make a game attribute boolean called "Pause" and then checked to see if < not < pause > > for all of my coding parts that mattered. If you learn to do it well, it's more dependable than the default pause/unpause block. Either way, you can then use a condition to trigger your cutscene (i.e. "if game is paused" or "if Pause", depending on which method you take).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

gruffman

  • *
  • Posts: 564
How I did this in my game (pauses when a new enemy type shows up) was to make a game attribute boolean called "Pause" and then checked to see if < not < pause > > for all of my coding parts that mattered. If you learn to do it well, it's more dependable than the default pause/unpause block. Either way, you can then use a condition to trigger your cutscene (i.e. "if game is paused" or "if Pause", depending on which method you take).

Just wanted to second this method!
Now available for all Android Devices - Happy Face Concentration
My Games To Date
Find A Face / Hero Of Oda / Snakes And Ladders
Hungry Monkey available at fgl.com for Sponsorship
My site - Gruffgames.com

Photon

  • Posts: 2691
How I did this in my game (pauses when a new enemy type shows up) was to make a game attribute boolean called "Pause" and then checked to see if < not < pause > > for all of my coding parts that mattered. If you learn to do it well, it's more dependable than the default pause/unpause block. Either way, you can then use a condition to trigger your cutscene (i.e. "if game is paused" or "if Pause", depending on which method you take).

Just wanted to second this method!
Third it. This is good programming practice in general, because it delegates the "decision-making" to a single game attribute, which can be easily regulated from one place in your code. You can avoid having to jump into each behavior and make sure EACH is paused because each behavior is looking at the same, single attribute.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

Tuo

  • *
  • Posts: 2469
Since it seems to be popular (been on these forums for two years and first time I've seen a question answer third'd :P), might I also add that to have more control, instead you can use a number/text game attribute, letting 0 be "normal" and then any other number to be "paused" and cause other things to happen (such as letting 1 be when the game is paused to introduce a character, 2 be for introducing of the boss, 3 for the door busting idea, etc.). That maximizes the control you have (and even allows for some actors to be paused while others aren't!).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

Photon

  • Posts: 2691
Since it seems to be popular (been on these forums for two years and first time I've seen a question answer third'd :P), might I also add that to have more control, instead you can use a number/text game attribute, letting 0 be "normal" and then any other number to be "paused" and cause other things to happen (such as letting 1 be when the game is paused to introduce a character, 2 be for introducing of the boss, 3 for the door busting idea, etc.). That maximizes the control you have (and even allows for some actors to be paused while others aren't!).
The main thing here is that if you decide to do that, plan ahead. Carefully map out what each "state" is for, and as you design actors determine early which states they are to be active under. You don't want it to become a management nightmare later on.

But if you simply need a "pause all" function, I would stick with a boolean. Not sure how complex of a scheme you are looking for. ;)

Hehe... this has become quite the multiple-post answer!
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

TheBasedAbel

  • Posts: 24
Thanks so much guys, this is why I love these forums!

I ask a lot of questions but I figure in the future the archives of these forums will be a great resource because of people like me ;)

but really it's more because of people like you guys haha.