Pause game

Hello,

I was wondering if it is posable to use Director Class to make a pause menu?
I have a button that open a new screen (pause menu) on top of the level screen (the problem is it does not stop the game!). Do you open a pause menu in a new screen? And can you use Director Class?
Also, what code would I need?

Thanks, I am new to all this!

--

Also:

In my game I have a ball (That rolls around!). I was wondering if I can "set a objective point" with Director Class. Is this posable? When the ball made contact with it, it would use Director Class to open a new screen (level 2). Is this how this should be done? If so, how can I use Director Class to do this?

Thanks, I am new to all this!

--

Does any one know the answers to those (2) questions?

Thanks!

I'm not sure if this is the best way... But it's a way.

I made my pause menu as a graphical overlay. I put as many buttons on it as I wanted. And for functionality, I set up a state machine to handle the state of the game based on if the pause menu was up.

For your second question, I'd set up something that triggers a scene change on collision.

Hope that helps a bit...

AFAIK, there is no way to use Director class to load a pause "scene" keeping current "scene".

In my game, I am doing what goldengod503 suggested.

You can also look at Rakoonic's alternative to director class he has posted here.

http://developer.anscamobile.com/forum/2011/04/27/alternative-homage-director-early-code-included-maybe-interest

as for question 2, yes you can implement your objective point in whatever manner you want to implement, and when your program knows the objective is reached, use director class's change scene function.

for. e.g. if you are using physics body at objective point to determine if your ball has reached that point (and checking for collision with that physics body) then in your collision handler you can add director:changeScene statement to move to next scene (level)

views:2007 update:2011/10/12 18:33:00
corona forums © 2003-2011