BAS:

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

        MEMORY &8FFF
        ScreenMode=1:MODE ScreenMode		
        SpriteStar0=0
        SpriteStar1=1
        SpriteStar2=2
        SpriteStar3=3
        ximg=0:yimg=0:'         image coordinates
        FirstInk=0:'            First ink use in palette
        BackGround=0:'          BackGround pen
        gosub STAR_LOAD:'** STAR LOADER **

        'create output file
        er%=0:|ANICREA,"DEMO.GIF",@er%
        if er%<>0 then PRINT"File creation error";er%:END

        'speed animation
        |ANISPEED,10

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

        ImgName$="EX\ICONE.GIF"
        ximg=0:yimg=0:'image coordinates
        BackGround=-1:'not transparent background
        FirstInk=StarPalSize:'first ink use in palette
		gosub IMGDISPLAY:' ** DISPLAY IMAGES GIF OR IMAGES BMP 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,"The animation created is the file DEMO.GIF"


;<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";er%:END else return





















