here’s the deal. i want to know how to destroy the sprite of a specific name that’s been onscreen the longest, instead of the latest one.
something like:
[destroy oldest sprite (sprite variable name)]
as opposed to…
[destroy (variable name)]
if this is an option, i would appreciate knowing where i can find it, if not, it would be great if someone could make an extension for it. thank you, and stay creative!
On sprite creation, use sprite data to assign the current game ms.
To destroy the oldest sprite just iterate over all of them or the type you want and just destroy the sprite data with the smallest game time, as that would be the oldest
Try accessing the first element of the get all sprites of kind block. I believe they are placed there in order of creation. Once you define a sprite (eg. mySprite), that sprite is now assigned to the variable. When you assign it again, the variable is now the new sprite, and the old one persists in the game, but is no longer assigned.
Here’s an example.
(press A to destroy a sprite)
I hope this helps, if you have any more questions, please ask!