how to random with animation images

imissu2imissu2 Member Posts: 12
edited November -1 in Working with GS (Mac)
Hello, I'm new here.

Can anyone help me with random and animation?

An actor in the scene will be stop at frame 1.
It will randomly have animation and can be clicked too.

If it's clicked, it'll change itself to "dead" animation and then go back to frame 1 again.

-------------------------------------------------------------------------------
I create variable "timer >real" in the actor. and then put this code in the actor.

Rule
>> Attribute > self.Time= self.timer+random(1,6)

Timer >
For 3 seconds
Animate>
13 frames of animation by speed 30fps.

---------------------------------------------------------------------------------

Comments

  • imissu2imissu2 Member Posts: 12
    my problem now is when the animation is not completed yet, the Rule random as true again.
    So my animation jump to start over again.
  • imissu2imissu2 Member Posts: 12
    Anyone?

    How to force the animation to finish before able to do the other thing.

    When my animation is playing,if I touch the actor, it'll jump to the other behavior.
  • Rob2Rob2 Member Posts: 2,402
    You can test for the current state of an animation using self.image.

    image
  • imissu2imissu2 Member Posts: 12
    Thank you so much Rob2. It's worked.
Sign In or Register to comment.