Needing help with timer please

mythicappsmythicapps Member Posts: 82
edited November -1 in Working with GS (Mac)
Afternoon;

I am having a bit of a fight with a timer I am trying to use.

I have an attribute that is used to count touches, so that a double touch sends the user to a different scene.
The attribute is integer and is called "self.tapcount", this works fine.

I have added a new rule below the change scene rule and have added a timer to it.
I set the timer to every 2 seconds, change the self.tapcount attribute to "0". But it does not do this.

I have watched a couple of the tutorial videos and read a number of posts on this but I still cannot sort out what I am doing wrong.

Any thoughts?

Comments

  • osucowboy18osucowboy18 Member Posts: 1,307
    Whenever I have a problem with a timer, I usually change the value of the "Run to Completion" checkbox. So if its checked, uncheck it, and vise versa. Good luck.

    - Alex
  • mythicappsmythicapps Member Posts: 82
    osucowboy18 said:
    Whenever I have a problem with a timer, I usually change the value of the "Run to Completion" checkbox. So if its checked, uncheck it, and vise versa. Good luck.

    - Alex

    Thanks for the idea, I tried it but no change.
  • osucowboy18osucowboy18 Member Posts: 1,307
    mythicapps said:
    Thanks for the idea, I tried it but no change.

    Bummer :( Could you post a screenshot of all the rules in this particular actor? Maybe if I actually see it, something will come to mind.

    - Alex
  • mythicappsmythicapps Member Posts: 82
    osucowboy18 said:
    Bummer :( Could you post a screenshot of all the rules in this particular actor? Maybe if I actually see it, something will come to mind.

    - Alex

    I'd be happy to, but there is no option to add an attachment in this forum.
  • mythicappsmythicapps Member Posts: 82
    OK, since I can't figure out how to do screen shots here is a more detailed description of the problem.

    I have an actor (invisible) it is on top of the whole scene.
    In the actor are the following rules and such.

    The actor has an attribute called self.tapcount it's an integer and starts at "0".

    Rule
    When actor touch is pressed
    change attribute self.tapcount to self.tapcount +1

    Rule
    When attribute self.tapcount = 2
    Change scene

    Rule
    Timer every 2 seconds
    Change attribute self.tapcount to "0"

    Everything but the timer is working.

    Thanks
  • mythicappsmythicapps Member Posts: 82
    Bump
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    The rule with the timer every 2 seconds should be as this:

    When attribute tapcount=2
    Put a Timer in that rule and have it be after 1 second, and run to completion checked
    change attribute tap count to 0 in that timer

    cheers
  • mythicappsmythicapps Member Posts: 82
    OK, I tried that but no success. No matter how long there is between touch 1 and 2, it goes to the new scene.

    This is how the actor rules looks now.

    Rule
    When actor touch is pressed
    change attribute self.tapcount to self.tapcount +1

    Rule
    When attribute self.tapcount = 2
    Timer after 1 second
    Change attribute self.tapcount to "0"

    Rule
    When attribute self.tapcount = 0
    Change scene
  • mythicappsmythicapps Member Posts: 82
    Thanks TSB;

    I'll try that tonight when I get home from work.
    Much appreciated. :)
  • mythicappsmythicapps Member Posts: 82
    TSB your a genius, it works perfectly.

    Thanks :)
Sign In or Register to comment.