Needing help with timer please
mythicapps
Member Posts: 82
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?
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
- Alex
- Alex
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
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
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
I'll try that tonight when I get home from work.
Much appreciated.
Thanks