I'm trying to make it where when a sprite is spawned, only that one version of the sprite can be on-screen until it is destroyed. Kind of like having a missile, but prevents the player from spamming missiles and only allows for one missile to be on-screen at once.
In this instance I'm specifically attempting making the sprite appear when the button is held down, and vanish when the button is released.
This is my attempt:
I figured just make a check to only allow a button press when the sprite is off-screen, but oddly that didn't work. Then I tried to make an instance variable that would boolean a value to to true when created, and also would only allow a spawning if the boolean was false. Also didn't work. After the same failure occurred after a number variable, it became clear to me that there is something that I'm just not doing right.