Can't seem to stop actor's animation?
Poli
Member Posts: 2
I am new at Gamesalad and I can't seem to understand how boolean attributes work (hopefully due to having a mother tongue different from English and not from a poorly-developed brain?)
Here's the thing:
I have actor 1.
Rule 1:
When touch is released: actor 1 plays animation sequence 1 and plays sound 1 on loop.
Rule 2:
When touch is released: actor 1 plays animation sequence 2 and plays sound 2 (without loop).
My problem is that when "touch is released" the second time (on the 2nd rule), animation 1 and sound 1 keep playing. How do I stop them?
I also want sound 2 to play again every time I tap (touch is released). However animation sequences 1 and 2, and sound 1 should not respond to that tap.
Also, I have actors 2 and 3. I want actors 2 and 3 to respond to an event (touch, for example) ONLY after actor 1 has finished animation sequence 2 and the first play of sound 2 (there could or could not be subsequent taps to keep sound 2 working, but I want the other actors to respond to events after the first time sound 2 is played)
Hope I am making any sense!
Help will be much much much appreciated! Thank you guys!
Here's the thing:
I have actor 1.
Rule 1:
When touch is released: actor 1 plays animation sequence 1 and plays sound 1 on loop.
Rule 2:
When touch is released: actor 1 plays animation sequence 2 and plays sound 2 (without loop).
My problem is that when "touch is released" the second time (on the 2nd rule), animation 1 and sound 1 keep playing. How do I stop them?
I also want sound 2 to play again every time I tap (touch is released). However animation sequences 1 and 2, and sound 1 should not respond to that tap.
Also, I have actors 2 and 3. I want actors 2 and 3 to respond to an event (touch, for example) ONLY after actor 1 has finished animation sequence 2 and the first play of sound 2 (there could or could not be subsequent taps to keep sound 2 working, but I want the other actors to respond to events after the first time sound 2 is played)
Hope I am making any sense!
Help will be much much much appreciated! Thank you guys!
Best Answer
-
jamie_c ImagineLabs.rocks Posts: 5,772For the first part of your questions you need to count the number of touches. Like this:
Make a new integer attribute called touches (or whatever) and start it at 0.
Then for your rules on actor 1:
Rule:
When touch is released and touches = 0, play sound and animation 1 AND change attribute touches to touches+1.
Do another rule:
When touch is released and touches = 1, play sound and animation 2 AND change attribute touches to touches+1.
So now it's keeping count of how many times that actor has been touched and you can act accordingly.
Hope that helps some.
Answers