Actor triggers or plays Animate Behavior

tvgrafxtvgrafx Member Posts: 30
edited November -1 in Working with GS (Mac)
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

Comments

  • JGary321JGary321 Member Posts: 1,246
    tvgrafx
    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.
  • tvgrafxtvgrafx Member Posts: 30
    Weird I just tried adding a Time and a Change Attribute within the time, but it does seem to be working.
Sign In or Register to comment.