Advertisement
Guest User

Wal-Rush?

a guest
Jan 25th, 2016
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. rem Generated 1/25/2016 12:11:20 AM by Visual bB Version 1.0.0.548
  2. rem *************************************
  3. rem *Wal-Rush! *
  4. rem *A game of walrii, fish, and flight.*
  5. rem *Josiah Winslow *
  6. rem *CC BY-NC-SA *
  7. rem *************************************
  8.  
  9. rem Initial settings.
  10. set tv ntsc
  11. set kernel_option player1colors
  12.  
  13. rem Variable aliases.
  14. dim P0_X=player0x.a
  15. dim P1_X=player1x.b
  16. dim _Walrii_Y_Vel=c
  17. dim _Bit0_Fire_Restrainer=d
  18. dim _Bit1_Walrii_Flying=d
  19. dim _Structure_Timer=e
  20. dim _Structure_Identifier=f
  21. dim _Frame_Delay=g
  22. dim _Fish_Animation=h
  23. dim _Fish_Animation_Delay=i
  24.  
  25. rem Graphics data.
  26. playfield:
  27. ................................
  28. ................................
  29. ................................
  30. ................................
  31. ..X...X...X...X...X...X...X...X.
  32. .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X
  33. X...X...X...X...X...X...X...X...
  34. .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X
  35. ..X...X...X...X...X...X...X...X.
  36. .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X
  37. X...X...X...X...X...X...X...X...
  38. end
  39.  
  40. player1color:
  41. $04
  42. $04
  43. $04
  44. $04
  45. $04
  46. $04
  47. $04
  48. $04
  49. $04
  50. $04
  51. $04
  52. $04
  53. $80
  54. $80
  55. $80
  56. $80
  57. $04
  58. $04
  59. end
  60.  
  61. player1:
  62. %10110110
  63. %10110110
  64. %11111111
  65. %11111111
  66. %10101111
  67. %10101111
  68. %10101111
  69. %10101111
  70. %10101111
  71. %10101111
  72. %11111111
  73. %11111111
  74. %11011010
  75. %11011010
  76. %10010010
  77. %10010010
  78. %01101100
  79. %01101100
  80. end
  81.  
  82. rem Initialize variables for game.
  83. _Game_Start
  84. COLUPF=$08
  85. COLUBK=$0E
  86. COLUP0=$00
  87. player0x=255:player0y=255
  88. player1x=128:player1y=56
  89. _Walrii_Y_Vel=0
  90. _Bit0_Fire_Restrainer{0}=1
  91. _Bit1_Walrii_Flying{1}=0
  92. _Structure_Timer=240
  93. _Structure_Identifier=0
  94. _Frame_Delay=3
  95. _Fish_Animation=0
  96. _Fish_Animation_Delay=0
  97.  
  98. rem Main game loop.
  99. _Main_Game_Loop
  100.  
  101. rem Draw the screen.
  102. drawscreen
  103.  
  104. rem Make Walrii twice as wide.
  105. NUSIZ1=$05
  106.  
  107. rem Random structure generator.
  108. if _Structure_Timer=240 then _Structure_Timer=0:player0x=0:player0y=(rand&63)+21:gosub _Generate_Structure
  109. if _Structure_Identifier=0 then NUSIZ0=$05:goto _Mine
  110. if _Structure_Identifier=1 then goto _Fish
  111. if _Structure_Timer>0 then goto _Skip_Structures
  112.  
  113. rem Mine (spikey ball).
  114. _Mine
  115.  
  116. player0:
  117. %10010001
  118. %10010001
  119. %01001010
  120. %01001010
  121. %00111100
  122. %00111100
  123. %01111101
  124. %01111101
  125. %10111110
  126. %10111110
  127. %00111100
  128. %00111100
  129. %01010010
  130. %01010010
  131. %10001001
  132. %10001001
  133. end
  134.  
  135. goto _Skip_Structures
  136.  
  137. rem Fish (collectible item).
  138. _Fish
  139.  
  140. rem Choose animation frame.
  141. if _Fish_Animation=0 then goto _Fish_0
  142. if _Fish_Animation=1 then goto _Fish_1
  143. if _Fish_Animation=2 then goto _Fish_2
  144. if _Fish_Animation=3 then goto _Fish_1
  145.  
  146. _Fish_0
  147. player0:
  148. %11011000
  149. %10101000
  150. %10000110
  151. %01000010
  152. %01000001
  153. %01000101
  154. %00110001
  155. %00001110
  156. end
  157. goto _Skip_Fish_Frames
  158.  
  159. _Fish_1
  160. player0:
  161. %00000000
  162. %11011110
  163. %10100001
  164. %01000001
  165. %10100101
  166. %11010010
  167. %00001100
  168. %00000000
  169. end
  170. goto _Skip_Fish_Frames
  171.  
  172. _Fish_2
  173. player0:
  174. %00001110
  175. %00110001
  176. %01000101
  177. %01000001
  178. %01000010
  179. %10000110
  180. %10101000
  181. %11011000
  182. end
  183.  
  184. _Skip_Fish_Frames
  185.  
  186. rem Change animation frame.
  187. if _Fish_Animation_Delay=0 then _Fish_Animation_Delay=8:_Fish_Animation=_Fish_Animation+1
  188. _Fish_Animation_Delay=_Fish_Animation_Delay-1
  189. if _Fish_Animation=4 then _Fish_Animation=0
  190.  
  191. _Skip_Structures
  192.  
  193. rem Move structure based on timer.
  194. _Structure_Timer=_Structure_Timer+1:P0_X=P0_X+0.6
  195.  
  196. rem Frame delay for Walrii.
  197. _Frame_Delay=_Frame_Delay-1
  198. if _Frame_Delay>0 then goto _Skip_Walrii_Move
  199. if _Frame_Delay=0 then _Frame_Delay=3
  200.  
  201. rem "Repetition Restrainer".
  202. if !joy0fire then _Bit0_Fire_Restrainer{0}=0:goto _Skip_RR
  203. if _Bit0_Fire_Restrainer{0} then goto _Skip_RR
  204. _Bit0_Fire_Restrainer{0}=1:_Bit1_Walrii_Flying{1}=1
  205.  
  206. _Skip_RR
  207.  
  208. rem Check if Walrii should be flying.
  209. if !_Bit1_Walrii_Flying{1} then _Walrii_Y_Vel=_Walrii_Y_Vel+1:goto _Skip_Fly
  210.  
  211. rem Change Walrii Y velocity.
  212. _Walrii_Y_Vel=-6:_Bit1_Walrii_Flying{1}=0
  213.  
  214. _Skip_Fly
  215.  
  216. rem Add Y velocity to position.
  217. player1y=player1y+_Walrii_Y_Vel
  218.  
  219. rem Change X position based on keypress.
  220. if joy0left then P1_X=P1_X-2.5
  221. if joy0right then P1_X=P1_X+2.5
  222.  
  223. _Skip_Walrii_Move
  224.  
  225. rem Adjust Y position so you don't wrap around the screen.
  226. if player1y<18 then player1y=18
  227. if player1y>105 then player1y=105:_Walrii_Y_Vel=0
  228.  
  229. rem Adjust X position so you don't wrap around the screen.
  230. if player1x<16 then player1x=16
  231. if player1x>128 then player1x=128
  232.  
  233. rem Jump back to main game loop.
  234. goto _Main_Game_Loop
  235.  
  236. rem Structure generator subroutine.
  237. _Generate_Structure
  238. if rand>140 then _Structure_Identifier=0 else _Structure_Identifier=1
  239. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement