adamyall Posted April 11, 2014 Share Posted April 11, 2014 I have a jump animation and a midair movement animation.The jump animation is 5 frames long, and I want it to play all the way through when the player jumps from a grounded state. However if the user jumps starting from the ground, then starts to move left or right, it plays the midair movement animation. Now, when the user stops moving, I want to transition back to jumping, but starting at frame 4 or 5 of the jumping animation.sprite.play(name);sprite.animations.frameName = frameId;I've also tried using animations.frame = number, but no luck with that either. I just need to know if there's a play, but skip to frame method that I'm not seeing. Link to comment Share on other sites More sharing options...
Heppell08 Posted April 11, 2014 Share Posted April 11, 2014 Maybe create multiple animations with different names for the jump. Then keep the standard jump animation but if jumping and velocity is + or - then play another animation with the fraames required. Then the falling animation can be created to play when the velocity on y is + or -.Basically, split it into multiples, set the velocities per animation and test. Link to comment Share on other sites More sharing options...
adamyall Posted April 11, 2014 Author Share Posted April 11, 2014 Something like that is definitely a fallback Link to comment Share on other sites More sharing options...
rich Posted April 12, 2014 Share Posted April 12, 2014 There's no way to jump to a point in an animation yet, raise it as a request on github - it could be a parameter of the play call. Link to comment Share on other sites More sharing options...
adamyall Posted April 12, 2014 Author Share Posted April 12, 2014 I figured out how to do it, but you have to touch a lot of private members. I'm going to take a crack at implementing it in 2.0.3 dev, but not going to make it a parameter to play. Link to comment Share on other sites More sharing options...
adamyall Posted April 12, 2014 Author Share Posted April 12, 2014 Pull request added. (Here's a link for anyone interested)https://github.com/photonstorm/phaser/pull/706 Link to comment Share on other sites More sharing options...
Recommended Posts