ceb Posted March 13, 2014 Share Posted March 13, 2014 Hi, Im really struggle with this and im quite new to phaser please help. Im trying to make a spritesheet image of a coin animate constantly but on a timer. Any ideas? Link to comment Share on other sites More sharing options...
ctmartinez1992 Posted March 13, 2014 Share Posted March 13, 2014 function preload() { // 30x30 is the size of each frame, 20 is the number of frames game.load.spritesheet('name', 'path to spritesheet', 30, 30, 20);}function create() { var animatedSprite = game.add.sprite(300, 200, 'name'); // Add an animation animatedSprite.animations.add('walk'); //Plays the animation at a constant rate of 20 frames per second and it loops because the last parameter is true animatedSprite.animations.play('walk', 20, true);}However, i don't understand what you mean when saying that it animates constantly but on a timer Link to comment Share on other sites More sharing options...
ceb Posted March 13, 2014 Author Share Posted March 13, 2014 Hey, Thanks for the reply, and by "constantly but on a timer" i meant, on a loop haha Link to comment Share on other sites More sharing options...
ceb Posted March 13, 2014 Author Share Posted March 13, 2014 Your code fixed my problem cheers Link to comment Share on other sites More sharing options...
ctmartinez1992 Posted March 13, 2014 Share Posted March 13, 2014 cheers Link to comment Share on other sites More sharing options...
Recommended Posts