BAS:

        '** DEMO ANIMATION (MAIN) **
        'must be loaded from a CpcAlive command file.
        'files SYSTEM\MAINJUMP.BAS
        'and   EX\BMP.BAS
        'must be loaded first.

        MEMORY &8FFF

        MODE 1:ScreenMode=1

        SpriteStar0=0
        SpriteStar1=1
        SpriteStar2=2
        SpriteStar3=3
        gosub STAR_LOAD:'** STAR LOADER **

        'create output file
        er%=0:|ANICREA,"DEMO.FLI",@er%
        if er%<>0 then PRINT"ERROR":END

        'speed animation
        |ANISPEED,1

        '** MAIN IMAGE **
        'record pixels outputs (end of COPY with |FRAMEOUT or |PASTE)
        SpriteImage=4
        |COPY,SpriteImage:'Create Sprite

        ImgName$="EX\ICONE.BMP"
        ximg=0:yimg=0:'    image coordinates
        BackGround=-1:'    not transparent background
        FirstInk=4:'       first ink use in palette
        gosub BMPDISPLAY:' ** DISPLAY BMP IMAGES 16/256 COLORS NOT COMPRESSED **

        imgx=0:imgy=0
        for i=0 to 10
                gosub FRAMEOUT:'output frame
        next
        for i=0 to 50
                imgx=imgx+4:imgy=imgy+2
                'display recording sequence with displacement
                |PASTE,imgx,imgy,SpriteImage
                gosub FRAMEOUT:'output frame
        next
        for i=0 to 10
                imgx=imgx+4
                'display recording sequence with displacement
                |PASTE,imgx,imgy,SpriteImage
                gosub FRAMEOUT:'output frame
        next
        for i=0 to 10
                |PASTE,imgx,imgy,SpriteImage
                gosub FRAMEOUT:'output frame
        next
        for i=0 to 2

                starx=imgx+30:stary=imgy+150
                gosub STAR_AFFI
                starx=imgx+60:stary=imgy+160
                gosub STAR_AFFI
                starx=imgx+50:stary=imgy+175
                gosub STAR_AFFI
                starx=imgx+90:stary=imgy+155
                gosub STAR_AFFI

        next
        for i=0 to 10
                |PASTE,imgx,imgy,SpriteImage
                gosub FRAMEOUT:'output frame
        next

        'close output file
        |ANICLOSE,@er%:gosub ErAsk

        'exit the emulator with message
        |exit,"type <fli2gif demo.fli> to display the animation"


;<movx,imgy=coordinates
STAR_AFFI:
        SpriteStar=SpriteStar0
        gosub FrameOutWithStars:'output frame with star
        SpriteStar=SpriteStar1
        gosub FrameOutWithStars:'output frame with star
        SpriteStar=SpriteStar2
        gosub FrameOutWithStars:'output frame with star
        SpriteStar=SpriteStar3
        gosub FrameOutWithStars:'output frame with star
        SpriteStar=SpriteStar2
        gosub FrameOutWithStars:'output frame with star
        SpriteStar=SpriteStar1
        gosub FrameOutWithStars:'output frame with star
        SpriteStar=SpriteStar0
        gosub FrameOutWithStars:'output frame with star
        return


'output frame with stars
FrameOutWithStars:

        |PASTE,imgx,imgy,SpriteImage
        |PASTE,starx,stary,SpriteStar
        goto FrameOut2

'output frame without stars
FrameOut:

        |PASTE,imgx,imgy,SpriteImage

FrameOut2:

        |FRAMEOUT,@er%
        cls
ErAsk:
        IF er%<>0 then PRINT "ERROR":END else return

