home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_06_(08-1984).d64
/
u-boat
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
5KB
|
140 lines
10 POKE55,0:POKE56,48:CLR:PRINT"[147]"CHR$(8):GOTO880
110 :
120 FORI=0TO27:POKEI+54272,0:NEXT
130 POKE54296,15:POKE54272,100:POKE54273,5:POKE54277,0:POKE54278,249
140 POKE54279,100:POKE54280,2:POKE54284,0:POKE54285,249
150 POKE54291,0:POKE54292,249:M=V:GOTO340
160 :
170 MV=1:P=PEEK(56320):IFP=127THENMV=0
180 IF(PAND16)=0ORLTHENGOSUB420
190 IF(PAND8)=0THENAY=AY+1:X=12:IFAY>38THENAY=AY-1
200 IF(PAND4)=0THENAY=AY-1:X=10:IFAY<0THENAY=AY+1
210 IF(PAND2)=0THENAX=AX+40:IFAX>360THENAX=AX-40
220 IF(PAND1)=0THENAX=AX-40:IFAX<-80THENAX=AX+40
230 A=AX+AY+1424:P=PEEK(A):P0=PEEK(A+1):IFMVTHENPOKEA1,17:POKEA1+1,17
240 POKEA,X:POKEA+1,X+1:A1=A
250 IFP<2ORP0<2THEN760
260 LM=LM+1:IFLM<RRTHEN300
270 N1=N1+40:CO=PEEK(N1):IFN1=AORN1=A+1THENPOKEN1-40,17:GOTO760
280 IFN1>AORCO<3THEN680
290 POKEN1-40,17:POKEN1,1
300 IFM>VTHENPRINT"[144]"MID$(A$(TT),H,40);:H=H+M2:IFH=H1THENM=0:H=1
310 M=M+1:IFM=VTHEN340
320 GOTO170
330 :
340 LM=0:N1=1344+AY:T=RND(1)*6+1:ONTGOTO390,380,370,360
350 TT=RND(1)*2+1:H=2:H1=44:M2=1:RR=40-(LM+AY):GOTO310
360 TT=RND(1)*2+3:H=44:H1=2:M2=-2:RR=-(LM-AY)/2:GOTO310
370 TT=RND(1)*2+3:H=46:H1=2:M2=-2:T=RND(1)*37:N1=1344+T:RR=3-(LM-T)/2:GOTO310
380 TT=4:H=46:H1=2:M2=-1:T=RND(1)*37:N1=1344+T:RR=3-(LM-T):GOTO310
390 TT=2:H=2:H1=44:M2=1:T=RND(1)*38:N1=1344+T:RR=40-(LM+T):GOTO310
400 :
410 REM TORP MOVE
420 L=L+1:IFL<2THENC=A:IFX=12THENC=A+1
430 C=C-40:CO=PEEK(C):IFCO<17THEN460
440 POKEC+40,17:IFC<1344THENL=0:RETURN
450 POKEC,14:RETURN
460 IFCO<>0ANDCO<>1THEN540
470 POKE54276,129:POKE54276,128
480 FORT=-1TO1:FORI=-1TO1:C1=PEEK(C+I+T*0)
490 IFC1=1THENRR=99:LM=0
500 IFC1>9ANDC1<14THENM1=1
510 L=0:POKEC+I+T*40,(RND(1)*2)+18:NEXT:NEXT:IFM1=1THEN760
520 FORT=-1TO1:FORI=-1TO1:POKEC+I+T*40,17:NEXT:NEXT:RETURN
530 :
540 PRINT"[156]"MID$(A$(0),H,40):POKEC+40,17:POKEC-40,32
550 POKE54276,129:POKE54276,128
560 FORT=1TO100:NEXT
570 PRINT" ";
580 M=0:L=0:IFCO<7THENBS=BS+1
590 IFCO>6THENMS=MS+1
600 IFLM<RRTHENRR=99
610 IFMS+BS=5THENPOKE53281,7:V=20
620 IFMS+BS=15THENPOKE53281,14:V=10
630 IFMS+BS=30THENPOKE53281,10
640 IF(MS+BS)/5=INT((MS+BS)/5)THENFORT=1TO8:POKE1384+(RND(1)*359),0:NEXT:J=1
650 IFJ=1THENFORT=-1TO2:FORI=-1TO1:POKEA+T+I*40,17:NEXT:NEXT:J=0
660 RETURN
670 :
680 RR=99:ML=0:POKE54283,129:POKE54283,128
690 FORT=-1TO1:FORI=-1TO1:C1=PEEK(N1+I+T*40)
700 IFC1=14THENL=0
710 IFC1>9ANDC1<14THENM1=1
720 POKEN1+I+T*40,(RND(1)*2)+18:NEXT:NEXT:IFM1=1THEN760
730 FORT=-1TO1:FORI=-1TO1:POKEN1+I+T*40,17:NEXT:NEXT:GOTO300
740 :
750 REM SUB DEATH
760 POKEA,15:POKEA+1,16:POKE54286,0:POKE54290,129
770 FORT=230TO255STEP.15:POKE54287,255-T:POKE53281,15ANDT:NEXT:POKE54290,128
780 FORT=1TO50:POKEA,(RND(1)*2)+18:POKEA+1,(RND(1)*2)+18
790 NEXT:POKE53272,21:POKE53280,0:POKE53281,5
800 PRINT"[147][144]"SPC(9)"YOU SANK"BS"CARRIER";CHR$(-83*(BS<>1))
810 PRINTSPC(10)"AND"MS"DESTROYER";CHR$(-83*(MS<>1))
820 PRINTSPC(6)"PRESS TRIGGER TO PLAY AGAIN":I=0
830 IF(PEEK(56320)AND16)=0THENRUN890
840 I=I+1:IFI>1000THENPRINT"[147]";:END
850 GOTO830
860 :
870 REM INIT
880 GOSUB1060
890 PRINT"[147]":POKE53280,0:POKE53281,1
900 POKE53272,28:POKE54296,15:ZZ=80000
910 X=10:V=30:AX=360:AY=20:RR=30:H=2
920 PRINTSPC(13)"[144] U-BOAT 26 "
930 A$(1)=" BDE "
940 A$(2)=" FG "
950 A$(3)=" BCDE "
960 A$(4)=" HI "
970 A$(0)=" OPOP "
980 FORT=1TO4:PRINT"[158]QQQQQQQQQQQQQQQQQQQQQQQQQQ0000000000000000";:NEXT
990 PRINT""
1000 FORT=1TO12:PRINT"QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ";:NEXT
1010 FORT=1824TO2023:POKET,17:POKE54272+T,0:NEXT
1020 FORT=1TO15:POKE1384+RND(1)*359,0:NEXT
1030 POKE1794,17:POKE1795,17:GOTO120
1040 :
1050 REM CHARSET
1060 POKE53280,0:POKE53281,4:PRINT"[147]"SPC(13)" U-BOAT 26 "
1070 PRINTSPC(10)"ONE MOMENT PLEASE"
1080 FORI=0TO58:READA:POKE49152+I,A:NEXT:SYS49152
1090 READT:IFT=-1THEN1130
1100 POKE12288+Q,T:Q=Q+1:GOTO1090
1110 :
1120 REM INSTRUCTIONS
1130 PRINT"[147] FIRE TORPEDOES FROM THE SUB'S FRONT"
1140 PRINT" TO SINK SHIPS AND DESTROY MINES."
1150 PRINT" BEWARE OF THE DESTRUCTIVE AREA WHEN"
1160 PRINT" MINES AND DEPTH CHARGES EXPLODE."
1170 PRINT" DESTROY AS MANY SHIPS AS YOU CAN"
1180 PRINT" BEFORE YOU ARE PERMANENTLY RETIRED."
1190 PRINTSPC(12)" PRESS TRIGGER ":POKE198,0
1200 IFPEEK(56320)AND16THEN1200
1210 RETURN
1220 :
1230 DATA173,14,220,41,254,141,14,220,165,1,41,251,133,1,169
1240 DATA48,133,252,169,208,133,254,169,0,133,251,133,253
1250 DATA162,8,177,253,145,251,200,208,249,230,254,230,252
1260 DATA202,208,242,165,1,9,4,133,1,173,14,220,9,1,141,14,220,96
1270 :
1280 DATA182,193,213,128,201,193,182,255
1290 DATA255,159,159,159,243,243,243,255
1300 DATA0,0,0,0,255,101,63,31
1310 DATA0,96,112,252,255,148,255,255
1320 DATA0,14,30,127,255,145,255,255
1330 DATA0,0,0,0,255,166,252,248
1340 DATA0,0,4,4,15,10,127,63
1350 DATA0,192,196,200,208,224,255,254
1360 DATA0,3,35,19,11,7,255,127
1370 DATA0,0,32,32,240,80,254,252
1380 DATA254,254,252,252,0,133,208,224
1390 DATA255,255,127,63,0,80,3,31
1400 DATA255,255,254,254,0,10,192,248
1410 DATA127,127,63,63,0,161,11,7
1420 DATA255,239,239,239,239,199,215,255
1430 DATA65,41,68,175,122,189,110,219
1440 DATA17,74,148,125,218,180,221,182
1450 DATA255,255,255,255,255,255,255,255
1460 DATA191,213,187,92,171,237,190,219
1470 DATA247,174,181,125,235,189,173,222
1480 DATA-1