Guest User

Wal-Rush?

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