Sorry, last time I coded is when I was working with AS2, and I'm picking this up slowly.
var sprite = this.add.sprite(pointer.x + cam.scrollX, pointer.y + cam.scrollY, 'small_fence').setInteractive();
sprite.iName = fenceCount;
sprite.on('pointerdown', function ()
I spawn sprites in and make them interactive. What I'm trying to do is, I want to reference these sprites later. How can I reference a specific sprite? For example in AS2, I used to be able to give them an instance name like "Sprite1." I would then be able to reference it later like:
Is there a way to do this with Phaser, so I can manipulate the sprite when I can't use