Advertisement
Guest User

sprite_v_pf.bas

a guest
Jun 1st, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1.  
  2. dim pfx = x
  3. dim pfy = y
  4. dim pfox = u
  5. dim pfoy = v
  6. dim jf = w
  7. dim lf = p
  8. dim rf = q
  9. dim uf = r
  10. dim df = s
  11. dim sc0 = score
  12. dim sc1 = score + 1
  13. dim sc2 = score + 2
  14. const pfc = $82
  15. const p0c = $44
  16.  
  17. COLUBK = 0
  18. COLUPF = pfc
  19. COLUP0 = p0c
  20.  
  21. lf = 0 : rf = 0 : uf = 0 : df = 0
  22. pfx = 15 : pfox = 15
  23. pfy = 5 : pfox = 5
  24. f = 1
  25.  
  26. playfield:
  27. ................................
  28. ................................
  29. ................................
  30. ................................
  31. ................................
  32. ................................
  33. ................................
  34. ................................
  35. ................................
  36. ................................
  37. ................................
  38. ................................
  39. end
  40.  
  41. player0:
  42. %11111111
  43. %10000001
  44. %10000001
  45. %10000001
  46. %10000001
  47. %10000001
  48. %10000001
  49. %11111111
  50. end
  51.  
  52. pfpixel pfx pfy on
  53. player0x = 80 : player0y = 30
  54.  
  55.  
  56. main
  57.  
  58. if f then goto updatep
  59. if !lf && joy0left then lf = 1 : if pfx then pfx = pfx - 1
  60. if lf && !joy0left then lf = 0
  61.  
  62. if !rf && joy0right then rf = 1 : if pfx < 31 then pfx = pfx + 1
  63. if rf && !joy0right then rf = 0
  64.  
  65. if !uf && joy0up then uf = 1 : if pfy then pfy = pfy - 1
  66. if uf && !joy0up then uf = 0
  67.  
  68. if !df && joy0down then df = 1 : if pfy < 11 then pfy = pfy + 1
  69. if df && !joy0down then df = 0
  70.  
  71. pfpixel pfox pfoy off
  72. pfpixel pfx pfy on
  73. pfox = pfx : pfoy = pfy
  74. goto display
  75.  
  76. updatep
  77. if !lf && joy0left then lf = 1 : player0x = player0x - 1
  78. if lf && !joy0left then lf = 0
  79.  
  80. if !rf && joy0right then rf = 1 : player0x = player0x + 1
  81. if rf && !joy0right then rf = 0
  82.  
  83. if !uf && joy0up then uf = 1 : player0y = player0y - 1
  84. if uf && !joy0up then uf = 0
  85.  
  86. if !df && joy0down then df = 1 : player0y = player0y + 1
  87. if df && !joy0down then df = 0
  88.  
  89. display
  90. if !jf && joy0fire then jf = 1 : f = f ^ 1
  91. if jf && !joy0fire then jf = 0
  92.  
  93. if f then temp1 = player0x else temp1 = pfx
  94.  
  95. sc0 = 0 : sc1 = sc1 & 15
  96. if temp1 >= 100 then sc0 = sc0 + 16 : temp1 = temp1 - 100
  97. if temp1 >= 100 then sc0 = sc0 + 16 : temp1 = temp1 - 100
  98. if temp1 >= 50 then sc0 = sc0 + 5 : temp1 = temp1 - 50
  99. if temp1 >= 30 then sc0 = sc0 + 3 : temp1 = temp1 - 30
  100. if temp1 >= 20 then sc0 = sc0 + 2 : temp1 = temp1 - 20
  101. if temp1 >= 10 then sc0 = sc0 + 1 : temp1 = temp1 - 10
  102. sc1 = (temp1 * 4 * 4) | sc1
  103.  
  104. if f then temp1 = player0y else temp1 = pfy
  105.  
  106. sc1 = sc1 & 240 : sc2 = 0
  107. if temp1 >= 100 then sc1 = sc1 + 1 : temp1 = temp1 - 100
  108. if temp1 >= 100 then sc1 = sc1 + 1 : temp1 = temp1 - 100
  109. if temp1 >= 50 then sc2 = sc2 + 80 : temp1 = temp1 - 50
  110. if temp1 >= 30 then sc2 = sc2 + 48 : temp1 = temp1 - 30
  111. if temp1 >= 20 then sc2 = sc2 + 32 : temp1 = temp1 - 20
  112. if temp1 >= 10 then sc2 = sc2 + 16 : temp1 = temp1 - 10
  113. sc2 = sc2 | temp1
  114.  
  115. COLUP0 = p0c
  116. if f then scorecolor = p0c else scorecolor = pfc
  117. drawscreen
  118.  
  119. goto main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement