Jump to content

Multiple animation sequences? (SOLVED)


Recommended Posts

Hi guys


Normally I would setup my movie clip like this ...


Mouse = game.Class.extend({
    init: function(x, y) {
        this.sprite = new game.MovieClip([
        this.sprite.anchor.set(0.5, 0.5);
        this.sprite.position.x = x;
        this.sprite.position.y = y;
Is there any way to add more animation sequences? For example, jump, walk?
Thank you in advance!
Link to comment
Share on other sites

You can do it like this:

this.runAnim = [    game.Texture.fromFrame('run01.png'),    game.Texture.fromFrame('run02.png'),    game.Texture.fromFrame('run03.png')];this.jumpAnim = [    game.Texture.fromFrame('jump01.png'),    game.Texture.fromFrame('jump02.png'),    game.Texture.fromFrame('jump03.png')];this.sprite = new game.Animation(this.runAnim);// Change animthis.sprite.textures = this.jumpAnim;
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.

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.


  • Recently Browsing   0 members

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