SecondBASIC Documentation v3

Home / Command Reference / FreeSprite

FreeSprite

Description: Resets/destroys <Sprite>

Syntax:

FreeSprite <Sprite>

Part Description
<Sprite> Required. <Sprite> is the variable you prepared with AddSprite().

Example:

    Dim sprites(5) As Integer
 
    For i = 0 To 5
        sprites(i) = AddSprite(1,1)
        PropSprite sprites(i),1,0
        MoveSprite sprites(i),136+(i<<4),136
    Next
 
    Locate 4,0: Print "Press Start to clear some sprites"
    While 1
        j = JoyPad(0)
        If j.7 Then
            FreeSprite sprites(5)
            FreeSprite sprites(3)
            Exit While
        End If
    Wend
 
    End