home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 February / 1985-02.d64 / b (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  86 lines

  1. 20 dimmn(4,6),dr(8),rm(4)
  2. 30 fori=1to4:forj=1to6:readmn(i,j):nextj:nexti:fori=1to8:readdr(i):next
  3. 40 fori=1to4:rm(i)=1:next
  4. 50 data7792,5,6,22,7,1,7802,8,9,1,10,5,7946,15,16,1,17,2,7956,23,24,22,25,4
  5. 60 data1,-1,-22,-21,-23,22,23,21
  6. 70 deffny(x)=int(x/22):deffnx(x)=x-(fny(x)*22):deffna(x)=int(rnd(1)*x)+1
  7. 80 tp$="(,,,,,,,,,,,,,,,,,,,,)":bt$="+,,,,,,,,,,,,,,,,,,,,*"
  8. 90 si$="-                    -":ml$="@@@@@@@@@":lv=1:sc=0:mq=1
  9. 100 poke36878,10:poke36879,8:poke36869,252:c=30720:p=7910
  10. 110 iftc=4thentc=0:gosub790
  11. 120 gosub180
  12. 130 gosub430:p=(mn(rm,1)+8)+9*(p1=-1)
  13. 140 ifmq<>11thengoto110
  14. 150 print"[147][158]game over[146]"
  15. 160 print"press any key":print"to play again[146]"
  16. 170 poke198,0:wait 198,1:print"":run
  17. 180 gosub690:gosub710:print"":fori=1to4:ifrm(i)=0thenpokemn(i,1)+3,160
  18. 190 next:pokep,46:pokep+c,2:gosub760
  19. 200 sys7168:p1=dr(peek(820)):tp=peek(p+p1)
  20. 210 if(tp<>32)and(tp<>39)then200
  21. 220 p=p+p1:iftp=32thenpokep-p1,32:pokep+c,2:pokep,46:goto200
  22. 230 tp=p:fori=1to4:if(mn(i,1)=p)or(mn(i,1)+7=p)thenrm=i:i=5
  23. 240 nexti:p=7897+(17*(p=mn(rm,1))):mt=mn(rm,2):mb=mn(rm,3):mp=mn(rm,4)
  24. 250 md=mn(rm,5):mc=mn(rm,6)
  25. 260 ifrm(rm)=1thenpokep-p1,32:pokep+c,2:pokep,46:return
  26. 270 p=tp-p1:goto200
  27. 280 fori=1to4:mm=mm+1:ifmm=4thenmm=0
  28. 290 ifm(mm)<>0theni=6
  29. 300 nexti
  30. 310 ifi=5thenreturn
  31. 320 v1=p-7680:y1=fny(v1):x1=fnx(v1):v=m(mm)-7680:y=fny(v):x=fnx(v)
  32. 330 m=22*(y>y1)-22*(y<y1):m=m-1*(x<x1)+1*(x>x1):tm=m(mm)+m:q=peek(tm)
  33. 340 r=peek(tm+mp)
  34. 350 if(q=0)or(r=0)thenmq=mq+1:goto410
  35. 360 if(m<>mp)and(m<>-mp)then400
  36. 370 ifm=mpthenif(r<>0)and(r<>32)thenreturn
  37. 380 ifm=-mpthenif(q<>0)and(r<>32)thenreturn
  38. 390 goto410
  39. 400 if(q<>32)or(r<>32)thenreturn
  40. 410 pokem(mm),32:pokem(mm)+mp,32:poketm+c,mc:poketm+mp+c,mc:poketm,mt
  41. 420 poketm+mp,mb:m(mm)=tm:return
  42. 430 gosub690:gosub740:gosub760:pokep,0:pokep+c,2
  43. 440 fori=0to3
  44. 441 x=fna(19):y=fna(13):z=7680+x+(y*22)
  45. 442 ifpeek(z)<>32then441
  46. 443 pokez,mt:pokez+mp,mb
  47. 450 pokez+c,mc:pokez+mp+c,mc:m(i)=z:nexti
  48. 470 x=fna(18)+1:y=fna(12)+1:z=x+7680+(y*22):ifpeek(z)<>32then470
  49. 480 tr=10+rm:tl=z:poketl,tr:poketl+c,6
  50. 490 sys7168:p1=peek(820):c1=p1:p1=dr(p1)
  51. 500 ifpeek(p+p1+p1)=93thenreturn
  52. 510 t=mq:gosub280:tp=peek(p+p1+p1):ifmq=tthen540
  53. 520 ifrm(rm)=0thenrm(rm)=1:sc=sc-300:tc=tc-1
  54. 530 return
  55. 540 if(tp<=45)and(tp>=40)thenp1=0:c1=0
  56. 550 ifpeek(824)thengosub610:goto490
  57. 560 if(p+p1)<>tland(p+p1+p1)<>tlthen570
  58. 561 rm(rm)=0:tc=tc+1:sc=sc+300:gosub760:poketl+c,0:poketl,32:tl=0:goto490
  59. 570 g=peek(p+p1):h=peek(p+p1+p1):if(g<>mt)and(g<>mb)and(h<>mt)and(h<>mb)then580
  60. 575 mq=mq+1:ifrm(rm)=0thenrm(rm)=1:tc=tc-1:sc=sc-300
  61. 576 return
  62. 580 ifc1=0then490
  63. 590 pokep+p2,32:pokep,32:p=p+p1:pokep+c,2:pokep+p1+c,3
  64. 600 pokep,0:pokep+p1,63+c1:p2=p1:c2=c1:goto490
  65. 610 al=p+p2:s=0:ifc2=0thenp2=22:c2=1:poke36876,200
  66. 620 s=s+1:pokeal+((s-1)*p2),32:poke36876,200-s*5:bl=peek(al+(s*p2))
  67. 630 if(bl=mt)or(bl=mb)thensc=sc+10:gosub760:poke36876,0:goto660
  68. 640 ifpeek(al+(s*p2))<>32thenpokep+p2,63+c2:poke36876,0:return
  69. 650 pokeal+(s*p2),63+c2:pokeal+(s*p2)+c,cl+1:goto620
  70. 660 ac=al+(s*p2):fora=0to3:poke36877,200
  71. 670 ifac=m(a)orac=m(a)+mpthenpokem(a),32:pokem(a)+mp,32:m(a)=0:poke36877,0:return
  72. 680 nexta:poke36877,0:return
  73. 690 print"[147]";:printtp$;:fori=1to17:printsi$;:next:printbt$;
  74. 700 return
  75. 710 print"";:forb=1to2:print"(,,,,,,)  (,,,,,,)";
  76. 720 print"-      -  -      -";:print"'      '  '      '";
  77. 730 print"-      -  -      -";:print"+,,,,,,*  +,,,,,,*";:nextb:return
  78. 740 print"";
  79. 750 fori=1to3:print"[221][221]";:next:return
  80. 760 print"";
  81. 770 printleft$(ml$,11-mq)chr$(13);:print"[158]score";sc;"[157] level"lv"[146]";
  82. 780 print"";:print"";:return
  83. 790 fori=1to4:rm(i)=1:next:lv=lv+1
  84. 800 print"[147]you have":print"achieved level"lv"[146]"
  85. 810 fori=1to2000:next:return
  86.