Button Timer Start

carlblanchetcarlblanchet Member Posts: 755
edited June 2012 in Working with GS (Mac)
So I am trying to accomplish something that once the user clicks and holds an actor, which is movable by the user once pressed, a 3 second count down starts (with 3,2,1 appearing on the screen) and once that 3 second timer goes by without the user releasing the actor, the game starts. As well as when they release the actor during gameplay, the game pauses, and to resume the game, the same 3 seconds hold thing applies again.

How would that be done?

PLEASE! & THANK YOU SO MUCH!

Best Answer

  • master200012master200012 Posts: 372
    Accepted Answer
    Use a rule with the following.
    --------RULE--------
    When all of the following are true,
    mouse position is inside,
    mouse button is down,

    constrain attribute (self.position.x) to (game.mouse position x)
    constrain attribute (self.position.y) to (game.mouse position y)
    --------Timer (inside rule)----
    After three seconds (do NOT run to completion),
    Unpause game
    ------TIMER ENDS-------
    ------OTHERWISE-------
    pause game
    ------RULE ENDS--------

    I hope this helps!

Answers

Sign In or Register to comment.