How does one destroy a sprite/mark it for garbage collection?
I have a Key
sprite, when the character picks it up it should disappear. It won't be needed again.
How does one destroy a sprite/mark it for garbage collection?
I have a Key
sprite, when the character picks it up it should disappear. It won't be needed again.
I think by calling its remove()
method?
And if you have a reference to it anywhere, set that to nil
[spriteVariable]:remove() will take it out of the rendering / updating per frame.
(Inside Playdate)
But then to remove it from memory, as Gamma mentioned set it's reference / variable to nil