Actor triggers or plays Animate Behavior
tvgrafx
Member Posts: 30
So I have an Actor button (Call "Play" @ 100x100) trying to trigger or play an Actor (Called "Animation" @ 480x320) that has a series of PNG's + alpha, within an Animate Behavior.
My button plays the animation when first pressed, but does not reset itself to played again when the button is pressed for a second time. Which is what I'm hoping to have happen:)
I added a Game Attribute call "Animation" (it's an integer) and then added a rule to the "Play"
Actor Buttom (to play animation)
RULE
Actor receives event, touch is pressed
CHANGE ATTRIBUTE ACTION
Change Attribute game.animation to 2
Actor "Animation" (to play PNG's)
RULE
Attribute game.animation = 2
within the Rule is the ANIMATE BEHAVIOR
30 fps and Restore actor image when done is checked
This is the last part of my iphone app. Would like for the user to be able to press the play button more than once to see the animation. Any help would be appreciated.
Keith
My button plays the animation when first pressed, but does not reset itself to played again when the button is pressed for a second time. Which is what I'm hoping to have happen:)
I added a Game Attribute call "Animation" (it's an integer) and then added a rule to the "Play"
Actor Buttom (to play animation)
RULE
Actor receives event, touch is pressed
CHANGE ATTRIBUTE ACTION
Change Attribute game.animation to 2
Actor "Animation" (to play PNG's)
RULE
Attribute game.animation = 2
within the Rule is the ANIMATE BEHAVIOR
30 fps and Restore actor image when done is checked
This is the last part of my iphone app. Would like for the user to be able to press the play button more than once to see the animation. Any help would be appreciated.
Keith
Comments
Member
So I have an Actor button (Call "Play" @ 100x100) trying to trigger or play an Actor (Called "Animation" @ 480x320) that has a series of PNG's + alpha, within an Animate Behavior.
My button plays the animation when first pressed, but does not reset itself to played again when the button is pressed for a second time. Which is what I'm hoping to have happen:)
I added a Game Attribute call "Animation" (it's an integer) and then added a rule to the "Play"
Actor Buttom (to play animation)
RULE
Actor receives event, touch is pressed
CHANGE ATTRIBUTE ACTION
Change Attribute game.animation to 2
Actor "Animation" (to play PNG's)
RULE
Attribute game.animation = 2
within the Rule is the ANIMATE BEHAVIOR
30 fps and Restore actor image when done is checked
Add
`Timer - After .5 - Change Attribute game.Animation = 0`
REASON: Since game.animation is already 2 it cannot change it to 2, therefore will never trigger again.