home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 51 / 051.d81 / stratahex (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  226 lines

  1. 0 rem  loadstar is not public domain!!
  2. 9 rem
  3. 10 rem *** initialization ***
  4. 11 rem
  5. 99 rem
  6. 100 rem *** title screen ***
  7. 101 gosub 6000
  8. 120 c=55296:v=1024:y(1)=0:y(2)=20:y(3)=11:y(4)=10
  9. 125 x(1)=19:x(2)=19:x(3)=1:x(4)=39
  10. 150 c(1)=10:c(2)=14:c(3)=13:c(4)=15
  11. 499 rem
  12. 500 rem *** # of players ***
  13. 501 rem
  14. 502 poke648,192:print"[152][147]":poke648,4
  15. 503 print""
  16. 504 print"[153]                     "
  17. 505 print"[153]  how many players?  [144][206]"
  18. 506 print"[153]                     [144][205]"
  19. 507 print"[153]    (2, 3, or 4)     [144][206]"
  20. 508 print"[153]                     [144][205]"
  21. 509 print"[144][206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [144][206]"
  22. 520 get a$:if a$<"2" or a$>"4" then 520
  23. 530 pl=val(a$)
  24. 540 c(pl+1)=251:c(pl+2)=251
  25. 999 rem
  26. 1000 rem *** screen set up ***
  27. 1001 rem
  28. 1005 poke648,240/4:print"[147]":poke53272,(peek(53272)and15)or240
  29. 1006 print"           please wait..."
  30. 1007 poke648,4
  31. 1010 print"[147][144]";
  32. 1060 for x=1 to 10
  33. 1070 print"[206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205][160]";
  34. 1071 print"[205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183]";
  35. 1080 next:
  36. 1081 print"[206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205] [206][183][205][160]";
  37. 1082 print""
  38. 1120 for cc=55296 to 56135
  39. 1130 rn=int(rnd(0)*10)+1
  40. 1140 if rn>7 then pc=7:goto 1155
  41. 1150 pc=0
  42. 1155 poke cc,pc:next cc  :poke53272,(peek(53272)and15)or16
  43. 1223 forx=1to4 : rem poke those chars on the board (playing chars)
  44. 1225 pokec+x(x)+40*y(x),c(x):pokev+x(x)+40*y(x),81
  45. 1227 next
  46. 1228 forx=217to242:pokex,peek(x)or128:next: rem reset line links due to print
  47. 1230 poke214,20:print:print "         m=move        f=fire"
  48. 1250 print"  e=northwest   r=north   t=northeast"
  49. 1260 print"  c=southwest   v=south   b=southeast"
  50. 2000 rem *** game play ***
  51. 2001 rem
  52. 2005 for pt=1 to pl
  53. 2007 g$="":p=0:pc=0
  54. 2010 print""chr$(c(pt)+140):poke214,23:print:print"       your play (m or f)     [157][157][157][157]";
  55. 2020 geta$:ifa$=chr$(13) then gosub 7000:goto2010
  56. 2021 if a$<>"m" and a$<>"f" then 2020
  57. 2030 printa$;
  58. 2035 poke214,23:print:print"             direction?  ";
  59. 2040 g$=g$+a$
  60. 2050 geta$ : if a$=chr$(13) then gosub 7000:goto 2010
  61. 2055 ifa$<>"e"anda$<>"r"anda$<>"t"anda$<>"c"anda$<>"v"anda$<>"b"then2050
  62. 2060 print" "a$;:fort=0to800:next
  63. 2070 g$=g$+a$
  64. 2080 if left$(g$,1)="m" then 2100
  65. 2090 goto 2500
  66. 2099 rem
  67. 2100 rem *** player move ***
  68. 2101 rem
  69. 2105 poke v+x(pt)+40*y(pt),32
  70. 2110 g$=right$(g$,1)
  71. 2120 if g$="e" then g=1
  72. 2121 if g$="r" then g=2
  73. 2122 if g$="t" then g=3
  74. 2123 if g$="c" then g=4
  75. 2124 if g$="v" then g=5
  76. 2125 if g$="b" then g=6
  77. 2130 on g goto 2135,2140,2150,2160,2170,2180
  78. 2135 ify(pt)=0orx(pt)=1or(peek(c+(x(pt)-1)+(y(pt)-1)*40)and15)=7then2190
  79. 2137 x(pt)=x(pt)-2:y(pt)=y(pt)-1:goto 2190
  80. 2140 if y(pt)<2 or (peek(c+x(pt)+(y(pt)-1)*40)and15)=7  then 2190
  81. 2145 y(pt)=y(pt)-2:goto 2190
  82. 2150 ifx(pt)=39ory(pt)=0or(peek(c+(x(pt)+1)+(y(pt)-1)*40)and15)=7then2190
  83. 2155 y(pt)=y(pt)-1:x(pt)=x(pt)+2:goto 2190
  84. 2160 ifx(pt)=1ory(pt)=20or(peek(c+(x(pt)-1)+y(pt)*40)and15)=7then2190
  85. 2165 y(pt)=y(pt)+1:x(pt)=x(pt)-2:goto 2190
  86. 2170 if y(pt)>18 or (peek(c+x(pt)+(y(pt)+1)*40)and15)=7 then 2190
  87. 2175 y(pt)=y(pt)+2:goto 2190
  88. 2180 ifx(pt)=39ory(pt)=20or(peek(c+(x(pt)+1)+y(pt)*40)and15)=7then2190
  89. 2185 y(pt)=y(pt)+1:x(pt)=x(pt)+2:goto 2190
  90. 2190 poke c+x(pt)+y(pt)*40,c(pt):poke v+x(pt)+y(pt)*40,81
  91. 2195 if y(1)=20 then w=1:goto 4000
  92. 2200 if y(2)=0 then w=2:goto 4000
  93. 2210 if x(3)=39 then w=3:goto 4000
  94. 2220 if x(4)=1 then w=4:goto 4000
  95. 2230 goto 2960
  96. 2499 rem
  97. 2500 rem *** player fire ***
  98. 2501 rem
  99. 2510 g$=right$(g$,1)
  100. 2520 if g$="e" then a=1
  101. 2540 if g$="r" then a=2
  102. 2550 if g$="t" then a=3
  103. 2560 if g$="c" then a=4
  104. 2570 if g$="v" then a=5
  105. 2580 if g$="b" then a=6
  106. 2590 on a goto 2600,2650,2700,2750,2800,2850
  107. 2600 x=x(pt):y=y(pt)
  108. 2602 if x<2 or y=0 then 2900
  109. 2605 x=x-1:y=y-1
  110. 2610 if (peek(c+x+y*40)and15)=7 then gosub 7200:goto 2900
  111. 2615 x=x-1
  112. 2620 if peek(v+x+y*40)=81 then pc=(peek(c+x+y*40) and 15)
  113. 2625 if pc>1 then for lo=1 to pl:if pc=c(lo) then p=lo
  114. 2626 if pc>1 then next lo
  115. 2630 if pc=0 or pc=1 then 2602
  116. 2635 goto 2900
  117. 2650 x=x(pt):y=y(pt)
  118. 2652 if y<2 then 2900
  119. 2655 y=y-1
  120. 2660 if (peek(c+x+y*40)and15)=7 then gosub 7200:goto 2900
  121. 2665 y=y-1
  122. 2670 if peek(v+x+y*40)=81 then pc=(peek(c+x+y*40) and 15)
  123. 2675 if pc>1 then for lo=1 to pl:if pc=c(lo) then p=lo
  124. 2676 if pc>1 then next lo
  125. 2680 if pc=0 or pc=1 then 2652
  126. 2685 goto 2900
  127. 2700 x=x(pt):y=y(pt)
  128. 2702 if x>38 or y=0 then 2900
  129. 2705 x=x+1:y=y-1
  130. 2710 if (peek(c+x+y*40)and15)=7 then gosub7200:goto 2900
  131. 2715 x=x+1
  132. 2720 if peek(v+x+y*40)=81 then pc=(peek(c+x+y*40) and 15)
  133. 2725 if pc>1 then for lo=1 to pl:if pc=c(lo) then p=lo
  134. 2726 if pc>1 then next lo
  135. 2730 if pc=0 or pc=1 then 2702
  136. 2735 goto 2900
  137. 2750 x=x(pt):y=y(pt)
  138. 2752 if x<2 or y=20 then 2900
  139. 2755 x=x-1
  140. 2760 if (peek(c+x+y*40)and15)=7 then gosub 7200:goto 2900
  141. 2765 x=x-1:y=y+1
  142. 2770 if peek(v+x+y*40)=81 then pc=(peek(c+x+y*40) and 15)
  143. 2772 if pc=0 then 2752
  144. 2775 if pc>1 then for lo=1 to pl:if pc=c(lo) then p=lo
  145. 2776 if pc>1 then next lo
  146. 2780 if pc=0 or pc=1 then 2752
  147. 2785 goto 2900
  148. 2800 x=x(pt):y=y(pt)
  149. 2802 if y>19 then 2900
  150. 2805 y=y+1
  151. 2810 if (peek(c+x+y*40)and15)=7 then gosub7200:goto 2900
  152. 2815 y=y+1
  153. 2820 if peek(v+x+y*40)=81 then pc=(peek(c+x+y*40) and 15)
  154. 2825 if pc>1 then for lo=1 to pl:if pc=c(lo) then p=lo
  155. 2826 if pc>1 then next lo
  156. 2830 if pc=0 or pc=1 then 2802
  157. 2835 goto 2900
  158. 2850 x=x(pt):y=y(pt)
  159. 2852 if y>19 or x=39 then 2900
  160. 2855 x=x+1
  161. 2860 if (peek(c+x+y*40)and15)=7 then gosub7200:goto 2900
  162. 2865 x=x+1:y=y+1
  163. 2870 if peek(v+x+y*40)=81 then pc=(peek(c+x+y*40) and 15)
  164. 2875 if pc>1 then for lo=1 to pl:if pc=c(lo) then p=lo
  165. 2876 if pc>1 then next lo
  166. 2880 if pc=0 or pc=1 then 2852
  167. 2885 goto 2900
  168. 2900 if p=0 then 2960
  169. 2902 poke v+x(p)+y(p)*40,32
  170. 2905 on p goto 2920,2930,2940,2950
  171. 2920 x(p)=19:y(p)=0:poke v+x(p)+y(p)*40,81:poke c+x(p)+y(p)*40,c(p)
  172. 2925 goto 2960
  173. 2930 x(p)=19:y(p)=20:poke v+x(p)+y(p)*40,81:poke c+x(p)+y(p)*40,c(p)
  174. 2935 goto 2960
  175. 2940 x(p)=1:y(p)=11:poke v+x(p)+y(p)*40,81:poke c+x(p)+y(p)*40,c(p)
  176. 2945 goto 2960
  177. 2950 x(p)=39:y(p)=10:poke v+x(p)+y(p)*40,81:poke c+x(p)+y(p)*40,c(p)
  178. 2960 if pt=pl then 2000
  179. 2970 next pt
  180. 4000 print "[147]       [159]congratulations, player";w
  181. 4010 print "[158]          you are the winner"
  182. 4020 print"[153]       play another game (y/n)"
  183. 4030 get a$:if a$="" then 4030
  184. 4040 if a$="n" then gosub 7000:goto1000
  185. 4050 if a$="y" then 120
  186. 4060 goto 4030
  187. 6000 poke53280, 0:poke53281,11:print"[147][142]";:poke53265,peek(53265)and239
  188. 6001 print"[144]N[183][154]                                    [146][144]M"
  189. 6002 print"M[154]  [153]                               [154]   [146][144]N[158][183][144]N[158][183][154]  [153]    [158]  loadstar ";
  190. 6003 print"presents   [153]      [154]  [146][144]M"
  191. 6004 print"[158]M[154]  [153]                                [154]  [146][158]N[144][183][158]N[144][183][154]  [153]  stratahex  ";
  192. 6005 print"by  mike l lewis[153]   [154]  [146][158]M"
  193. 6006 print"[144]M[154]  [153]                                [154]  [146][144]N[158][183]N[183][154]                  ";
  194. 6007 print"                [154]  [146][144]M"
  195. 6008 print"M[154]                                    [146][144]N[183]N[183][158]M[144]N[158][183]M[144]N[183]MN[183]M[158]N[183]M[144]N[183]";
  196. 6009 print"[158]M[144]N[158][183][144]MN[183]MN[158][183][144]MN[183][158]M"
  197. 6010 print"[144]MN[158][183]M[144]N[183]MN[183]MN[183]MN[183]M[158]N[183][144]MN[158][183][144]MN[158][183][144]M[158]N[144][183]M[158]N[144][183]N[183]MN[158][183][144]MN[183][158]M[144]N[183]M";
  198. 6011 print"N[158][183]MN[144][183]MN[183]MN[158][183][144]MN[183][158]M[144]N[183]M"
  199. 6012 print"[158]M[144]N[158][183]M[144]N[158][183][144]MN[158][183][144]M[158]N[183]MN[183]MN[144][183][158]MN[144][183]MN[183][158]M[144]N[183]MN[158][183][