How to destroy an spriteļ¼Ÿ

Once put into the game, sprite will always exist.


If you let it be destroyed. It will be put out of the screen. But it still exists. If there are a lot of sprite, it will greatly slow down the game.

if (zidan[h].as.posX>=310) {zidan[h].as.posX=350; zidan[h].as.posY=-250; zidan[h].flag=0; }

How to destroy a sprite when it's off the screen?

Thank you very much.