Advertisement
Guest User

x3_cloop.bas

a guest
May 30th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. mark1
  2. set optimization noinlinedata
  3.  
  4. dim ns0p = a
  5. dim jf = b
  6. dim p0x = c
  7. dim p0v = d
  8.  
  9. player1:
  10. %11111110
  11. %01111100
  12. %00111000
  13. %00010000
  14. %00000000
  15. %00000000
  16. %00000000
  17. %00000000
  18. end
  19.  
  20. player0:
  21. %00000000
  22. %00000000
  23. %00000000
  24. %00000000
  25. %00000000
  26. %00011000
  27. %10111101
  28. %01100110
  29. end
  30.  
  31. player1x = 76 : player1y = 88
  32. player0x = 56 : p0x = 56 : player0y = 10
  33. ns0p = %00000111 : jf = 1 : p0v = 0
  34.  
  35. main
  36.  
  37. if !collision(player0, missile1) then no_col
  38.  
  39. rem bits in the table pointer ns0p correspond
  40. rem to the three copies and get masked out
  41. rem for a collision
  42.  
  43. temp1 = missile1x - p0x : temp2 = %00000100
  44. col_loop
  45. if temp1 < 8 then update_p0
  46. temp2 = temp2 / 2 : temp1 = temp1 - 16
  47. if temp2 then col_loop
  48. goto no_col
  49.  
  50. update_p0
  51. ns0p = ns0p ^ temp2
  52. jf = 1 : missile1y = 0
  53. if !ns0p then p0v = 1 : ns0p = %00000111
  54. no_col
  55.  
  56. if joy0fire && jf then missile1x = player1x + 3 : missile1y = 80 : jf = 0
  57. if joy0left then if player1x > 8 then player1x = player1x - 1
  58. if joy0right then if player1x < 146 then player1x = player1x + 1
  59.  
  60. if jf then skip_missile
  61. missile1y = missile1y - 1
  62. if !missile1y then jf = 1
  63. skip_missile
  64.  
  65. p0x = p0x + p0v
  66. if p0x < 10 || p0x >110 then p0v = 0 - p0v
  67.  
  68. player0x = p0x + pos0[ns0p]
  69.  
  70. NUSIZ0 = ns0[ns0p]
  71. NUSIZ1 = $10
  72. COLUP0 = $28
  73. COLUP1 = $20
  74. COLUBK = $00
  75. drawscreen
  76.  
  77. goto main
  78.  
  79. data ns0
  80. $20, $20, $20, $21, $20, $22, $21, $23
  81. end
  82.  
  83. data pos0
  84. $00, $20, $10, $10, $00, $00, $00, $00
  85. end
  86.  
  87. mark2
  88.  
  89. asm
  90. echo (.mark2-.mark1)d
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement