SteveMavic Posted May 28, 2016 Share Posted May 28, 2016 Hello. I have a problem with sprite. Phaser don't see the last two animations (the animations of jump). I want to do a second "layer" of animations, but I don't want to make a very, very long picture, btw How can I solve this? Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 28, 2016 Share Posted May 28, 2016 Use spine. Link to comment Share on other sites More sharing options...
Tom Atom Posted May 28, 2016 Share Posted May 28, 2016 There are two problems you have to solve with spritesheet: load all frames - you have 12 frames. Load your spritesheet like: game.load.spritesheet(key, url, width_of_frame, height_of_frame, number_of_frames_total) ... number_of_frames_total = 12 in your case. Refer to this example: http://phaser.io/examples/v2/animation/sprite-sheet (mummy frames are not all in one row), create your animations - "walk", "jump" in your case, like this: this.animations.add("walk", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); and this.animations.add("jump", [11, 12]); ... simply refer to frame indices. Then you can play anims like: sprite.animation.play(anim_name) ... anim_name = "walk" / ""jump" SteveMavic 1 Link to comment Share on other sites More sharing options...
SteveMavic Posted May 29, 2016 Author Share Posted May 29, 2016 Thank you, it helped a lot Link to comment Share on other sites More sharing options...
Recommended Posts