Jump to content

jump Animation from Sprite sheet


Recommended Posts

Hello Guys,


I have today started working on a small task using HTML5 and Pixi JS. I have done my tasks by looking at examples of Pixi.JS but stuck with the Character Jump. I have loaded Json sprite sheet using AssetLoader and then i have used MovieClip to play running animation frames but now i don't know how i can make character jump :(  here is my source code


var framesRide = [];for (var i = 1; i < 7; i++) {framesRide.push(PIXI.Texture.fromFrame("hero_ride_loop_0" + i + ".png"));};heroRide = new PIXI.MovieClip(framesRide);heroRide.position.x = 300;heroRide.position.y = 286;heroRide.anchor.x = heroRide.anchor.y =  0.5;heroRide.play();heroRide.animationSpeed = 0.5;stage.addChild(heroRide);heroRide.interactive = true;heroRide.click = function(d) {console.log("clicked"); Here i want this character to Jump also change the animation. Which is loaded already in the assets.};

Please help me with that :)


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...