BB___REMOVESPRITE

=REMOVESPRITE= toc

Description
> This command removes a Sprite from a GRAPHICBOX or a Graphics Window. > To add a sprite please read ADDSPRITE.

GraphicBox Control

 * 1) Print #Handle.Extension, "removesprite spritename"
 * 2) #Handle.Extension "removesprite spritename"

Graphics Type Window

 * 1) Print #Handle, "removesprite spritename"
 * 2) #Handle "removesprite spritename"

Hints
> Remember to avoid checking collisions, position and other properties for removed sprites. A way to know which sprites were removed is to create a string variable to hold a list.

Example
//This example uses the image from this article. Save it to a folder of your choice and run this code from the same folder.// code format="lb" NOMAINWIN LOADBMP "BMP","sprite_jb_guy_1.bmp" Open "Just BASIC - Sprite Demo - Addsprite" For Graphics_nsb_nf as #main #main "Trapclose [quit]" #main "AddSprite player BMP" Timer 56,[redraw] Wait

[redraw] counter = counter + 1 ' when the counter reaches 40 we will remove the sprite if counter = 20 then #main "RemoveSprite player" ' set the timer to zero stop the timed loop timer 0

end if

#main "Drawsprites"

Wait

[quit] Timer 0 Close #main UNLOADBMP "BMP" End

code

Useful Functions
code format="lb" Place a useful function using this keyword here code