NikoFenix Posted May 17, 2017 Share Posted May 17, 2017 Hello, it's me again with a new disturbing ... I have an enemy that I declare equal to this example ... But I want to give you animation so that you do not look quiet all the time the object that follows you, any ideas ??? Link to comment Share on other sites More sharing options...
jpdev Posted May 17, 2017 Share Posted May 17, 2017 Add those two lines below the line that creates the "spider": spider.animations.add("ani1", [1, 2, 3, 4], 10, true); spider.animations.play("ani1"); When running the exmaple, the gameboys will now switch color Edit of the linked example: http://codepen.io/anon/pen/OmojRb?editors=0010 Now switch the different color pictures of the gameboys with spider animation frames. Done Here is the example you can look at: http://phaser.io/examples/v2/animation/sprite-sheet Notice that the example doesn't specify frames, but the spider code above does. You need to specify frames if you have more than one animation in the sprite sheet. Link to comment Share on other sites More sharing options...
NikoFenix Posted May 17, 2017 Author Share Posted May 17, 2017 Oh, thank you very much, I've been seeing how to implement it and I do not have it: DDD Link to comment Share on other sites More sharing options...
Recommended Posts