dudeperfect Posted January 2, 2015 Share Posted January 2, 2015 I have an animation, where crocodile moves his mouth up, so the frame images height is constantly changing. What I get - jumping animation(whole head moves down). I would like to ask, what can I do to avoid it? Is it a problem in my code(do I need set some settings), is my sprite sheet packer is doing wrong? Or I made mistake in my Photoshop where I created the sprites? buildCrocodile: function() { this.crocodile = this.add.sprite(0, 0, 'croco', 'Crocodile01'); this.crocodile.anchor.set(0.5, 0.5); this.crocodile.animations.add('Eat'); this.crocodile.animations.play('Eat', 4, true); this.physics.enable(this.crocodile); this.crocodile.body.collideWorldBounds = true; },croco.xml Who spots something odd, please tell me. Thank you. Link to comment Share on other sites More sharing options...
shmikucis Posted January 3, 2015 Share Posted January 3, 2015 Designer usually creates sprites with same frame width and height. It is much easier to deal with them later.You can try to set anchor to (0.5, 1). It could help in your case not to change image itself. dudeperfect 1 Link to comment Share on other sites More sharing options...
Recommended Posts