home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / procedures / lightcycles.amos / lightcycles.amosSourceCode < prev    next >
AMOS Source Code  |  1978-02-21  |  8KB  |  309 lines

  1. Rem ** LightCycles By J.Hale **
  2. Unpack 1 To 0
  3. Curs Off 
  4. Hide On 
  5. Paper 0
  6. Ink 0
  7. Bar 0,0 To 10,10
  8. Ink 2
  9. Locate 0,8
  10. Centre "1,2 or 4 PLAYERS?"
  11. 76 FLOP$=Inkey$
  12. If FLOP$="" Then Goto 76
  13. If FLOP$="1" Then COMP=1
  14. If FLOP$="2" Then COMP=0
  15. If FLOP$="4" Then COMP=4
  16. Locate 0,10
  17. Centre "ARE REDS LETHAL?"
  18. 10 R$=Inkey$
  19. If R$="" Then Goto 10
  20. If R$="y" Then RED=2 Else RED=6
  21. Locate 0,12
  22. Centre "LEVEL 1,2 OR 3?"
  23. 11 L$=Inkey$
  24. If L$="" Then Goto 11
  25. If L$="1" Then TIME=2 Else TIME=1
  26. If L$="3" Then TIME=0
  27. Randomize Timer
  28. 45
  29. Load "df0:sample1"
  30. 50 Unpack 1 To 0
  31. Ink 12
  32. Box 0,0 To 319,255
  33. Paper 0
  34. Curs Off 
  35. Hide On 
  36. Paper 0
  37. Ink 0
  38. Bar 1,1 To 10,10
  39. Ink 12
  40. Box 0,0 To 319,255
  41. X=3
  42. Y=147
  43. AX=311
  44. AY=147
  45. D=2
  46. AD=4
  47. PLING=0
  48. AGAMES=0
  49. BGAMES=0
  50. CGAMES=0
  51. DGAMES=0
  52. DISTANCE=Rnd(250)+50
  53. If COMP=1 Then Goto 147
  54. If COMP=4 Then Goto 1000
  55. 1
  56. Ink 6
  57. Plot X,Y
  58. If Jup(1) and D<>3 and D<>1 Then D=1 : Sam Play 13
  59. If Jright(1) and D<>4 and D<>2 Then D=2 : Sam Play 13
  60. If Jdown(1) and D<>1 and D<>3 Then D=3 : Sam Play 13
  61. If Jleft(1) and D<>2 and D<>4 Then D=4 : Sam Play 13
  62. If D=1 Then Y=Y-1
  63. If D=2 Then X=X+1
  64. If D=3 Then Y=Y+1
  65. If D=4 Then X=X-1
  66. If Point(X,Y)=6 or Point(X,Y)=12 or Point(X,Y)=RED Then Goto GREENDIE
  67. Ink 3
  68. Plot X,Y
  69. Ink 12
  70. Plot AX,AY
  71. If Jup(0) and AD<>3 and AD<>1 Then AD=1 : Sam Play 13
  72. If Jright(0) and AD<>4 and AD<>2 Then AD=2 : Sam Play 13
  73. If Jdown(0) and AD<>1 and AD<>3 Then AD=3 : Sam Play 13
  74. If Jleft(0) and AD<>2 and AD<>4 Then AD=4 : Sam Play 13
  75. If AD=1 Then AY=AY-1
  76. If AD=2 Then AX=AX+1
  77. If AD=3 Then AY=AY+1
  78. If AD=4 Then AX=AX-1
  79. If Point(AX,AY)=6 or Point(AX,AY)=12 or Point(AX,AY)=RED Then Goto BLUEDIE
  80. Ink 3
  81. Plot AX,AY
  82. If TIME>0 Then Wait TIME
  83. Goto 1
  84. 147
  85. Ink 6
  86. Plot X,Y
  87. If Jup(1) and D<>3 and D<>1 Then D=1 : Sam Play 13
  88. If Jright(1) and D<>4 and D<>2 Then D=2 : Sam Play 13
  89. If Jdown(1) and D<>1 and D<>3 Then D=3 : Sam Play 13
  90. If Jleft(1) and D<>2 and D<>4 Then D=4 : Sam Play 13
  91. If D=1 Then Y=Y-1
  92. If D=2 Then X=X+1
  93. If D=3 Then Y=Y+1
  94. If D=4 Then X=X-1
  95. If Point(X,Y)=6 or Point(X,Y)=12 or Point(X,Y)=RED Then Goto GREENDIE
  96. Ink 3
  97. Plot X,Y
  98. Ink 12
  99. SX=AX
  100. SY=AY
  101. GUF=Rnd(2)+1
  102. If AD=1 and GUF=1 Then GUF=4
  103. If AD=2 and GUF=2 Then GUF=3
  104. If AD=3 and GUF=1 Then GUF=4
  105. If AD=4 and GUF=2 Then GUF=3
  106. If DISTANCE=0 and AD=1 and GUF=2 and Point(AX+1,AY)<>6 and Point(AX+1,AY)<>12 and Point(AX+1,AY)<>RED Then PLING=1
  107. If DISTANCE=0 and AD=1 and GUF=4 and Point(AX-1,AY)<>6 and Point(AX-1,AY)<>12 and Point(AX-1,AY)<>RED Then PLING=1
  108. If DISTANCE=0 and AD=2 and GUF=1 and Point(AX,AY-1)<>6 and Point(AX,AY-1)<>12 and Point(AX,AY-1)<>RED Then PLING=1
  109. If DISTANCE=0 and AD=2 and GUF=3 and Point(AX,AY+1)<>6 and Point(AX,AY+1)<>12 and Point(AX,AY+1)<>RED Then PLING=1
  110. If DISTANCE=0 and AD=3 and GUF=2 and Point(AX+1,AY)<>6 and Point(AX+1,AY)<>12 and Point(AX+1,AY)<>RED Then PLING=1
  111. If DISTANCE=0 and AD=3 and GUF=4 and Point(AX-1,AY)<>6 and Point(AX-1,AY)<>12 and Point(AX-1,AY)<>RED Then PLING=1
  112. If DISTANCE=0 and AD=4 and GUF=1 and Point(AX,AY-1)<>6 and Point(AX,AY-1)<>12 and Point(AX,AY-1)<>RED Then PLING=1
  113. If DISTANCE=0 and AD=4 and GUF=3 and Point(AX,AY+1)<>6 and Point(AX,AY+1)<>12 and Point(AX,AY+1)<>RED Then PLING=1
  114. If PLING=1 Then AD=GUF : Sam Play 13
  115. PLING=0
  116. If DISTANCE=0 Then DISTANCE=Rnd(250)+50
  117. BILLY=Rnd(1)+1
  118. If AD=1 and BILLY=2 Then BILLY=4
  119. If AD=1 and BILLY=1 Then BILLY=2
  120. If AD=2 and BILLY=2 Then BILLY=3
  121. If AD=3 and BILLY=1 Then BILLY=4
  122. If AD=4 and BILLY=2 Then BILLY=3
  123. If AD=1 and Point(AX,AY-1)=6 or AD=1 and Point(AX,AY-1)=12 or AD=1 and Point(AX,AY-1)=RED Then AD=BILLY : Sam Play 13
  124. If AD=2 and Point(AX+1,AY)=6 or AD=2 and Point(AX+1,AY)=12 or AD=2 and Point(AX+1,AY)=RED Then AD=BILLY : Sam Play 13
  125. If AD=3 and Point(AX,AY+1)=6 or AD=3 and Point(AX,AY+1)=12 or AD=3 and Point(AX,AY+1)=RED Then AD=BILLY : Sam Play 13
  126. If AD=4 and Point(AX-1,AY)=6 or AD=4 and Point(AX-1,AY)=12 or AD=4 and Point(AX-1,AY)=RED Then AD=BILLY : Sam Play 13
  127. If AD=1 Then AY=AY-1
  128. If AD=2 Then AX=AX+1
  129. If AD=3 Then AY=AY+1
  130. If AD=4 Then AX=AX-1
  131. DISTANCE=DISTANCE-1
  132. If Point(AX,AY)=6 or Point(AX,AY)=12 or Point(AX,AY)=RED Then Goto BLUEDIE
  133. Ink 3
  134. Plot AX,AY
  135. Ink 12
  136. Plot SX,SY
  137. If TIME>0 Then Wait TIME
  138. Goto 147
  139. GREENDIE:
  140. Sam Play 5
  141. Locate 10,10
  142. Pen 12
  143. Centre "-=BLUE WINS=-"
  144. Ink 0
  145. Wait Key 
  146. Goto 50
  147. BLUEDIE:
  148. Sam Play 5
  149. Locate 10,10
  150. Pen 6
  151. Centre "-=GREEN WINS=-"
  152. Ink 0
  153. Wait Key 
  154. Goto 50
  155. 1000
  156. Unpack 1 To 0
  157. Curs Off 
  158. Hide On 
  159. Ink 12
  160. Box 0,0 To 319,255
  161. Ink 0
  162. Bar 1,1 To 10,10
  163. AX=3
  164. AY=49
  165. AD=2
  166. ACOL=3
  167. ADIE=0
  168. ADOSH=0
  169. BX=3
  170. BY=245
  171. BD=2
  172. BCOL=6
  173. BDIE=0
  174. BDOSH=0
  175. CX=311
  176. CY=49
  177. CD=4
  178. CCOL=12
  179. CDIE=0
  180. CDOSH=0
  181. DX=311
  182. DY=245
  183. DD=4
  184. DCOL=5
  185. DDIE=0
  186. DDOSH=0
  187. 1010
  188. Paper 0
  189. If ADIE=1 Then Goto 1020
  190. Ink ACOL
  191. Plot AX,AY
  192. If Jup(1) and AD<>1 and AD<>3 Then AD=1 : Sam Play 13
  193. If Jright(1) and AD<>2 and AD<>4 Then AD=2 : Sam Play 13
  194. If Jdown(1) and AD<>3 and AD<>1 Then AD=3 : Sam Play 13
  195. If Jleft(1) and AD<>4 and AD<>2 Then AD=4 : Sam Play 13
  196. If AD=1 Then AY=AY-1
  197. If AD=2 Then AX=AX+1
  198. If AD=3 Then AY=AY+1
  199. If AD=4 Then AX=AX-1
  200. If Point(AX,AY)=ACOL or Point(AX,AY)=BCOL or Point(AX,AY)=CCOL or Point(AX,AY)=DCOL Then ADIE=1 : Sam Play 5
  201. If BDIE=0 and ADIE=1 Then BDOSH=BDOSH+10
  202. If CDIE=0 and ADIE=1 Then CDOSH=CDOSH+10
  203. If DDIE=0 and ADIE=1 Then DDOSH=DDOSH+10
  204. Ink 3
  205. Plot AX,AY
  206. If ADOSH=30 Then Goto 2000
  207. 1020
  208. If BDIE=1 Then Goto 1030
  209. Ink BCOL
  210. Plot BX,BY
  211. If Jup(0) and BD<>1 and BD<>3 Then BD=1 : Sam Play 13
  212. If Jright(0) and BD<>2 and BD<>4 Then BD=2 : Sam Play 13
  213. If Jdown(0) and BD<>3 and BD<>1 Then BD=3 : Sam Play 13
  214. If Jleft(0) and BD<>4 and BD<>2 Then BD=4 : Sam Play 13
  215. If BD=1 Then BY=BY-1
  216. If BD=2 Then BX=BX+1
  217. If BD=3 Then BY=BY+1
  218. If BD=4 Then BX=BX-1
  219. If Point(BX,BY)=ACOL or Point(BX,BY)=BCOL or Point(BX,BY)=CCOL or Point(BX,BY)=DCOL Then BDIE=1 : Sam Play 5
  220. If ADIE=0 and BDIE=1 Then ADOSH=ADOSH+10
  221. If CDIE=0 and BDIE=1 Then CDOSH=CDOSH+10
  222. If DDIE=0 and BDIE=1 Then DDOSH=DDOSH=10
  223. Ink 3
  224. Plot BX,BY
  225. If BDOSH=30 Then Goto 2000
  226. 1030
  227. If CDIE=1 Then Goto 1040
  228. Ink CCOL
  229. Plot CX,CY
  230. C$=Inkey$
  231. If C$="q" and CD<>1 and CD<>3 Then CD=1 : Sam Play 13
  232. If C$="a" and CD<>1 and CD<>3 Then CD=3 : Sam Play 13
  233. If C$="z" and CD<>4 and CD<>2 Then CD=4 : Sam Play 13
  234. If C$="x" and CD<>4 and CD<>2 Then CD=2 : Sam Play 13
  235. If CD=1 Then CY=CY-1
  236. If CD=2 Then CX=CX+1
  237. If CD=3 Then CY=CY+1
  238. If CD=4 Then CX=CX-1
  239. If Point(CX,CY)=ACOL or Point(CX,CY)=BCOL or Point(CX,CY)=CCOL or Point(CX,CY)=DCOL Then CDIE=1 : Sam Play 5
  240. If ADIE=0 and CDIE=1 Then ADOSH=ADOSH+10
  241. If BDIE=0 and CDIE=1 Then BDOSH=BDOSH+10
  242. If DDIE=0 and CDIE=1 Then DDOSH=DDOSH+10
  243. Ink 3
  244. Plot CX,CY
  245. If CSCORE=30 Then Goto 2000
  246. 1040
  247. If DDIE=1 Then Goto 1050
  248. Ink DCOL
  249. Plot DX,DY
  250. D$=Inkey$
  251. If D$="]" and DD<>1 and DD<>3 Then DD=1 : Sam Play 13
  252. If D$="#" and DD<>1 and DD<>3 Then DD=3 : Sam Play 13
  253. If D$="/" and DD<>2 and DD<>4 Then DD=2 : Sam Play 13
  254. If D$="." and DD<>2 and DD<>4 Then DD=4 : Sam Play 13
  255. If DD=1 Then DY=DY-1
  256. If DD=2 Then DX=DX+1
  257. If DD=3 Then DY=DY+1
  258. If DD=4 Then DX=DX-1
  259. If Point(DX,DY)=ACOL or Point(DX,DY)=BCOL or Point(DX,DY)=CCOL or Point(DX,DY)=DCOL Then DDIE=1 : Sam Play 5
  260. If ADIE=0 and DDIE=1 Then ADOSH=ADOSH+10
  261. If BDIE=0 and DDIE=1 Then BDOSH=BDOSH+10
  262. If CDIE=0 and DDIE=1 Then CDOSH=CDOSH+10
  263. Ink 3
  264. Plot DX,DY
  265. If DSCORE=30 Then Goto 2000
  266. 1050
  267. If TIME>0 Then Wait TIME
  268. If ADIE+BDIE+CDIE+DDIE>2 Then Goto 2000
  269. Goto 1010
  270. 2000
  271. Sam Play 10
  272. Locate 14,8
  273. Pen ACOL
  274. Print "Player 1: ";ADOSH
  275. Locate 14,10
  276. Pen BCOL
  277. Print "Player 2: ";BDOSH
  278. Locate 14,12
  279. Pen CCOL
  280. Print "Player 3: ";CDOSH
  281. Locate 14,14
  282. Pen DCOL
  283. Print "Player 4: ";DDOSH
  284. Locate 14,16
  285. TIE=1
  286. If ADOSH>BDOSH and ADOSH>CDOSH and ADOSH>DDOSH Then Pen ACOL : Print "Player 1 Wins" : TIE=0
  287. If BDOSH>ADOSH and BDOSH>CDOSH and BDOSH>DDOSH Then Pen BCOL : Print "Player 2 Wins" : TIE=0
  288. If CDOSH>ADOSH and CDOSH>BDOSH and CDOSH>DDOSH Then Pen CCOL : Print "Player 3 Wins" : TIE=0
  289. If DDOSH>ADOSH and DDOSH>BDOSH and DDOSH>CDOSH Then Pen DCOL : Print "Player 4 Wins" : TIE=0
  290. If ADOSH=30 Then AGAMES=AGAMES+1
  291. If BDOSH=30 Then BGAMES=BGAMES+1
  292. If CDOSH=30 Then CGAMES=CGAMES+1
  293. If DDOSH=30 Then DGAMES=DGAMES+1
  294. If TIE=1 Then Pen ACOL : Print "-=A Draw=-"
  295. Locate 12,18
  296. Pen ACOL
  297. Print "Player 1 Games: ";AGAMES
  298. Locate 12,20
  299. Pen BCOL
  300. Print "Player 2 Games: ";BGAMES
  301. Locate 12,22
  302. Pen CCOL
  303. Print "Player 3 Games: ";CGAMES
  304. Locate 12,24
  305. Pen DCOL
  306. Print "Player 4 Games: ";DGAMES
  307. Wait Key 
  308. Sam Play 10
  309. Goto 1000