How you make pause for custom timers?

I have a game for which i used custom timers like in @tshirtbooth tutorial.
How i can stop the timers for pause the game and then start from same second?
Any exemples?

I have an idea but i want to find solutions from more experimented user.
I would probably register the left time in moment of pause and then trow back to my timer when press resume.

PS: i`m new in GS

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited May 2013
    Something like this?

    The rule inside the timer actor is only firing when the game.Pause attribute (integer) is not equal to 0.


  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Or maybe I misunderstood you - Are you saying that the timer still runs when you pause the game? You want to know how much time had elapsed since they paused, then subtract that amount from the running timer. Pretty easy, then. See the attached demo.

  • liviuliviu PRO Posts: 8
    Very good examples! Thank you @Braydon_SFX.

    I try to use "pause game" action from GS, i have many actors in scene, and it will take to much to stop every element in scene in a custom way.

    I also use "change attribute:game.start time to game.time"
    Constrain attribute game.MyTimer to self.timer level-(game.Time-game.start time)

    On screen it will be game.MyTimer, my problem is that "pause game from GS" is not stoping game.Time (and i believe is normal to work like this) so i need a workaround , i would probably use GS timers i would have 3 per scene probably 50 levels(it counts if is in scene or in entire game? how GS timers can be displayed?)

    I would like to use your example @Braydon_SFX but in this moment i would have to much work to create a custom pause, if i don`t have options and you recommend to go for custom pause for game, i would chose the best option.
Sign In or Register to comment.