Namespace of gameobjects

Any tips how new functions should be named in a gameobject to not override the framework functions by mistake?

Get/setData() is great for data but it looks a bit awkward for functions:

        sprite.setData('fire', function() {alert('fire');});
        sprite.getData('fire')();

Thanks in advance.

Just avoid everything in https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Sprite.html :smiley:

1 Like

Actually, Sprite.name seems quite useful; “Empty by default and never populated by Phaser, this is left for developers to use.” It’s supposed to be a string, but if Phaser is not using that then I can simply put my Object data there :slight_smile: