Guest User

bf14b.bas

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

×