Guest User

bf20_2.bas

a guest
May 17th, 2014
248
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set kernel_options no_blank_lines
  2. set romsize 2k
  3.  
  4. const noscore=1
  5.  
  6. d=$c6 : e=$44
  7.  
  8. title_screen
  9.  
  10. r=r+1
  11. AUDC0=12 : AUDV0=5 : AUDF0=music[v]
  12. if r>25 then r=0 : v=v+1
  13.  
  14. if v>20 then v=0
  15.  
  16. g=0 : n=0 : u=0 : y=0
  17. if w<64 then w=w+1 : z=1 : t=w/2
  18. bally=200
  19.  
  20. b=b+1
  21. if b=0 then d=rand : e=rand
  22.  
  23.  
  24. playfield:
  25. .X.....XXX...XXX...XXX...X.X.....
  26. .X.....X.X...X.X...X.X...X.X.....
  27. .X.....XXX...XX....XX.....X......
  28. .X.....X.X...X.X...X.X....X......
  29. .X.....X.X...X.X...X.X....X......
  30. .X...............................
  31. .X.....XXX...XX.XX....XX....XX...
  32. .X.....X.....X.X.X...X..X...X.X..
  33. .X.....XXX...X.X.X...X..X...X.X..
  34. .X.....X.....X...X...X..X...X.X..
  35. .XXXX..XXX...X...X....XX....X.X..
  36. end
  37.  
  38. player0:
  39. %10101011
  40. %10101010
  41. %10111011
  42. %10101010
  43. %10101011
  44. %10000000
  45. end
  46.  
  47.  
  48.  
  49. player0x=78 : player0y=47 : missile1x=78 : missile1y=41 : player1y=200
  50.  
  51. player0score=$80
  52.  
  53. if !joy0fire then goto main
  54.  
  55.  
  56.  
  57. beginning_game
  58.  
  59. playfield:
  60. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
  61. X..............................X.
  62. X..XX..XX..XX..XX..XX..XX..XX..X.
  63. X..............................X.
  64. X..XX..XX..XX..XX..XX..XX..XX..X.
  65. X..............................X.
  66. X..XX..XX..XX..XX..XX..XX..XX..X.
  67. X..............................X.
  68. X..XX..XX..XX..XX..XX..XX..XX..X.
  69. X..............................X.
  70. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
  71. end
  72.  
  73. player0:
  74. %01111100
  75. %11111111
  76. %11000010
  77. end
  78.  
  79. player1:
  80. %00111100
  81. %01111110
  82. %11111111
  83. %01111110
  84. %00111100
  85. end
  86.  
  87.  
  88.  
  89. new_game
  90.  
  91. player1score=0 : player0score=0 : y=0 : r=0 : v=0
  92.  
  93. new_game_2
  94. player1x=21 : player1y=21
  95. player0x=133
  96. player0y=79 : m=79
  97. get_new_present
  98.  
  99. ballx=(rand/4)+21
  100. bally=(rand/4)+15
  101.  
  102.  
  103. main
  104.  
  105. if switchreset then goto title_screen
  106.  
  107.  
  108. player1scorecolor=26 : COLUBK=d : COLUPF=e
  109. if switchbw then a=d : c=e : a=(d/16)-g : c=e/16 : player1scorecolor=8 : COLUBK=a : COLUPF=c
  110.  
  111.  
  112. ballheight=2
  113. CTRLPF=$21
  114.  
  115. drawscreen
  116.  
  117.  
  118.  
  119.  
  120. if player0score=$80 then goto title_screen
  121. d=$c6 : e=$44 : g=6
  122. if z>0 then w=w+1
  123. if w>15 then z=0 : w=0
  124.  
  125.  
  126. if player0score>$79 then z=1 : u=4 : y=1 : w=0 : goto title_screen
  127.  
  128. AUDV0=u : AUDC0=z : AUDF0=t
  129.  
  130. missile1y=0 : NUSIZ1=0
  131.  
  132.  
  133. y=y+1
  134. if y=64 then y=0 : player0score=addbcd(player0score, 1)
  135.  
  136. if collision(player1,player0) then player0score=addbcd(player0score, 5) : z=3 : u=4 : t=24 : goto new_game_2
  137.  
  138. if collision(ball,playfield) then ballx=ballx+1
  139. if collision(player1,ball) then player1score=addbcd(player1score, 1) : z=4 : u=4 : t=24 : goto get_new_present
  140.  
  141. move_enemy
  142. s=s+1 : m=m+1
  143. if m>31 then get_enemy_dir
  144. if s{0} then move_player
  145.  
  146.  
  147. get_enemy_dir
  148. m=0
  149. if player0x=player1x then n=5
  150. if player0y=player1y then get_enemy_dir_2
  151.  
  152. if n<3 then get_enemy_dir_2
  153. n=2
  154. if player0y>player1y then n=1
  155. goto enemy_move
  156.  
  157. get_enemy_dir_2
  158. n=4
  159. if player0x>player1x then n=3
  160.  
  161.  
  162. enemy_move
  163.  
  164. pn = 0 : dir = n
  165. gosub move
  166. skip_enemy_move
  167.  
  168. move_player
  169. if s{0} then goto main
  170.  
  171. pn = 1
  172. dir = SWCHA / 16 ^ $0F
  173. if !dir then skip_to_f
  174. dir = dn[dir] : gosub move
  175. if dir then f = dir : goto main
  176. skip_to_f
  177. dir = f
  178. gosub move
  179.  
  180. goto main
  181.  
  182. rem direction number 1 = up, 2 = down, 3 = left, 4 = right
  183. data dn
  184. 0, 1, 2, 0, 3, 3, 3, 0, 4, 4, 4
  185. end
  186.  
  187. rem pn = player number parameter
  188. rem dir = direction parameter
  189. rem scol = screen column
  190. rem srow = screen row
  191.  
  192. dim pn = temp3
  193. dim dir = temp4
  194. dim scol = temp5
  195. dim srow = temp6
  196.  
  197. move
  198. if dir < 3 then ud
  199. scol = (offset[dir] + player0x[pn]) / 4
  200. srow = (player0y[pn] - 7) / 8
  201. if pfread(scol, srow) then rl_0
  202. scol = (srow * 8) + 7
  203. if player0y[pn] = scol then skip_rl_0
  204. rl_0
  205. dir = 0
  206. skip_rl_0
  207. player0x[pn] = player0x[pn] + mov[dir]
  208. return
  209.  
  210. ud
  211. scol = (player0x[pn] - 17) / 4
  212. srow = (offset[dir] + player0y[pn]) / 8
  213. if pfread(scol, srow) then ud_0
  214. scol = scol + 1
  215. if pfread(scol, srow) then ud_0
  216. scol = (scol * 4) + 13
  217. if player0x[pn] = scol then skip_ud_0
  218. ud_0
  219. dir = 0
  220. skip_ud_0
  221. player0y[pn] = player0y[pn] + mov[dir]
  222. return
  223.  
  224. data offset
  225. 0, -8, 1, -18, -9
  226. end
  227.  
  228. data mov
  229. 0, -1, 1, -1, 1
  230. end
  231.  
  232. data music
  233. 17, 19, 20, 19, 17, 19, 20, 19, 15, 15
  234. 17, 19, 20, 19, 17, 19, 20, 23, 26, 26, 26
  235. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×