Question With Timing Touches

Hey, im working on a project that allows the user to click on an actor, and every time the actor is pressed, +1 is added on to an attribute. But since pressing it as many times as the user can, ruins the point and I want to know if there is a way were I can limit the touches with time, or seconds... for example

I have a red button, every time you press this red button you get a candy and you can press it as many times as you want. But I want to make it so you can only press the red button every 3 seconds. So you are limited to 1 candy every 3 seconds...

I would really appreciate your knowledge, and It would be great to have a solution :) Thanks in advance - Dylan -

Best Answer

  • tatiangtatiang Posts: 11,949
    edited January 2013 Accepted Answer
    Reminds me of a Skinner box. :(

    Add an integer attribute called self.touchTime and set it to -3.

    Then use this rule:

    When [all] touch is pressed AND self.Time>self.touchTime+3
    .....[add one to attribute]
    .....Change Attribute self.touchTime to self.Time

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.