Jump to content

Animation, fire event on end?


TomFiveThumbs
 Share

Recommended Posts

Here are my animations

baddie.animations.add('fly',[0,1],5,true);baddie.animations.add('hit',[2,0,2],10,false);baddie.animations.play('fly');

When the baddie is hit:

baddie.animations.play('hit');

It plays the hit animation once, then stays on the last frame.

 

Is there a way I can get it to fire an event, or process a function after the animation is done? I can see there is a killOnComplete option, but no onComplete function option.

 

The only real way I can see this working is having a timer or counter, then going back to the fly animation, but that's a bit sloppy and could get annoying with multiple baddies.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...