One touch for a full animation

Hey guys and girls,
I'm working on an app for children and one of the things they'll
be able to do is to tap on an animal and it will animate and play a sound.
The problem I have now is that you have to press and hold to see
the full animation rather than one single tap.
The rule I've created is simply:
- When touch is pressed:
- Animate
How can I make it so you only have to press once to
see the complete animation?
I'm working on an app for children and one of the things they'll
be able to do is to tap on an animal and it will animate and play a sound.
The problem I have now is that you have to press and hold to see
the full animation rather than one single tap.
The rule I've created is simply:
- When touch is pressed:
- Animate
How can I make it so you only have to press once to
see the complete animation?
Best Answers
-
JohnPapiomitis Posts: 6,256
make an attribute called startAnimation
Rule:
When touch is pressed
-change attribute startAnimation to true
Rule:
When attribute startAnimation=true
-animate
you can also add a timer after (however many seconds it takes to complete the animation)
-change attribute startAnimation to false
that way you can repeat the animation on a new press if you want that
cheers -
MotherHoose Posts: 2,456
Like that! … @JohnPapiomitis
also you can use a rule, instead of timer, if the last image has not appeared previously in imageSequence
your animationBehavior then
Rule: when
Attribute: self.image = name of last image
--changeAttribute: game.startAnimation To: falseMH
Answers
thanks a lot. I didn't expect a reaction this fast.
I'll try it out right away.
Jack