Advertisement
atm959

Sega Genesis Bullet Test Game (Coin bullet detect broke)

Feb 20th, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. tiledata:
  2. DATALONG $11122111 ' Tile #0
  3. DATALONG $11244211
  4. DATALONG $11244211
  5. DATALONG $12444421
  6. DATALONG $12666621
  7. DATALONG $12666621
  8. DATALONG $12666621
  9. DATALONG $12222221
  10. DATALONG $11133111 ' Tile #1
  11. DATALONG $11355311
  12. DATALONG $13566531
  13. DATALONG $35655653
  14. DATALONG $35655653
  15. DATALONG $13566531
  16. DATALONG $11355311
  17. DATALONG $11133111
  18. DATALONG $11333311 ' Tile #2
  19. DATALONG $13111131
  20. DATALONG $31711713
  21. DATALONG $31111113
  22. DATALONG $31311313
  23. DATALONG $31133113
  24. DATALONG $13111131
  25. DATALONG $11333311
  26.  
  27. palettedata:
  28. DATAINT $0000,$0000,$046A,$0EEE,$0CCC,$00EE,$0EA0,$0C42
  29. DATAINT $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
  30.  
  31. loadTiles tiledata, 3, 256
  32. palettes palettedata, 0, 0, 16
  33.  
  34. missileOne = addsprite(1, 1)
  35. coin = addsprite(1, 1)
  36. player = addsprite(1, 1)
  37.  
  38. propsprite missileOne, 256, 0
  39. propsprite coin, 257, 0
  40. propsprite player, 258, 0
  41.  
  42. dim x as integer
  43. dim y as integer
  44. x = 128 + 100
  45. y = 128 + 100
  46.  
  47. randomize timer
  48.  
  49. coinX = 128 + rnd(320 - 16)
  50. coinY = 128 + rnd(224 - 16)
  51.  
  52. playerMovementSpeed = 1
  53.  
  54. missileOneX = 0
  55. missileOneY = 0
  56.  
  57. movesprite missileOne, missileOneX, missileOneY
  58. movesprite player, x, y
  59. movesprite coin, coinX, coinY
  60.  
  61. dim missileOneShot as integer
  62. dim missileTwoShot as integer
  63. dim missileThreeShot as integer
  64. missileOneShot = 0
  65. missileTwoShot = 0
  66. missileThreeShot = 0
  67.  
  68. psgVol 0, 15
  69. psgVol 1, 15
  70. psgVol 2, 15
  71.  
  72. palette rgb(7, 7, 7), 0, 1
  73.  
  74. do
  75.  
  76. locate 5, 5
  77. print missileOneY
  78.  
  79. locate 6, 5
  80. print coinY
  81.  
  82. if joypad().0 then y = y - playerMovementSpeed
  83. if joypad().1 then y = y + playerMovementSpeed
  84. if joypad().2 then x = x - playerMovementSpeed
  85. if joypad().3 then x = x + playerMovementSpeed
  86.  
  87. if joypad().7 then
  88.  
  89. if missileOneShot = 0 then
  90.  
  91. missileOneX = x
  92. missileOneY = y
  93. missileOneShot = 1
  94.  
  95. end if
  96.  
  97. end if
  98.  
  99. if missileOneShot = 1 then
  100.  
  101. psg 0, missileOneY
  102.  
  103. missileOneY--
  104.  
  105. if missileOneY = 128 - 8 then
  106.  
  107. missileOneShot = 0
  108. missileOneX = 0
  109. missileOneY = 0
  110. psg 0, -1
  111.  
  112. end if
  113.  
  114. end if
  115.  
  116. if missileOneY > coinY and missileOneY < coinY and missileOneX > coinX and missileOneX < coinX then
  117.  
  118. randomize timer
  119. coinX = 128 + rnd(320 - 16)
  120. coinY = 128 + rnd(224 - 16)
  121.  
  122. end if
  123.  
  124. movesprite missileOne, missileOneX, missileOneY
  125. movesprite player, x, y
  126. movesprite coin, coinX, coinY
  127.  
  128. sleep 1
  129.  
  130. loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement