Raiper34 Posted July 8, 2015 Share Posted July 8, 2015 Hi, I have for example smiliar animation sheet:Is it good way to create animation like this? this.animations.add('walk', [1,2]); , because i inherit from sprite object and this animation is in sprite object, or is there any smarter, more elegant solution? Second question, when i destroy sprite object with this animation, is animation destoryed too? Or should i create special method destory where first destory animation and then object itself? Thanks and sorry for maybe dumb questions. Link to comment Share on other sites More sharing options...
substandardgaussian Posted July 9, 2015 Share Posted July 9, 2015 Yes, destroying the sprite destroys its animation handlers. You can see that in the documentation for sprite.destroy. As for the rest, you can organize your code in whatever way seems clearest to you. You'll need to call animations.add somewhere, that's the primary intended way to add animations to sprites. Link to comment Share on other sites More sharing options...
Recommended Posts