start actor timer when touched/pressed
how can i create a timer for an actor and the timer will start once the actor is pressed. I have successfully created the timer but it starts as soon as the app start. Can i get any help to start the timer on pressed?
Best Answers
-
evert Posts: 266
In the download example, when you press the actor after 3 seconds it will get really big.
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
-
evert Posts: 266
ah you need to add another attribute then. Check example i made a score attribute.
And when you keep pressing the score will do -1 every secondNew game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
-
Toque Posts: 1,188
here is the project for what you requested......
https://www.dropbox.com/s/dorz3mtuuj79w4c/t 5 countdown.zip?dl=0When touch count down from 5 and stop at zero......
Answers
make a rule when touch is pressed, drag your timer in there.
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
I've tried it but still it's not working. Do you have any other way to solve this? i'm sorry i'm still new to this
What does your timer do?
If you make a rule when touch is pressed
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
if you have a simple rule if touched and a timer is triggered it will work.
But it may not give you the desired result. The timer will only work when pressed. So as soon as you lift finger it stops.
What are you trying to achieve?
my timer goes
every 1 second
set game.timer to game.timer-1
just that. i add it to the rule when touch
i tried to make a countdown timer. when the actor is pressed and timer start from 5 and end at 0.
So it works!! Thanks Evert and Toque. Btw, the timer counted only when i pressed right? i want it to continue counted to 0 when i released it. Do i need to add another attribute? Thanks in advance. i'm almost there
ok now it works. i just need to add rule when touch released and drag the timer. Thank you. You guys are really helpful
Great! Good luck with your game!
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Awesome!!!
Remember when you ask a question be very specific. What you want to achieve?
Good luck