One touch for a full animation

klaazimodoklaazimodo Member Posts: 1
edited April 2012 in Working with GS (Mac)
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?

Best Answers

  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    edited April 2012 Accepted Answer
    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
  • MotherHooseMotherHoose Posts: 2,456
    Accepted Answer
    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: false

    image MH

Answers

  • klaazimodoklaazimodo Member Posts: 1
    Wow,

    thanks a lot. I didn't expect a reaction this fast.
    I'll try it out right away.
  • jckmcgrawjckmcgraw Member Posts: 647
    @klaazimodo I would recommend almost always using a boolean attribute for doing anything close to that because you have much more to work with. Relying on stuff like "when touch is pressed do this", tends to be problematic. Once I learned this, it was a huge step forward for me.

    Jack
Sign In or Register to comment.