Advertisement
menedek

The Wall

Feb 2nd, 2021
2,623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1 rem The Wall
  2. 3 rem Written by: Menedek Programozo Klub
  3. 4 rem    Programmer: TBC
  4. 5 rem    2018.
  5. 10 rem ****************
  6. 11 rem * Declarations *
  7. 12 rem ****************
  8. 15 let kk% = 7680 : rem Screen mem. start
  9. 20 let kv% = 8185 : rem Screen mem. end
  10. 25 let sk = 38400 : rem Colour mem. start
  11. 30 let sv = 38905 : rem Colour mem. end
  12. 35 let x = 11 : rem Player X coordinate
  13. 40 let y = 11 : rem Player Y coordinate
  14. 45 let xe = x : rem Previous X coord.
  15. 50 let ye = y : rem Previous Y coord.
  16. 55 let p = 0 : rem Score
  17. 60 let jv = 0 : rem Game over
  18. 100 rem ***************
  19. 101 rem * Main pogram *
  20. 102 rem ***************
  21. 110 gosub 3000 : rem New chars
  22. 120 gosub 2000 : rem Intro screen
  23. 130 gosub 11000 : rem Clear screen
  24. 140 gosub 20000 : rem Read
  25. 150 gosub 22000 : rem Evaluate
  26. 160 gosub 21000 : rem Move
  27. 170 if jv=0 then goto 140
  28. 180 gosub 25000 : rem Game over
  29. 200 clr
  30. 210 kk% = 7680 : kv% = 8185
  31. 220 sk = 38400 : sv = 38905
  32. 230 x = 11 : y = 11 : xe = x : ye = y
  33. 240 p = 0 : jv = 0
  34. 300 print "new game (y/n)? ";
  35. 310 get f$
  36. 320 if f$="y" then goto 130
  37. 330 if f$="n" then goto 999
  38. 340 goto 310
  39. 999 end
  40. 1000 rem ***************
  41. 1001 rem * Subprograms *
  42. 1002 rem ***************
  43. 2000 rem
  44. 2001 rem *** Intro screen ***
  45. 2002 rem
  46. 2010 PRINT ""
  47. 2020 PRINT ""
  48. 2030 PRINT ""
  49. 2040 PRINT ""
  50. 2050 PRINT " {green}the"
  51. 2060 PRINT ""
  52. 2070 PRINT " {red}< < <   <   <    <"
  53. 2080 PRINT " < < <  < <  <    <"
  54. 2090 PRINT " < < <  < <  <    <"
  55. 2100 PRINT " < < <  < <  <    <"
  56. 2110 PRINT " < < <  < <  <    <"
  57. 2120 PRINT " < < <  <<<  <    <"
  58. 2130 PRINT " < < <  < <  <    <"
  59. 2140 PRINT "  < <   < <  <<<  <<<"
  60. 2150 PRINT ""
  61. 2160 PRINT ""
  62. 2170 PRINT ""
  63. 2180 PRINT ""
  64. 2190 PRINT "        {blue},           ,"
  65. 2200 PRINT "   menedek programozo"
  66. 2210 PRINT ""
  67. 2220 PRINT "         klub"
  68. 2230 PRINT ""
  69. 2240 for i=1 to 1000 : next : rem Wait
  70. 2250 print "{black}press space to start"
  71. 2255 print " controls: i,j,k,l"
  72. 2260 get k$
  73. 2270 if k$<>" " then goto 2260
  74. 2999 return
  75. 3000 rem
  76. 3001 rem *** New characters ***
  77. 3002 rem
  78. 3010 rem BASIC decrease BASIC memory
  79. 3020 poke 52,20 : poke 56,20
  80. 3030 rem clr
  81. 3040 rem RAM-charset copy
  82. 3050 for i=0 to 2047
  83. 3060 poke 5120+i,peek(32768+i)
  84. 3070 next i
  85. 3080 rem Modify chars
  86. 3090 for i=60 to 64
  87. 3100 for j=0 to 7
  88. 3110 read a
  89. 3120 poke 5120+i*8+j,a
  90. 3130 next j
  91. 3140 next i
  92. 3150 rem Enable RAM-charset
  93. 3160 poke 36869,253
  94. 3200 rem Set colour
  95. 3210 for i=sk to sv
  96. 3220 poke i,6
  97. 3230 next i
  98. 3999 return
  99. 10000 rem ***************
  100. 10001 rem * Subroutines *
  101. 10002 rem ***************
  102. 11000 rem
  103. 11001 rem *** Clear screen ***
  104. 11002 rem
  105. 11010 print chr$(147)
  106. 11020 for i=sk to sv
  107. 11030 poke i,0
  108. 11040 next i
  109. 11999 return
  110. 20000 rem
  111. 20001 rem *** Read ***
  112. 20002 rem
  113. 20010 get b$
  114. 20020 IF b$="i" THEN ir=8
  115. 20030 IF b$="j" THEN ir=4
  116. 20040 IF b$="k" THEN ir=2
  117. 20050 IF b$="l" THEN ir=6
  118. 20060 IF b$="q" THEN jv=1
  119. 20999 return
  120. 21000 rem
  121. 21001 rem *** Move ***
  122. 21002 rem
  123. 21010 poke kk%+22*ye+xe,60
  124. 21020 if ir=2 then poke kk%+22*y+x,64
  125. 21030 if ir=4 then poke kk%+22*y+x,61
  126. 21040 if ir=6 then poke kk%+22*y+x,62
  127. 21050 if ir=8 then poke kk%+22*y+x,63
  128. 21999 return
  129. 22000 rem
  130. 22001 rem *** Evaluate ***
  131. 22002 rem
  132. 22010 if ir=2 then goto 22200
  133. 22020 if ir=4 then goto 22400
  134. 22030 if ir=6 then goto 22600
  135. 22040 if ir=8 then goto 22800
  136. 22099 return
  137. 22200 rem ir=2 down
  138. 22210 if y=22 then goto 22900
  139. 22220 if peek(kk%+22*(y+1)+x)<>32 then goto 22900
  140. 22230 let xe = x
  141. 22240 let ye = y
  142. 22250 let y = y + 1
  143. 22260 let p = p + 1
  144. 22299 return
  145. 22400 rem ir=4 left
  146. 22410 if x=0 then goto 22900
  147. 22420 if peek(kk%+22*y+(x-1))<>32 then goto 22900
  148. 22430 let xe = x
  149. 22440 let ye = y
  150. 22450 let x = x - 1
  151. 22460 let p = p + 1
  152. 22499 return
  153. 22600 rem ir=6 right
  154. 22610 if x=21 then goto 22900
  155. 22620 if peek(kk%+22*y+(x+1))<>32 then goto 22900
  156. 22630 let xe = x
  157. 22640 let ye = y
  158. 22650 let x = x + 1
  159. 22660 let p = p + 1
  160. 22699 return
  161. 22800 rem ir=8 up
  162. 22810 if y=0 then goto 22900
  163. 22820 if peek(kk%+22*(y-1)+x)<>32 then goto 22900
  164. 22830 let xe = x
  165. 22840 let ye = y
  166. 22850 let y = y - 1
  167. 22860 let p = p + 1
  168. 22899 return
  169. 22900 rem End
  170. 22910 let jv=1
  171. 22920 for i=1 to 200 : next : rem Wait
  172. 22930 gosub 11000 : rem Clear screen
  173. 22935 print chr$(147) : rem Because of a bug...
  174. 22940 print "game over."
  175. 22950 print "score: ";
  176. 22960 print p
  177. 22999 return
  178. 25000 rem
  179. 25001 rem *** Game over ***
  180. 25002 rem
  181. 25999 return
  182. 60000 rem ********
  183. 60001 rem * Data *
  184. 60002 rem ********
  185. 61000 rem
  186. 61001 rem *** New characters ***
  187. 61002 rem
  188. 61010 DATA 255,016,016,016,255,001,001,001
  189. 61020 DATA 007,031,127,255,255,127,031,007
  190. 61030 DATA 224,248,254,255,255,254,248,224
  191. 61040 DATA 024,060,060,126,126,255,255,255
  192. 61050 DATA 255,255,255,126,126,060,060,024
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement