Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Is there anyway to add a pause menu?

nexusyellow428
Registered User
Quote
2020-06-16 23:49:41

I'm trying to make a pause menu for my game. The one method I saw was switching to another scene, then switching back, but this meant I had to create a separate pause menu for every screen. Is there an easier way to do this?


count2rfeit
Registered User
Quote
2020-06-17 00:31:03

you can use the same pause scene for all you other scenes- create a variable (maybe name it "pause" and use 'before first drawing do something' in each of your scenes and give that variable a different number for each scene (scene1 =1, scene2=2, and so on), then use the 'save variable'

then in your pause scene use 'before first drawing' and then 'load variable - the name you made' - when you are ready to exit pause scene use 'if a variable has a value do something', use the variable name your made and the number you used for scene 1... under 'action' go to scene 1

do the same 'if a variable has a value do something' for the number you used for each of your scenes and go to each scene number.

hopes this makes sense...


nexusyellow428
Registered User
Quote
2020-06-17 00:44:53

wrote:
you can use the same pause scene for all you other scenes- create a variable (maybe name it "pause" and use 'before first drawing do something' in each of your scenes and give that variable a different number for each scene (scene1 =1, scene2=2, and so on), then use the 'save variable'

then in your pause scene use 'before first drawing' and then 'load variable - the name you made' - when you are ready to exit pause scene use 'if a variable has a value do something', use the variable name your made and the number you used for scene 1... under 'action' go to scene 1

do the same 'if a variable has a value do something' for the number you used for each of your scenes and go to each scene number.

hopes this makes sense...


I'm confused. Is there any way you could give a demonstration?


count2rfeit
Registered User
Quote
2020-06-17 03:11:12

o.k. - I'll see if I can put something together for you. I'll add the .cbb file when I get it done. Probably tomorrow


nexusyellow428
Registered User
Quote
2020-06-17 04:10:20

wrote:
o.k. - I'll see if I can put something together for you. I'll add the .cbb file when I get it done. Probably tomorrow

Thanks in advance!


count2rfeit
Registered User
Quote
2020-06-17 04:44:23

well, I actually had it wrong... you need to use the key press set up to pause the game to save the "pause" variable. I got to messing with it - kept on till I figured it out - so I finished it this evening....

here is the .ccb for you to look at.

https://www.mediafire.com/file/n...

cheers


count2rfeit
Registered User
Quote
2020-06-18 17:07:45

just wanted to add a note here - I try to do everything I can Using CC as it is... that's part of the fun for me when building a scene, to figure out how to make CC work to do what I want...

but of course, you can do the pause scene using java scripts... and it would do the same thing. but why should you when CC will do it already.

And yes, there are things CC out-of-the-box won't do, so sometimes you have to add scripts to enhance you scene (which I do) - but I think Niko has made a wonderful game builder with CC so I just like to use it the way he made it as much as I can. And hopefully another update is coming to make CC even better!

thanks


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact