QuentinIcky Posted February 18, 2017 Share Posted February 18, 2017 Hi all ! As the title said, I have a sprite sheet who has a strange behaviour. It's difficult to explain so you can see the uploaded file to see. I add my sprite sheet like this inside the preload() : level2.load.spritesheet('hil', 'dest/img/sprite-Level2.png', 373, 265, 8); In the create() : player = level2.add.sprite(380, level2.height - 430, 'hil', 1); player.frame = 0; player.enableBody = true; player.scale.setTo(0.5); player.animations.add('left', [0,1,2,3,4,5,6,7,8], 5, true); And in the update() : if (cursors.left.isDown) { player.body.velocity.x = -800; player.animations.play('left'); } I searched a lot but I didn't find anything to help me. I can't understand why it doesn't work. If somebody knowes, it could be very helpfull. Thanks by advance. spritesheet.mov Link to comment Share on other sites More sharing options...
Rydez Posted February 19, 2017 Share Posted February 19, 2017 So I'm not quite sure exactly what behavior you are referring to. Would I be correct in assuming that you're referring to how to character is coming into, then leaving the sprite? If so, I'm fairly confident that it's an issue with your sprite sheet and not your code. If that's not a correct assumption, would mind narrowing down to the problem you're concerned about? Link to comment Share on other sites More sharing options...
QuentinIcky Posted February 21, 2017 Author Share Posted February 21, 2017 Yes you're right. I finally succeed to do it by making another spritesheet thanks ! Link to comment Share on other sites More sharing options...
Recommended Posts