Mizukage Posted June 26, 2015 Share Posted June 26, 2015 Hi. If I have some player spritesheets, 9 frames in a row then I can use code like this example player = game.add.sprite(90, game.world.height-150, 'Goku');player.animations.add('left', [0, 1, 2, 3], 10, true);player.animations.add('right', [5, 6, 7, 8], 10, true);But problem is when I have sprtiesheet with two rows of frames, how do it then?? Link to comment Share on other sites More sharing options...
rich Posted June 29, 2015 Share Posted June 29, 2015 Exactly the same way. Just make sure when you load your sprite sheet you accurately tell it how many frames there are and if there is any vertical spacing needed. Link to comment Share on other sites More sharing options...
Account Deleted Posted June 29, 2015 Share Posted June 29, 2015 So here is my preloader asset: this.sprite = this.game.load.spritesheet('player1' , '../path/to/file.png', width, height); the sprites width is 32 and the height is 48. Then when you do animations everything is sequential. So using your scott pilgram frames to run left you would do something like. this.sprite.animations.add('runLeft', [8,9,10,11,12,13,14,15], 20, true); Link to comment Share on other sites More sharing options...
Recommended Posts