vac122g@monu6.cc.monash.edu.au (Daniel Bowen) (01/08/91)
Just to get the ball rolling..... PROGRAM NAME: Galaxy AUTHOR: Daniel Bowen Monash University, Melbourne, Australia MACHINE: BBC B Not tested with BBC Master or Acorn Electron (but should work) LANGUAGE: BBC Basic 2 (includes some 6502 assembler) REQUIREMENTS: No special hardware required DESCRIPTION: Animates a spinning galaxy a la "Doctor Who". The program animates the galaxy as it draws it (completion takes well over an hour). When finished, the completed screen is saved to disc so it can be re-loaded at a later date without having to draw it all again. To make the program re-load instead of drawing the screen, use a *LOAD S.GAL 3000 and call PROCAS. NOTES: Changes that can be made in lines 1180 to 1200: - delete (1180) - Colour stars turn to when not seen (normally 0 - black) - speed (1190) - Speed at which stars move. Due to lazy way of timing delays, should be 1, 3, 7, 15, 31, 63 or 127 only. - starcolour (1200) - Colour of stars (normally 3 - yellow) cut here- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10REM "galaxy" - Spiralling galaxy 1.0 15REM by Daniel Bowen 20X=RND(-TIME) 30MODE2:VDU23,1,0;0;0;0; 40PROCAS:PROCs 50FORS%=1TO23:C%=RND(13)+2:N=RND(1)*PI*2:R%=40:G%=RND(INT(R%/30))+10:H%=450+RND(124):I=N:REPEAT I=I+2*PI/(14*G%):R%=R%+2:C%=(C%+1)MOD14:X%=640+2*R%*COS(I):Y%=H%+R%/3*SIN(I):Z%=POINT(X%,Y%) 60IFFNerk(I)>PI ORPOINT(X%,Y%)=0 GCOL0,2+C%:PLOT69,X%,Y% 100UNTIL(X%<0 ORX%>1279)AND(Y%<250 ORY%>773):IFINKEY$(0)=" "THEN S%=200 110PRINTTAB(0,0);S%:NEXTS%:PRINTTAB(0,0)" " 120*SAVE :0.S.GAL 3000+5000 130COLOUR1:GCOL0,1:MOVE 0,200:VDU5,19,1,7;0; 140PRINT" SPIRALLING GALAXY" 200GOTO200 270DEFFNerk(I):REPEAT IFI>2*PI I=I-2*PI 280UNTIL I<=2*PI:=I 300DEFPROCs:LOCALR%,Z%,S,C%,A,N:R%=120 310FORZ%=-R%TOR%STEP2:S=SQR(R%*R%-Z%*Z%):C%=RND(14)-1:N=RND(1):FORA=N TON+2*PI STEPPI/14/2:C%=(C%+1)MOD14:GCOL0,2+C%:PLOT69,640+COS(A)*S*2,512+SIN(A)*S/3+Z%*1.7:NEXTA,Z% 360ENDPROC 999DEFPROCAS 1000FORion=0TO2STEP2:P%=&A00 1010osword=&FFF1:oswrch=&FFEE:osbyte=&FFF4 1020[OPTion 1030.fin jmp finish 1040.routine sta &FC:pha:txa:pha:tya:pha:php:lda &FC:cmp #4 1050bne fin 1060inc yesno:lda yesno:and speed 1070sta yesno:bne fin 1080lda colnum:ldx delete:jsr changecol 1090inc colnum:lda colnum:.ERK cmp #16 1100bne nothigh:lda #2:sta colnum 1110.nothigh 1120lda colnum:ldx starcolour:jsr changecol 1140.finish plp:pla:tay:pla:tax:pla 1150rts 1160.colnum EQUB 0 1170.yesno EQUB 0 1180.delete EQUB 0 1190.speed EQUB 1 1200.starcolour EQUB 3 1220.changecol sta&70:stx&71:ldx#&70:ldy#0:lda#&C:jmp osword 1230]NEXT 1240?&220=routine MOD256:?&221=routine DIV256:*FX14 4 1250ENDPROC ---cut here as well---- -- Raymond Luxury-Yacht |ATHEISM IS A NON-PROPHET ORGANISATION/ Rick Astley's a.k.a. DANIEL BOWEN |------------------------------------/ latest album wasn't MONASH UNIVERSITY, | vac122g@vx24.cc.monash.edu.au | released - it escaped! MELBOURNE, AUSTRALIA |vac122g@monu6.cc.monash.edu.au | escaped [Round The Bend]