Advertisement
Guest User

scr_positions.bas

a guest
Jun 5th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1.  
  2. dim pfx = z
  3. dim pfy = y
  4. dim pfox = x
  5. dim pfoy = w
  6. dim pl = v
  7. dim jf = u
  8. dim dx = t
  9. dim dy = s
  10. dim sf = r
  11. dim sc0 = score
  12. dim sc1 = score + 1
  13. dim sc2 = score + 2
  14. const pfc = $82
  15. const p0cc = $36
  16. const p0nc = $42
  17. const cp0c = $1C
  18.  
  19. COLUBK = 0
  20. COLUPF = pfc
  21. COLUP0 = p0nc
  22.  
  23. pfx = 15 : pfox = 15
  24. pfy = 5 : pfoy = 5
  25. f = 1 : pl = 1 :scorecolor = p0nc
  26. gosub p1
  27.  
  28. playfield:
  29. ................................
  30. ................................
  31. ................................
  32. ................................
  33. ................................
  34. ................................
  35. ................................
  36. ................................
  37. ................................
  38. ................................
  39. ................................
  40. ................................
  41. end
  42.  
  43. pfpixel pfx pfy on
  44. player0x = 80 : player0y = 30
  45.  
  46.  
  47. main
  48.  
  49. temp1 = sf
  50. sf = SWCHA/16
  51. temp2 = (sf ^ 15) & temp1
  52. temp3 = temp2 & 3 : dy = dtbl[temp3]
  53. temp3 = temp2/4 & 3 : dx = dtbl[temp3]
  54.  
  55. if temp2 then on f gosub movpf movpl0 chngpl0
  56.  
  57. if !jf && joy0fire then jf = 1 : f = ftbl[f] : scorecolor = scctbl[f] : on f gosub pf_scc pl0_scc chngpl0
  58. if jf && !joy0fire then jf = 0
  59.  
  60.  
  61. if f = 2 then COLUP0 = cp0c : goto draw
  62. if collision(player0, playfield) then COLUP0 = p0cc else COLUP0 = p0nc
  63.  
  64. draw
  65. drawscreen
  66.  
  67. goto main
  68.  
  69. data scctbl
  70. pfc, p0nc, cp0c
  71. end
  72.  
  73. data dtbl
  74. 0, -1, 1, 0
  75. end
  76.  
  77. data ftbl
  78. 1, 2, 0
  79. end
  80.  
  81. movpf
  82. pfx = (pfx + dx) & 31
  83. pfy = pfy + dy
  84. if pfy = 255 then pfy = 11
  85. if pfy = 12 then pfy = 0
  86.  
  87. pfpixel pfox pfoy off
  88. pfpixel pfx pfy on
  89. pfox = pfx : pfoy = pfy
  90. pf_scc
  91. temp1 = pfx : temp2 = pfy
  92. goto update_scr
  93.  
  94. movpl0
  95. player0x = player0x + dx
  96. player0y = player0y + dy
  97. pl0_scc
  98. temp1 = player0x : temp2 = player0y
  99. goto update_scr
  100.  
  101. chngpl0
  102. if !temp2 then return
  103. pl = pl + dx
  104. if pl = 255 then pl = 6
  105. if pl = 7 then pl = 0
  106. on pl goto p0 p1 p2 p3 p4 p5 p6
  107.  
  108. update_scr
  109. sc0 = 0 : sc1 = sc1 & 15
  110. if temp1 >= 100 then sc0 = sc0 + 16 : temp1 = temp1 - 100
  111. if temp1 >= 100 then sc0 = sc0 + 16 : temp1 = temp1 - 100
  112. if temp1 >= 50 then sc0 = sc0 + 5 : temp1 = temp1 - 50
  113. if temp1 >= 30 then sc0 = sc0 + 3 : temp1 = temp1 - 30
  114. if temp1 >= 20 then sc0 = sc0 + 2 : temp1 = temp1 - 20
  115. if temp1 >= 10 then sc0 = sc0 + 1 : temp1 = temp1 - 10
  116. sc1 = (temp1 * 4 * 4) | sc1
  117.  
  118. sc1 = sc1 & 240 : sc2 = 0
  119. if temp2 >= 100 then sc1 = sc1 + 1 : temp2 = temp2 - 100
  120. if temp2 >= 100 then sc1 = sc1 + 1 : temp2 = temp2 - 100
  121. if temp2 >= 50 then sc2 = sc2 + 80 : temp2 = temp2 - 50
  122. if temp2 >= 30 then sc2 = sc2 + 48 : temp2 = temp2 - 30
  123. if temp2 >= 20 then sc2 = sc2 + 32 : temp2 = temp2 - 20
  124. if temp2 >= 10 then sc2 = sc2 + 16 : temp2 = temp2 - 10
  125. sc2 = sc2 | temp2
  126. rt
  127. return
  128.  
  129. p0
  130. player0:
  131. %11111111
  132. %10000001
  133. %10000001
  134. %10000001
  135. %10000001
  136. %10000001
  137. %10000001
  138. %11111111
  139. end
  140. return
  141.  
  142. p1
  143. player0:
  144. %10000001
  145. %00000000
  146. %00000000
  147. %00000000
  148. %00000000
  149. %00000000
  150. %00000000
  151. %10000001
  152. end
  153. return
  154.  
  155. p2
  156. player0:
  157. %00010000
  158. %00010000
  159. %00010000
  160. %00011111
  161. %11111000
  162. %00001000
  163. %00001000
  164. %00001000
  165. end
  166. return
  167.  
  168. p3
  169. player0:
  170. %00010000
  171. %00010000
  172. %00010000
  173. %11111110
  174. %00010000
  175. %00010000
  176. %00010000
  177. %00000000
  178. end
  179. return
  180.  
  181. p4
  182. player0:
  183. %10000001
  184. %10000001
  185. %10000001
  186. %10000001
  187. %10000001
  188. %10000001
  189. %10000001
  190. %10000001
  191. end
  192. return
  193.  
  194. p5
  195. player0:
  196. %10000001
  197. %10000001
  198. %10000001
  199. %10000001
  200. %10000001
  201. %10000001
  202. %10000001
  203. %11111111
  204. end
  205. return
  206.  
  207. p6
  208. player0:
  209. %11111111
  210. %10000001
  211. %10000001
  212. %10000001
  213. %10000001
  214. %10000001
  215. %10000001
  216. %10000001
  217. end
  218. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement