8-Bit Software Online Conversion
Animation demo - Listing
10MODE 2:COLOUR 15
20PRINT TAB(6)"ANIMATION":VDU 5
30PROCball(150,900,100,-PI/6)
40PROCball(1190,945,75,-5*PI/4)
50PROCball(620,512,200,7*PI/6)
60PROCball(200,-292,400,0)
70PROCdots:PROCp
80VDU 19,1,6;0;19,2,4;0;19,15,10;0;29
,0;0;
90FOR I%=9 TO 14:VDU 19,I%,0;0;:NEXT
100REPEAT
110FOR I%=3 TO 8
120J%=I%-1:IF J%=2 J%=8
130VDU 19,J%,4;0;19,I%,6;0;
140VDU 19,J%+6,0;0;19,I%+6,3;0;
150K9=INKEY(5)
160NEXT
170UNTIL FALSE
180DEF PROCball(X%,Y%,R%,Tilt)
190 VDU 18;2,29,X%;Y%;:MOVE 0,R%
200FOR Phi=0 TO 6.4 STEP .15
210 MOVE 0,0:PLOT 85,R%*SIN Phi,R%*COS
Phi
220NEXT
230Col%=3
240FOR Phi=0 TO 3.1 STEP .1
250GCOL 0,Col%
260PROCarc(R%*COS Phi,R%,0,PI/2+Tilt,P
I/2)
270Col%=Col%+1:IF Col%=9 Col%=3
280NEXT
290GCOL 0,1
300FOR Theta=.5 TO 2.5 STEP .5
310PROCarc(-R%/4*SIN Theta,R%*SIN Thet
a,R%*COS Theta,Tilt,1.5)
320NEXT
330ENDPROC
340DEF PROCarc(H%,W%,D%,Alpha,Beta)
350S=SIN Alpha:C=COS Alpha
360X%=W%*SIN Beta:Y%=D%+H%*COS Beta
370MOVE C*X%+S*Y%,C*Y%-S*X%
380FOR Gamma=-Beta TO Beta+.1 STEP .25
390X%=-W%*SIN Gamma:Y%=D%+H%*COS Gamma
400DRAW C*X%+S*Y%,C*Y%-S*X%
410NEXT
420ENDPROC
430DEF PROCp
440X%=1179:Y%=130:R%=100:Col%=9
450FOR Tilt=0 TO 1.2 STEP .05
460GCOL 0,Col%:PROCbox(X%,Y%,R%,Tilt)
470X%=.9*X%+80:Y%=.5*Y%+440:R%=R%*.92
480Col%=Col%+1:IF Col%=15 Col%=9
490NEXT
500ENDPROC
510DEF PROCbox(X%,Y%,R%,Tilt)
520 VDU 29,X%;Y%;
530S=SIN Tilt:C=COS Tilt
540MOVE R%*(C+S),R%*(C-S)
550DRAW R%*(C-S),R%*(-C-S):DRAW R%*(-C
-S),R%*(S-C)
560DRAW R%*(S-C),R%*(C+S):DRAW R%*(C+S
),R%*(C-S)
570ENDPROC
580DEF PROCdots
590VDU 29,0;0;
600FOR I%=0 TO 40
610X%=1279:Y%=25*I%:X1%=-8*(2+RND(2)):
Y1%=1-RND(3):Col%=RND(6)+8
620REPEAT Col%=Col%+1:IF Col%=15 Col%=
9
630P%=POINT(X%,Y%):IF P%=0 GCOL 0,Col%
:PLOT 69,X%,Y%
640X%=X%+X1%:Y%=Y%+Y1%
650UNTIL P%<0
660NEXT
670ENDPROC