home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 November / 1994-11b.d64 / u-boat (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  140 lines

  1. 100 poke55,0:poke56,48::clr:print"[147]"chr$(8):goto880
  2. 110 :
  3. 120 fori=0to27:pokei+54272,0:next
  4. 130 poke54296,15:poke54272,100:poke54273,5:poke54277,0:poke54278,249
  5. 140 poke54279,100:poke54280,2:poke54284,0:poke54285,249
  6. 150 poke54291,0:poke54292,249:m=v:goto340
  7. 160 :
  8. 170 mv=1:p=peek(56320):ifp=127thenmv=0
  9. 180 if(pand16)=0orlthengosub420
  10. 190 if(pand8)=0thenay=ay+1:x=12:ifay>38thenay=ay-1
  11. 200 if(pand4)=0thenay=ay-1:x=10:ifay<0thenay=ay+1
  12. 210 if(pand2)=0thenax=ax+40:ifax>360thenax=ax-40
  13. 220 if(pand1)=0thenax=ax-40:ifax<-80thenax=ax+40
  14. 230 a=ax+ay+1424:p=peek(a):p0=peek(a+1):ifmvthenpokea1,17:pokea1+1,17
  15. 240 pokea,x:pokea+1,x+1:a1=a
  16. 250 ifp<2orp0<2then760
  17. 260 lm=lm+1:iflm<rrthen300
  18. 270 n1=n1+40:co=peek(n1):ifn1=aor1=a+1thenpoken1-40,17:goto760
  19. 280 ifn1>aorco<3then680
  20. 290 poken1-40,17:poken1,1
  21. 300 ifm>vthenprint"[144]"mid$(a$(tt),h,40);:h=h+m2:ifh=h1thenm=0:h=1
  22. 310 m=m+1:ifm=vthen340
  23. 320 goto170
  24. 330 :
  25. 340 lm=0:n1=1344+ay:t=rnd(1)*6+1:ontgoto390,380,370,360
  26. 350 tt=rnd(1)*2+1:h=2:h1=44:m2=1:rr=40-(lm+ay):goto310
  27. 360 tt=rnd(1)*2+3:h=44:h1=2:m2=-2:rr=-(lm-ay)/2:goto310
  28. 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
  29. 380 tt=4:h=46:h1=2:m2=-1:t=rnd(1)*37:n1=1344+t:rr=3-(lm-t):goto310
  30. 390 tt=2:h=2:h1=44:m2=1:t=rnd(1)*38:n1=1344+t:rr=40-(lm+t):goto310
  31. 400 :
  32. 410 rem torp move
  33. 420 l=l+1:ifl<2thenc=a:ifx=12thenc=a+1
  34. 430 c=c-40:co=peek(c):ifco<17then460
  35. 440 pokec+40,17:ifc<1344thenl=0:return
  36. 450 pokec,14:return
  37. 460 ifco<>0andco<>1then540
  38. 470 poke54276,129:poke54276,128
  39. 480 fort=-1to1:fori=-1to1:c1=peek(c+i+t*40)
  40. 490 ifc1=1thenrr=99:lm=0
  41. 500 ifc1>9andc1<14thenm1=1
  42. 510 l=0:pokec+i+t*40,(rnd(1)*2)+18:next:next:ifm1=1then760
  43. 520 fort=-1to1:fori=-1to1:pokec+i+t*40,17:next:next:return
  44. 530 :
  45. 540 print"[156]"mid$(a$(0),h,40):pokec+40,17:pokec-40,32
  46. 550 poke54276,129:poke54276,128
  47. 560 fort=1to100:next
  48. 570 print"                                        ";
  49. 580 m=0:l=0:ifco<7thenbs=bs+1
  50. 590 ifco>6thenms=ms+1
  51. 600 iflm<rrthenrr=99
  52. 610 ifms+bs=5thenpoke53281,7:v=20
  53. 620 ifms+bs=15thenpoke53281,14:v=10
  54. 630 ifms+bs=30thenpoke53281,10
  55. 640 if(ms+bs)/5=int((ms+bs)/5)thenfort=1to8:poke1384+(rnd(1)*359),0:next:j=1
  56. 650 ifj=1thenfort=-1to2:fori=-1to1:pokea+t+i*40,17:next:next:j=0
  57. 660 return
  58. 670 :
  59. 680 rr=99:ml=0:poke54283,129:poke54283,128
  60. 690 fort=-1to1:fori=-1to1:c1=peek(n1+i+t*40)
  61. 700 ifc1=14thenl=0
  62. 710 ifc1>9andc1<14thenm1=1
  63. 720 poken1+i+t*40,(rnd(1)*2)+18:next:next:ifm1=1then760
  64. 730 fort=-1to1:fori=-1to1:poken1+i+t*40,17:next:next:goto300
  65. 740 :
  66. 750 rem sub death
  67. 760 pokea,15:pokea+1,16:poke54286,0:poke54290,129
  68. 770 fort=230to255step.15:poke54287,255-t:poke53281,15andt:next:poke54290,128
  69. 780 fort=1to50:pokea,(rnd(1)*2)+18:pokea+1,(rnd(1)*2)+18
  70. 790 next:poke53272,21:poke53280,0:poke53281,5
  71. 800 print"[147][144]"spc(9)"you sank"bs"carrier";chr$(-83*(bs<>1))
  72. 810 print spc(10)"and"ms"destroyer";chr$(-83*(ms<>1))
  73. 820 printspc(6)"press trigger to play again":i=0
  74. 830 if(peek(56320)and16)=0thenrun890
  75. 840 i=i+1:ifi>1000thenprint"[147]";:end
  76. 850 goto830
  77. 860 :
  78. 870 rem init
  79. 880 gosub1060
  80. 890 print"[147]":poke53280,0:poke53281,1
  81. 900 poke53272,28:poke54296,15:zz=80000
  82. 910 x=10:v=30:ax=360:ay=20:rr=30:h=2
  83. 920 printspc(13)"[144]  u-boat  26  "
  84. 930 a$(1)="                                       bde   "
  85. 940 a$(2)="                                       fg   "
  86. 950 a$(3)="                                           bcde "
  87. 960 a$(4)="                                           hi "
  88. 970 a$(0)="                                        opop "
  89. 980 fort=1to4:print"[158]qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";:next
  90. 990 print""
  91. 1000 fort=1to12:print"qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";:next
  92. 1010 fort=1824to2023:poket,17:poke54272+t,0:next
  93. 1020 fort=1to15:poke1384+rnd(1)*359,0:next
  94. 1030 poke1794,17:poke1795,17:goto120
  95. 1040 :
  96. 1050 rem charset
  97. 1060 poke53280,0:poke53281,4:print"[147]"spc(13)"  u-boat 26  "
  98. 1070 printspc(10)"one moment please"
  99. 1080 fori=0to58:reada:poke49152+i,a:next:sys49152
  100. 1090 readt:ift=-1then1130
  101. 1100 poke12288+q,t:q=q+1:goto1090
  102. 1110 :
  103. 1120 rem instructions
  104. 1130 print"[147] fire torpedoes from the sub'sfront"
  105. 1140 print"   to sink ships and destroy mines."
  106. 1150 print" beware of the destructive area when"
  107. 1160 print"    mines and depth charges explode."
  108. 1170 print"   destroy as many ships as you can"
  109. 1180 print" before you are permanently retired."
  110. 1190 printspc(12)"press  trigger ":poke198,0
  111. 1200 ifpeek(56320)and16then1200
  112. 1210 return
  113. 1220 :
  114. 1230 data 173,14,220,41,254,141,14,220,165,1,41,251,133,1,169
  115. 1240 data 48,133,252,169,208,133,254,169,0,133,251,133,253
  116. 1250 data 162,8,177,253,145,251,200,208,249,230,254,230,252
  117. 1260 data 202,208,242,165,1,9,4,133,1,173,14,220,9,1,141,14,220,96
  118. 1270 :
  119. 1280 data 182,193,213,128,201,193,182,255
  120. 1290 data 255,159,159,159,243,243,243,255
  121. 1300 data 0,0,0,0,255,101,63,31
  122. 1310 data 0,96,112,252,255,148,255,255
  123. 1320 data 0,14,30,127,255,145,255,255
  124. 1330 data 0,0,0,0,255,166,252,248
  125. 1340 data 0,0,4,4,15,10,127,63
  126. 1350 data 0,192,196,200,208,224,255,254
  127. 1360 data 0,3,35,19,11,7,255,127
  128. 1370 data 0,0,32,32,240,80,254,252
  129. 1380 data 254,254,252,252,0,133,208,224
  130. 1390 data 255,255,127,63,0,80,3,31
  131. 1400 data 255,255,254,254,0,10,192,248
  132. 1410 data 127,127,63,63,0,161,11,7
  133. 1420 data 255,239,239,239,239,199,215,255
  134. 1430 data 65,41,68,175,122,189,110,219
  135. 1440 data 17,74,148,125,218,180,221,182
  136. 1450 data 255,255,255,255,255,255,255,255
  137. 1460 data 191,213,187,92,171,237,190,219
  138. 1470 data 247,174,181,125,235,189,173,222
  139. 1480 data-1
  140.