Creating a custom class without extending any existing Phaser 3 classes

Hi all,

i would like to know if it’s possible to create a custom class able to handle 5 different animated sprites without extending the built in classes of phaser 3 (like sprite or image). In this case, i would like to know how adding to the class to a phaser project, handling correctly every sprite animation.

Thanks

Why would you want to do this? It would take a lot of work, funky wiring, etc. When you subclass a Phaser class, you are getting a ton of parent code with that class that taps into the animation system of Phaser, offers you all of the API methods that we use to create our classes, etc.

What are you trying to do, as there may be a better way?

Hi! thanks for the answer!

i want to obtain the full control over a class made by me, and reading the Phaser 3 docs, seems that is possible to load images only during the preload phase,
but my class load and handle dinamically during a certain time up to 5 animated sprites anchored to the object and i would know if it is possible to load dinamically outside the phaser 3 preload function.

Thanks!