home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_06_(08-1984).d64
/
submarine.p
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
6KB
|
203 lines
1 PRINT"[147]"
6 POKE59467,16:POKE59466,15:POKE59464,0
10 GOSUB20000:GOTO1000
100 PRINT""SPC(8)":D.CHARGES:";:IFBA=0THENPRINT" ":GOTO110
105 FORA=1TOBA:PRINT""A"[157]";:NEXT:PRINT"[146] "
110 PRINT"SCORE:"SC"[157] ":RETURN
120 PRINTH$SPC(DP)S$:RETURN
140 POKEFNA(0),39:RETURN
150 IFDP+X+5>39THENX=X-1:FL=-FL:RETURN
155 IFDP+X-5<2THENX=X+1:FL=-FL:RETURN
160 RETURN
165 FORS=1TO20:NEXTS:RETURN
170 POKEFNA(0),32:RETURN
300 POKEE,0:POKEE,28
305 PRINTH$""SPC(SP)")(":IFBF=0THEN330
310 GOSUB160:PRINTH$""SPC(SP-1)"[205] [165][206]":GOSUB160
311 POKE59467,16:POKE59466,15
312 FORQ=1TO2
313 FORD=180TO250STEP5:POKE59464,D:NEXTD
314 POKE59467,16:POKE59466,15:POKE59464,0
315 NEXTQ:GOSUB160
320 PRINTH$""SPC(SP-1)" "
330 GOSUB160:PRINTH$""SPC(SP)" "
340 POKEE,0:RETURN
500 RETURN
510 FORL2=0TO9:NEXT:RETURN
1000 PRINT"[147]":POKE59459,255:A$=" [170][157][157][157][157] % ":B$="0[146]D"
1020 S1$=A$+"1"+B$:S3$=A$+"3"+B$:S5$=A$+"5"+B$:S7$=A$+"7"+B$:S9$=A$+"9"+B$
1030 A$="[180] [157][157][157][157]C":B$="0 [146]% ":S2$=A$+"2"+B$:S4$=A$+"4"+B$:S6$=A$+"6"+B$
1040 S8$=A$+"8"+B$:SE$=" [157][157][157] "
1060 S$=" [162] [157][157][157][157][157][157][157] [192][168] [215][215][215][146] [168][192] [157][157][157][157][157][157][157][157][157][157][157][157] [223]COMMODORE[146][169] ":H$=""
1065 SN$="[157][157][157][157] [162] [157][157][157][157][157][157][157][157][157][157][157] [192][168] [215][215][215][146] [168][192] "
1067 SM$="[157][157][157][157] [162] "
1070 DIMV$(9):V$(1)="":FORL=2TO9:V$(L)=V$(L-1)+"":NEXT
1100 DIMA(9),P(9),M(2):SS$="[185][185][190][146][185][185] ":ST$=" ":FO$="4":FI$="5":SI$="6"
1120 SC=0:BA=6:DP=20:F1=.03:F2=.1:FL=1
1130 FORL=2TO8STEP2:P(L)=36:NEXT
1150 TF=7200:DS=0:E=59471:BL=33727:SN=32768:SA=33007:SZ=80:TG=91
1160 DEFFNA(P)=PO+Y+X
2000 TI$="000000":POKE59468,12
2010 SU$="[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":PRINTSU$;
2015 FORL=33728TO33767:POKEL,104:NEXT
2020 GOSUB100:GOSUB120
3000 F=F+1:IFF>9THENF=1
3210 ONFGOTO4100,4000,3900,3800,3700,3600,3500,3400,3300
3300 IFRND(9)>F1ANDP(9)=0THEN3400
3320 P(9)=P(9)+1:IFP(9)=36THENPRINTV$(9)SPC(35)SE$;:P(9)=0:GOTO3400
3330 PRINTV$(9)SPC(P(9))S9$;
3340 IFRND(TI)<F2THENMI=9:GOSUB8000
3400 IFRND(8)>F1ANDP(8)=36THEN3500
3420 P(8)=P(8)-1:IFP(8)=0THENPRINTV$(8)" "SE$:P(8)=36:GOTO3500
3430 PRINTV$(8)SPC(P(8))S8$;
3440 IFRND(TI)<F2THENMI=8:GOSUB8000
3500 IFRND(7)>F1ANDP(7)=0THEN3600
3520 P(7)=P(7)+1:IFP(7)=36THENPRINTV$(7)SPC(35)SE$;:P(7)=0:GOTO3600
3530 PRINTV$(7)SPC(P(7))S7$;
3540 IFRND(TI)<F2THENMI=7:GOSUB8000
3600 IFRND(6)>F1ANDP(6)=36THEN3700
3620 P(6)=P(6)-1:IFP(6)=0THENPRINTV$(6)" "SE$;:P(6)=36:GOTO3700
3630 PRINTV$(6)SPC(P(6))S6$;
3640 IFRND(TI)<F2THENMI=6:GOSUB8000
3700 IFRND(5)>F1ANDP(5)=0THEN3800
3720 P(5)=P(5)+1:IFP(5)=36THENPRINTV$(5)SPC(35)SE$;:P(5)=0:GOTO3800
3730 PRINTV$(5)SPC(P(5))S5$;
3740 IFRND(TI)<F2THENMI=5:GOSUB8000
3800 IFRND(4)>F1ANDP(4)=36THEN3900
3820 P(4)=P(4)-1:IFP(4)=0THENPRINTV$(4)" "SE$;:P(4)=36:GOTO3900
3830 PRINTV$(4)SPC(P(4))S4$;
3840 IFRND(TI)<F2THENMI=4:GOSUB8000
3900 IFRND(3)>F1ANDP(3)=0THEN4000
3920 P(3)=P(3)+1:IFP(3)=36THENPRINTV$(3)SPC(35)SE$;:P(3)=0:GOTO4000
3930 PRINTV$(3)SPC(P(3))S3$;
3940 IFRND(TI)<F2THENMI=3:GOSUB8000
4000 IFRND(2)>F1ANDP(2)=36THEN4100
4020 P(2)=P(2)-1:IFP(2)=0THENPRINTV$(2)" "SE$;:P(2)=36:GOTO4100
4030 PRINTV$(2)SPC(P(2))S2$;
4100 IFRND(1)>F1ANDP(1)=0THEN4200
4120 P(1)=P(1)+1:IFP(1)=36THENPRINTV$(1)SPC(35)SE$;:P(1)=0:GOTO4200
4130 PRINTV$(1)SPC(P(1))S1$;
4200 IFTI>TFTHEN10000
4203 TH=INT((TF-TI)/SZ)+1:IFTG>THTHENPRINT"TIME"TH"[157] ":TG=TH
4205 GETC$:IFC$<FO$ORC$>SI$THEN6000
4210 FORL=0TO5:GETCE$:NEXT:IFC$=FI$THEN8300
4230 IFC$=FO$THENDP=DP-1:FL=-1:IFDP<5THENDP=5:GOTO4300
4240 IFC$=SI$THENDP=DP+1:FL=1:IFDP>32THENDP=32
4300 GOSUB120
6000 FORL=0TO5:IFA(L)=0THEN6499
6020 A(L)=A(L)+40
6030 POKEA(L)+40*(A(L)>SA),32
6040 PO=A(L):A=PEEK(PO):IF(A=32ANDRND(1)>F1)ORA=39THEN6300
6050 A(L)=0:POKEE,0:POKEE,18:POKEPO,42:GOSUB160:POKEPO,32:POKEE,0
6070 IFA=46THEN8200
6080 IFA=32ORA=104THENPOKEPO,A:GOTO6499
6100 GOSUB6110:GOTO6499
6110 Y=INT((INT((PO-SN)/40)-4)/2):X=P(Y):POKEE,0:POKEE,18
6120 POKE59467,16:POKE59466,15
6121 FORI=1TO7:POKE59467,16:POKE59466,7:POKE59464,115-.3*I
6123 POKE59466,128:NEXTI:POKE59467,0
6125 POKE59467,16:POKE59466,15:POKE59464,0
6130 PRINTV$(Y)SPC(X+1)"###"
6140 PRINTV$(Y)SPC(X)"[166][164][166][166]$"
6200 SC=SC+Y*10:DS=DS+1:GOSUB110
6210 P(Y)=0:IFY-INT(Y/2)*2=0THENP(Y)=36
6220 PRINTV$(Y)SPC(X)SE$:GOSUB160:RETURN
6300 POKEPO,39
6499 NEXT
6500 FORL=0TO2:IFM(L)=0THEN6999
6520 POKEM(L),32:M(L)=M(L)-40:PO=M(L)
6530 A=PEEK(PO):IFA=32THENPOKEPO,46:GOTO6800
6540 IFA<>39THEN6600
6550 POKEPO,42:POKEE,0:POKEE,18:GOSUB160:POKEE,0:POKEPO,32:M(L)=0:L=0
6560 IFA(L)=POTHENA(L)=0:GOTO6999
6570 L=L+1:GOTO6560
6600 IFA<>99THEN6900
6610 BF=1:PO=PO-40:B=PEEK(PO)
6620 SP=PO-INT(PO/40)*40-8:IFSP<1THENSP=SP+40
6625 IFSP<2THENSP=2
6630 GOSUB300:M(L)=0:IFB=32THEN6999
6700 GOTO8600
6800 IFRND(1)>F2THEN6999
6820 POKEE,0:POKEE,18:POKEPO,42:GOSUB160:POKEPO,32:POKEE,0:M(L)=0:GOTO6999
6900 M(L)=0:POKEE,0:POKEE,18:POKEPO,42:GOSUB160:POKEPO,32:POKEE,0:GOSUB6110
6999 NEXT
7000 IFTI<TTHEN3000
7110 T=TI+600:BA=BA+1:IFBA>6THENBA=6
7120 GOSUB100
7999 GOTO3000
8000 L=0
8010 IFM(L)=0THEN8100
8020 L=L+1:IFL<3THEN8010
8040 RETURN
8100 M(L)=32928+MI*80+P(MI)-5*(MI-INT(MI/2)*2=1):RETURN
8200 L1=0
8210 IFM(L1)=POTHENM(L1)=0:GOTO6499
8220 L1=L1+1:GOTO8210
8300 BA=BA-1:IFBA<0THENBA=0:GOTO6000
8310 POKEE,0:POKEE,25:BF=1:GOSUB100:SP=DP:GOSUB120
8330 L1=0
8340 IFA(L1)=0THEN8400
8350 L1=L1+1:GOTO8340
8400 PO=32928+DP+FL*5:X=0:Y=0
8420 X=X+FL:Y=Y-40:POKEE,0:GOSUB150
8440 GOSUB140:GOSUB170:X=X+FL:Y=Y-40:GOSUB150
8460 GOSUB140:GOSUB170:X=X+FL:GOSUB150
8480 GOSUB140:GOSUB170:X=X+FL:Y=Y+40:GOSUB150
8490 IFPEEK(FNA(0))<>32THEN8600
8500 GOSUB140:GOSUB170:X=X+FL:Y=Y+40:GOSUB150
8510 IFPEEK(FNA(0))<>32THEN8600
8520 GOSUB140:GOSUB170:SP=FNA(0)-32928:BF=0:GOSUB300
8540 A(L1)=FNA(0)+80:GOTO6000
8600 GOSUB300:POKEE,0:POKEE,18:
8604 POKE59467,16:POKE59466,15
8605 FORI=1TO20:POKE59464,100:POKE59464,50:POKE59464,200:POKE59464,0:NEXTI
8610 PRINT""SPC(DP)" "SPC(DP)SN$:FORL1=0TO200:NEXT
8615 PRINT""SPC(DP)" "SPC(DP)SM$:FORL1=0TO200:NEXT
8620 PRINT""SPC(DP)" ":FORL1=0TO200:NEXT
8690 SP=DP:GOSUB300:POKEE,18
8692 PRINT"":FORL=0TO2:PRINT" ";:NEXT
8693 FORL=0TO99:GETC$:NEXT
8695 DP=20:GOSUB120
8699 SC=INT(SC/2):GOSUB110:GOTO3000
10000 PRINT"TIME 0"
10010 IFSC<200ORF3=1THEN10100
10020 POKEE,0:POKEE,8:FORL=0TO7:PRINT"E X T E N D E D P L A Y"
10030 GOSUB165:PRINTSU$:GOSUB510:NEXT:PRINT""SPC(27)"EXTEN'D PLAY"
10080 IFSC<500THEN10099
10090 POKEE,0:TI$="000000":T=0:BA=6:F3=1:TF=3600:TG=46:GOSUB100:GOTO3000
10099 POKEE,0:TI$="000000":T=0:BA=6:F3=1:TF=2400:TG=31:GOSUB100:GOTO3000
10100 PRINTV$(3)SPC(10)"G A M E O V E R":GOSUB500
10110 IFDS=0THEN10170
10120 PRINTV$(6):FORL=1TODS
10130 PRINTSS$;:NEXT
10135 IFDS>31THENLETDS=31
10140 FORL=0TODS*8-8STEP8:POKEE,0:POKEE,31:PRINTV$(6):IFL<>0THENPRINTSPC(L)
10145 POKE59467,16:POKE59466,15
10146 FORD=175TO180STEP1:POKE59464,D:NEXTD
10149 POKE59467,16:POKE59466,15:POKE59464,0
10150 FORL1=0TO2:PRINTSS$"[157][157][157][157][157][157][157][157]";:GOSUB510:PRINTST$"[157][157][157][157][157][157][157][157]";
10160 GOSUB510:NEXT:POKEE,0:SC=SC+30:GOSUB110:NEXT
10170 PRINTV$(4)SPC(7)" YOUR SCORE: [157]"SC
10200 FORL=0TO99:GETC$:NEXT
10210 PRINTSPC(5)"PRESS ANY KEY TO PLAY AGAIN."
10215 POKE59467,16:POKE59466,15:FORS=1TO15
10216 FORD=180TO250STEP5:POKE59464,D:NEXTD:NEXTS:POKE59467,0
10217 POKE59467,16:POKE59466,15:POKE59464,0
10220 GETC$:IFC$=""THEN10220
10999 CLR:PRINT"[147]":GOTO1000
20000 POKE59468,13:PRINT"[147]"
20010 PRINT"[169] [223][146] [146] [146] [223][146] [223][146] [169][146] [169][223][146] [223][146] [146] [223][146] [146] "
20020 PRINT" [146] [146] [146] [146] [169] [223][169] [146] [169] [223][146] [146] [146] [146] [223][146] [146] "
20030 PRINT"[223] [223][146] [146] [146] [223][146] [146][223][169] [146] [146][161][161] [146] [146][169] [146] [146][223][223] [146] "
20040 PRINT" [146] [146] [146] [146] [146] [146] [146] [146] [146][223][223][146] [146] [146] [146][223] [146] "
20050 PRINT"[223] [146][169] [223] [146][169] [146][169] [146] [146] [146] [146] [146] [223][223][146] [146] [146] [146] "
20100 P2=33600:FORP1=33700TO32768STEP-40:P3=PEEK(P1):P4=PEEK(P2)
20110 POKEP1,87:POKEP2,87:FORL=0TO99:NEXT
20120 POKEP1,P3:POKEP2,P4:P2=P2-40:NEXT
20230 POKE59468,12:PRINT"[147]INSTRUCTIONS"
20340 PRINT"45 SECONDS[160]EXTENDED PLAY.(NOT INCLUDING":PRINT"BONUS.)"
20350 PRINT"THERE WILL BE 30 POINT BONUSES PER EACH":PRINT"SHIP DESTROYED!"
20900 PRINTSPC(7)"PRESS 'RETURN[146]' TO BEGIN"
20910 GETC$:IFC$=""THEN20910
29999 RETURN