Pause functionality

FanStudioUKFanStudioUK Member Posts: 459
edited November -1 in Working with GS (Mac)
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

Comments

  • FanStudioUKFanStudioUK Member Posts: 459
    bump.

    PRO HELP NEEDED! :)
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Hey, this tutorial wont work for accelerate, you'll either need to use move, or move to, or apply a counter accelerate, during pause. Cheers, Good Luck!

    -Will
  • FanStudioUKFanStudioUK Member Posts: 459
    Wow, thank you so much for your reply.
    Could yoy please be more specific regarding the counter accelerate option?

    Thanks,
    Andrei
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Hey, sorry I'm driving, but basically your going to want to apply the exact opposite acceleration to stop it from moving. You'll also need to make sure it only applies when pause is true and acceleration is true. So make sure you create an attribute to monitor the acceleration and only apply it when it's true. Sorry, make sense? Well it's raining out and I have to watch the road, but lemme know if you have any questions.
  • FanStudioUKFanStudioUK Member Posts: 459
    I think I get your idea, I will try and apply what you suggest tomorrow morning when I'll get back to the office...
    Than you very much, I will keep you posted :)

    Andrei
  • chosenonestudioschosenonestudios Member Posts: 1,714
    No problem. :D Good Luck!

    -Will
  • FanStudioUKFanStudioUK Member Posts: 459
    I've created a variable which is the speed of the acceleration. When the game is paused the value is changed to 0.
    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
  • FanStudioUKFanStudioUK Member Posts: 459
    bump
  • FanStudioUKFanStudioUK Member Posts: 459
    anyone? :D
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Andreib21, I don't think there is. Anything using physics attributes will have to "run their course" and so can't be frozen. The Pause example is good but it's still a workaround. We are all waiting (especially QS?!) for a "proper" pause Behaviour to be implemented by Gendai, that would work like when you pause in Preview.

    :-{

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • FanStudioUKFanStudioUK Member Posts: 459
    oh my god, we are lost!
    I'll have to think of something else then....

    thank you very much!

    Andrei
  • synthesissynthesis Member Posts: 1,693
    There isn't a way to pause acceleration. Its a logarithmic/parabolic physics algorithm with complex math behind it and to break it in mid stream isn't feasible within GS and be able to pick up where you left off.

    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.
  • synthesissynthesis Member Posts: 1,693
    BTW:
    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.
  • FanStudioUKFanStudioUK Member Posts: 459
    Yes, it is a linear direction on the Y axis, I still don't understand exactly how to use the interpolate behavior. I will search for a tutorial.

    Thank you once again :)
Sign In or Register to comment.