1

How to destroy an spriteļ¼Ÿ


Once put into the game, sprite will always exist.

aSpriteInit((aSprite*)&zidan[h],&bmary4_spr,bullsprNum,16,350,-250,0,FLIP_NONE,AS_FLAGS_DEFAULT);


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.
avatar