FOR rule.
benjaminmage
Member Posts: 74
I want to play an animation for every single score increment. How do i do this?
I want to play an animation for every single score increment. How do i do this?
Comments
How are you incrementing your score ?
@Socks Like this.
When actor collides with actor of type Bird
Change Attribute game.score to game.score+1
Change Attribute game.Animate to true
Then in the animation actor:
When attribute game.Animate is true
Animate
After 1 second (duration of animation)
Change game.Animate to false
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang its working but apparently, it only plays the animation once and thats it..
Your rule is:
If attribute game.Animate is true
Animate
What I wrote was [somehow "Timer" didn't make it in my first post]:
If attribute game.Animate is true
Animate
Timer After 1 second (duration of animation)
Change game.Animate to false
*For future reference, if you place a behavior outside of a rule, it triggers instantly assuming there are no other "loose" behaviors above it. So your Change Attribute game.Animate Score to false would actually trigger as soon as the scene loads. It needs to be inside of a timer that is inside of the rule.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User