8-Bit Software Online Conversion

Space Planets Animation - Listing

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