Pause functionality
FanStudioUK
Member Posts: 459
Hi guys,
I've integrated in my game the Pause functionality from this tutorial http://gamesalad.com/wiki/how_tos:gsc_game_pause_tutorial and I have a big problem.
My player is using a jet pack, so when you press the button it goes up, otherwise I gave him the action to accelerate down with a certain speed.
I have also put two limits, up and down so it wont get off the screen.
The game starts paused so you need to touch the screen in order to start the game. The problem appears when I press the pause button again and changes my boolean variable "Game is paused" back to 1. Every moving actor on the scene stops except the player which if he's already touched the down limit he's starting to go down this limit with a speed of 1px per second and gets off the screen!!!
This is insane and I really don't know why it's happening. Is this a bug from GS ?
Did someone else got into this problem?
Any help will be much appreciated
Thank you
I've integrated in my game the Pause functionality from this tutorial http://gamesalad.com/wiki/how_tos:gsc_game_pause_tutorial and I have a big problem.
My player is using a jet pack, so when you press the button it goes up, otherwise I gave him the action to accelerate down with a certain speed.
I have also put two limits, up and down so it wont get off the screen.
The game starts paused so you need to touch the screen in order to start the game. The problem appears when I press the pause button again and changes my boolean variable "Game is paused" back to 1. Every moving actor on the scene stops except the player which if he's already touched the down limit he's starting to go down this limit with a speed of 1px per second and gets off the screen!!!
This is insane and I really don't know why it's happening. Is this a bug from GS ?
Did someone else got into this problem?
Any help will be much appreciated
Thank you
Comments
PRO HELP NEEDED!
-Will
Could yoy please be more specific regarding the counter accelerate option?
Thanks,
Andrei
Than you very much, I will keep you posted
Andrei
-Will
Still, this doesn't seem to fix the error, I have to find another solution.
Is there any other way to pause a game which will allow me to use the Acceleration behavior?
Thank you,
Andrei
:-{
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I'll have to think of something else then....
thank you very much!
Andrei
The move commands are linear and not logarithmic. So to break them is much easier as the speed value is constant...not dynamic (eased).
The only way I can think of to stop an acceleration rate is to spawn a clone actor at its current point on pause and destroy the old actor. But this can cause problems too...if you game is something that is continuous...like a platformer and your actor is in mid-air.
One thing you might try (I have never tried it but it might work) is if your actor is going is a linear direction...such as running right...then you are only dealing with the X velocity of the actor.
That value could be controlled by an attribute and then you could use interpolation to control that value similar to an acceleration behavior. Then if the pause button is pressed...the interpolation is abandoned in lieu of a change attribute to zero behavior. Then after pause...the interpolation goes back to its activity after a velocity boost prior.
Thank you once again