CLEAR ALL
num=128
TYPE ext
    FIELD x,y,xs,ys
END TYPE
DIM b(7)
FOR i=1 TO 7
    b(i)=FREE.BITMAP
    BITMAP b(i) LOAD "Floyd"+STR$(i)+".bmp"
NEXT i
DIM s(num) AS ext
t=1
FOR i=1 TO num
    s(i).x=RANGE(0,1279)
    s(i).y=RANGE(0,799)
    s(i).xs=RANGE(8,24)
    s(i).ys=RANGE(8,24)
    SPRITE i BIND BITMAP b(t)
    t=t+1:IF t>7 THEN t=1
    SPRITE i SHOW MOVE s(i).x,s(i).y
NEXT i
DO
    FOR i=1 TO num
        s(i).x=s(i).x+s(i).xs
        s(i).y=s(i).y+s(i).ys
        IF s(i).x<0 OR s(i).x>=1280 THEN s(i).xs=-s(i).xs
        IF s(i).y<0 OR s(i).y>=800 THEN s(i).ys=-s(i).ys
        SPRITE i MOVE s(i).x,s(i).y
    NEXT i
    PAUSE
LOOP WHILE INKEY$=""
