home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 196 / 196.d81 / b.phazar / b.080d / b.a7ae (.txt)
Encoding:
Commodore BASIC  |  2000-01-01  |  49.6 KB  |  227 lines

  1. 1 rem * lazer maze *
  2. 2 rem * by tim george *
  3. 3 rem * (c)2000 j&f publishing *
  4. 4 poke55,0:poke56,80:clr
  5. 5 poke53371,1:goto5000
  6. 7 :
  7. 8 rem * computer mover *
  8. 9 rem - set up sound -
  9. 10 pokes+14,0:pokes+15,10:pokes+19,0:pokes+20,0
  10. 12 rem - search for destination -
  11. 14 n=x(cp)+y(cp)*40+1065:a=n:dr=2:j=dr
  12. 15 if(x(cp)=dx%)and(y(cp)=dy%)then22
  13. 16 p=n+a(j):ifpeek(p)<>32then20
  14. 17 n=p:x(cp)=x(cp)-(j=1)+(j=3):y(cp)=y(cp)-(j=0)+(j=2):d(cp)=tr(j)
  15. 18 j=(j+2)+4*(j>1):sys20480,3,x(cp),y(cp),d(cp),cp
  16. 19 pokes+18,129:poke162,0:wait162,4:pokes+18,0
  17. 20 j=(j-1)-4*(j=0):if(n<>a)or(j<>dr)then15
  18. 22 sys20480,3,dx%,dy%,dr%,cp:x(cp)=dx%:y(cp)=dy%:d(cp)=dr%:return
  19. 28 :
  20. 29 rem - human mover -
  21. 30 x=x(cp):y=y(cp):a=1065+y*40+x:n=a:pokea,32:j=56320-((np=2)and(cp=2))
  22. 31 pokes+14,0:pokes+15,10:pokes+19,0:pokes+20,0
  23. 32 poke162,0:wait162,8:a$="":poke198,0
  24. 33 if(peek(j)and16)=0then50
  25. 34 geta$:ifa$="q"then5500
  26. 35 ifcp=1thena$=""
  27. 36 ifa$=" "then50
  28. 37 i=notpeek(j)and15:if(i=0)and(a$="")then33
  29. 38 if(i=1)or(a$="@")thenn=n-40:y=y-1:d=1:goto46
  30. 40 if(i=2)or(a$=";")thenn=n+40:y=y+1:d=2:goto46
  31. 42 if(i=4)or(a$=":")thenn=n-1:x=x-1:d=3:goto46
  32. 44 if(i=8)or(a$="=")thenn=n+1:x=x+1:d=4:goto46
  33. 45 goto32
  34. 46 ifpeek(n)<>32thenn=a:x=x(cp):y=y(cp):goto48
  35. 47 pokes+18,129:poke162,0:wait162,4:pokes+18,0
  36. 48 a=n:sys20480,3,x,y,d,cp:x(cp)=x:y(cp)=y:d(cp)=d:goto32
  37. 50 dx%=x:dy%=y:dr%=d(cp):goto140
  38. 97 :
  39. 98 rem * new board *
  40. 99 rem - fade out -
  41. 100 fori=4to0step-1:sys40006,fd(i):poke162,0:forj=1to10:j=peek(162):next:next
  42. 102 rem - place center piece? -
  43. 104 x(0)=30:y(0)=20:ifc0=0then114
  44. 106 fl=0:fori=1to2:if(x(i)=12)or(x(i)=13)thenif(y(i)=7)or(y(i)=8)thenfl=1
  45. 107 next:ifflthenpoke53269,15:goto114
  46. 108 x=int(rnd(ti)*2)+12:y=int(rnd(ti)*2)+7:x(0)=x:y(0)=y
  47. 110 poke53256,x*12+24:poke53257,y*12+51:poke53269,31
  48. 112 rem - create on screen 0 -                  - draw on screen 1 -
  49. 114 poke648,4:poke646,pc(4)
  50. 115 sys20480,1,x(1),y(1),x(2),y(2),x(0),y(0):poke648,128
  51. 116 rem - fade in -
  52. 118 fori=0to4:sys40006,fd(i):poke162,0:forj=1to10:j=peek(162):next:next
  53. 119 rem - pre set sound -
  54. 120 pokes,70:pokes+1,6:pokes+5,0:pokes+6,240:pokes+2,0:pokes+3,8
  55. 122 pokes+7,0:pokes+8,6:pokes+12,0:pokes+13,240:pokes+9,0:pokes+10,8
  56. 129 rem - who's turn is it -
  57. 130 if(np=2)or((np=1)and(cp=2))then30
  58. 132 rem - computer -
  59. 134 sys20480,2,x(cp),y(cp):gosub10:geta$:ifa$="q"then5500
  60. 139 rem - fire! -
  61. 140 poke214,23:print:poke211,2+33*sgn(cpand2):poke646,pc(cp)
  62. 142 pokes+4,33:pokes+11,21
  63. 143 wait53266,128:sys40000,pc(3),pc(cp),pc(4)
  64. 144 sys49200,dx%,dy%,dr%,sc(cp),dl
  65. 145 sys40003:pokes+4,0:pokes+11,0
  66. 146 rem - what happened -
  67. 147 sc(cp)=sc%:ifsc%>499then200
  68. 148 ifrc%>2then160
  69. 149 rem - hit other player -
  70. 150 sc(op)=sc(op)-10:ifsc(op)<0thensc(op)=0
  71. 151 poke214,23:print:poke211,1+33*sgn(opand2):poke646,pc(op):printsc(op)"[157] "
  72. 152 rem - shake -
  73. 153 n=53248+(opand2)*2:x=peek(n):y=peek(n+1):pokes,255:pokes+4,33:pokes+11,21
  74. 154 poke53288+(opand2),3:fori=1to16:poken,x+int(rnd(ti)*6)-3:poken+2,peek(n)
  75. 155 poken+1,y+int(rnd(ti)*6)-3:poken+3,peek(n+1):poke162,2:wait162,8:next
  76. 156 pokes+4,0:pokes+11,0:poke53288+(opand2),pc(op)
  77. 157 x(op)=25*sgn(opand2):y(op)=15*sgn(opand2):sys20480,3,x(op),y(op),d(op),op
  78. 158 c0=1:cp=3-cp:op=3-cp:goto100
  79. 159 rem - what else -
  80. 160 ifrc%=160then158:rem hit wall
  81. 161 ifrc%>3thenop=cp:goto153:rem hit self
  82. 162 rem hit center
  83. 163 c0=0:x(cp)=x(0):y(cp)=y(0):poke53269,15:sys20480,3,x(cp),y(cp),d(cp),cp
  84. 170 pokes,100:pokes+1,9:pokes+7,100:pokes+8,18:pokes+12,0:pokes+13,233
  85. 172 pokes+11,19:pokes+11,18:goto100
  86. 199 rem - win! -
  87. 200 poke162,0:wait162,64
  88. 201 pokes,0:pokes+5,0:pokes+6,240:x=53280:y=27.5:poke53370,0:poke53275,255
  89. 202 fori=1to3:forj=110to0step-6:pokex,cl(cp,j/y):pokes+1,j:pokes+4,33
  90. 204 pokes+4,17:next:pokes+4,16:next:poke53371,1:poke198,0
  91. 210 poke214,22:print:printtab(3)"[155][208]ress [198][201][210][197] or [211][208][193][195][197] to play again"
  92. 211 fori=-2to3:poke646,cl(cp,abs(i))
  93. 212 poke214,12:print:printtab(12)"[208]layer"cp"[215][201][206][211]!"
  94. 213 poke162,0:forj=0to6:j=peek(162)
  95. 214 b=peek(56320)andpeek(56321)and16:geta$:if(a$<>"")or(b=0)theni=5:j=6
  96. 215 next:next:ifi=4then211
  97. 216 ifa$="q"thenpoke53280,0:poke53269,0:poke53275,0:goto5500
  98. 218 if(a$<>" ")and(b>0)then211
  99. 598 :
  100. 599 rem * begin new game *
  101. 600 poke53280,0:x(1)=3:y(1)=3:d(1)=4:x(2)=22:y(2)=12:d(2)=3:sc(1)=0:sc(2)=0
  102. 602 c0=1:cp=1:op=3-cp:poke53265,peek(53265)and239:print"[147]":poke53275,0
  103. 604 poke33784,149:poke34808,149:poke33786,148:poke34810,148:poke53269,15
  104. 606 fori=1to2:sys20480,3,x(i),y(i),d(i),i:next
  105. 608 poke214,23:print:poke646,pc(1):print"* 0";:poke211,12:poke646,pc(0)
  106. 609 print"[208]ress [209] to quit";:poke211,33:poke646,pc(2):print"* 0"
  107. 610 poke53265,peek(53265)or16:goto100
  108. 4998 :
  109. 4999 rem * move it *
  110. 5000 poke53280,0:poke53265,peek(53265)and143:poke53281,0:poke648,128:print"[144][147]"
  111. 5002 poke56578,peek(56578)or3:poke56576,(peek(56576)and252)or1:poke53272,8
  112. 5004 r=rnd(-ti):gosub60000
  113. 5006 :
  114. 5007 rem * initialize *
  115. 5008 rem - variables -
  116. 5009 rem colors for player 1, player 2, center, mirrors, screen, laser speed
  117. 5010 pc(1)=5:pc(2)=4:pc(0)=7:pc(3)=1:pc(4)=0:dl=4
  118. 5012 s=54272:cp=1:np=1
  119. 5014 cl(1,3)=1:cl(2,3)=1:cl(1,2)=15:cl(2,2)=15:cl(1,1)=12:cl(2,1)=12
  120. 5016 cl(1,0)=pc(1):ifpc(1)=5thencl(1,1)=13
  121. 5018 cl(2,0)=pc(2):ifpc(2)=4thencl(2,1)=10
  122. 5020 fd(0)=0:fd(1)=11:fd(2)=12:fd(3)=15:fd(4)=pc(3)
  123. 5022 a(0)=40:a(1)=1:a(2)=-40:a(3)=-1
  124. 5024 tr(0)=2:tr(1)=4:tr(2)=1:tr(3)=3
  125. 5048 :
  126. 5049 rem - set up sid -
  127. 5050 fori=stos+23:pokei,0:next:pokes+24,15
  128. 5058 :
  129. 5059 rem - set up sprites -
  130. 5060 fori=53248to53264:pokei,0:next:poke53269,0
  131. 5062 poke53276,0:poke53271,0:poke53275,0:poke53277,0:poke53287,pc(3)
  132. 5064 poke53288,pc(1):poke53289,pc(3):poke53290,pc(2):poke53291,pc(0)
  133. 5066 poke33785,145:poke33787,145:poke33788,145
  134. 5068 poke34809,145:poke34811,145:poke34812,145
  135. 5098 :
  136. 5099 rem - laser tables -
  137. 5100 fori=49152to49175:readq:pokei,q:next
  138. 5101 data 136,143,137,149,142,148,154,159,139,145,153,158,138,144,150,155,140
  139. 5102 data 147,152,157,141,146,151,156
  140. 5489 :
  141. 5490 wait161,1:wait162,32
  142. 5498 :
  143. 5499 rem * main menu *
  144. 5500 poke53265,peek(53265)and143
  145. 5502 poke53269,0:print"[147]":gosub5600
  146. 5512 i=12:poke214,7:print:poke646,pc(0)
  147. 5514 printtab(i)"[198]1  [208]layers:"np
  148. 5516 printtab(i)"[198][201][210][197]/[211][208][193][195][197]  [208]lay"
  149. 5518 printtab(i)"[201]  [201]nstructions"
  150. 5520 printtab(i)"[209]  [209]uit"
  151. 5522 poke53265,peek(53265)or16:poke198,0
  152. 5530 geta$:b=peek(56320)andpeek(56321)and16:if(b=0)or(a$=" ")then600
  153. 5532 ifa$="[133]"thennp=np+1+3*(np=2):poke214,7:print:printtab(i+12)np:goto5530
  154. 5534 ifa$="i"then8000
  155. 5536 ifa$="q"then30000
  156. 5540 goto5530
  157. 5598 :
  158. 5599 rem * print little phazar *
  159. 5600 i=10:poke646,pc(1)
  160. 5602 printtab(i)"[193][194][195][196][197][198][199][200][201]";
  161. 5604 poke646,pc(2)
  162. 5606 print"[202][203][204][205][206][207][208][209][210][211]"
  163. 5608 poke646,pc(1)
  164. 5610 printtab(i)"[161][162][163][164][165][166][167][168][169]";
  165. 5612 poke646,pc(2)
  166. 5614 print"[170][171][172][173][174][175][176][177][178][179][180]"
  167. 5616 return
  168. 7998 :
  169. 7999 rem * instructions *
  170. 8000 gosub8500
  171. 8002 i=2:printtab(i)"[158][212]he [205][197][206][213]"
  172. 8004 printtab(i)"[208]ress [198]1 for number of players."
  173. 8006 printtab(i)"[208]ress [198][201][210][197] or [211][208][193][195][197] to play."
  174. 8008 printtab(i)"[208]ress [201] for instructions (these)."
  175. 8010 printtab(i)"[208]ress [209] to return to [204]oadstar":printtab(i)"or exit to [194]asic."
  176. 8012 gosub8510:gosub8500
  177. 8014 i=2:printtab(i)"[158][212]he [208][204][193][217]"
  178. 8016 printtab(i)"[207]ne player: [213]se stick 2 or keyboard."
  179. 8018 printtab(i)"[212]wo players: [208]layer 1 uses stick 2."
  180. 8020 printtab(i)"[208]layer 2 uses stick 1 or keyboard."
  181. 8022 printtab(i)"[212]he keyboard controls are:  up":printtab(30)"@"
  182. 8024 printtab(24)"[158]left :;= [158]right":printtab(30)"down"
  183. 8026 printtab(i)"[205]ove your piece and":printtab(i)"press [198][201][210][197] or [211][208][193][195][197]."
  184. 8028 gosub8510:gosub8500
  185. 8030 i=2:printtab(i)"[158][212]he [215][201][206]"
  186. 8034 printtab(i)"[197]ach mirror hit scores one point."
  187. 8036 printtab(i)"[200]it yourself and lose 50 points."
  188. 8038 printtab(i)"[193] hit by the other player subtracts"
  189. 8040 printtab(i)"10 points."
  190. 8042 printtab(i)"[200]it the center block and go again."
  191. 8044 printtab(i)"[212]he first player to 500 wins."
  192. 8046 gosub8510:goto5500
  193. 8500 poke53265,peek(53265)and143
  194. 8502 print"[147]":gosub5600:printtab(14)"[201]nstructions":return
  195. 8510 poke214,23:print:printtab(7)"[208][210][197][211][211] [193][206][217] [203][197][217] [212][207] [195][207][206][212][201][206][213][197]"
  196. 8512 poke53265,peek(53265)or16:poke198,0:wait198,1:geta$:return
  197. 9997 end
  198. 9998 :
  199. 9999 rem * scratch and save *
  200. 10000 d=peek(186):n$="0:lazer maze":open1,d,15,"s"+n$:close1:saven$,d:end
  201. 19997 :
  202. 19998 rem * list to printer *
  203. 19999 - set to device 4 -
  204. 20000 p=peek(646):poke646,peek(53281):print"[147]print#1:close1":poke646,p
  205. 20002 poke631,19:poke632,13:poke198,2:open1,4,7:cmd1:list:end
  206. 29998 :
  207. 29999 rem * move it back *
  208. 30000 print"[144][147]":poke648,4:print"[147][154]";
  209. 30002 poke56576,(peek(56576)and252)or3:poke53272,23:poke56,160:clr
  210. 39998 :
  211. 39999 rem * return to loadstar *
  212. 40000 f$="hello connect":close2:close15
  213. 40001 dv=peek(186):ifdv<8thendv=8
  214. 40002 fori=dvtodv+1:ifi=dvthen40200
  215. 40003 fori=8to29:if(i=14)or(i=dv)theni=i+1
  216. 40200 open2,i,2:close2:ifstthen40500
  217. 40201 open15,i,15,"r0:"+f$+"="+f$:input#15,er:close15:ifer<>63then40500
  218. 40202 print"[147]    "chr$(34)f$chr$(34)","i:poke631,19:poke632,131:poke198,2:end
  219. 40500 next:poke186,8:poke53280,14:poke53281,6:poke198,0:end
  220. 59998 :
  221. 59999 rem * title screen *
  222. 60000 print"[147]":poke53280,0:poke53281,0:poke53265,peek(53265)or16
  223. 60002 poke53370,0:sys20480,4,5,4,7,2,2
  224. 60004 poke214,11:print:printtab(13)"by [212]im [199]eorge"
  225. 60006 printtab(12)"www.loadstar.com"
  226. 60008 poke162,0:poke161,0:poke53371,1:return
  227.