Advertisement
NovaYoshi

chips mario global robot

Jan 15th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.44 KB | None | 0 0
  1. : "JUSTENTERED"
  2. set "spr20_off" to 1
  3. playercolor is c00
  4. lockplayer
  5. goto "#init"
  6.  
  7. set "mariopx" to "('PLAYERX'*8*16)"
  8. set "mariopy" to "('PLAYERY'*14*16)"
  9. set "mariocheckpx" to "mariopx"
  10. set "mariocheckpy" to "mariopy"
  11. set "mariovx" to 0
  12. set "mariovy" to 0
  13. set "camerax" to 0
  14. set "mariodir" to 0
  15.  
  16. : "gameloop"
  17. inc "frames" by 1
  18. set "alreadybounce" to 0
  19.  
  20. set "runspeed" to "(('key42'o'key54'o'key44')?64:32)"
  21.  
  22. set "marioframe" to 0
  23. if "key75" = 0 then "notleft"
  24. dec "mariopx" by "runspeed"
  25. set "mariodir" to 1
  26. : "notleft"
  27. if "key77" = 0 then "notright"
  28. inc "mariopx" by "runspeed"
  29. set "mariodir" to 0
  30. : "notright"
  31.  
  32. . "check for side collisions"
  33. set "marioby" to "('mariopy'>>4+8/14)"
  34. if c?? CustomBlock p?? at "('mariopx'>>4+1/8)" "marioby" then "#hitleft"
  35. if c?? CustomBlock p?? at "('mariopx'>>4+15/8)" "marioby" then "#hitright"
  36. set "marioby" to "('mariopy'>>4+26/14)"
  37. if c?? CustomBlock p?? at "('mariopx'>>4+1/8)" "marioby" then "#hitleft"
  38. if c?? CustomBlock p?? at "('mariopx'>>4+15/8)" "marioby" then "#hitright"
  39.  
  40.  
  41. . "add gravity"
  42. inc "mariovy" by 4
  43.  
  44. set "marioby" to "('mariopy'+'mariovy'>>4+27/14)"
  45. set "mariobx" to "('mariopx'>>4+1/8)"
  46. if c?? CustomBlock p?? at "mariobx" "marioby" then "#hitground"
  47. set "mariobx" to "('mariopx'>>4+14/8)"
  48. if c?? CustomBlock p?? at "mariobx" "marioby" then "#hitground"
  49.  
  50. . "check top"
  51. set "marioby" to "('mariopy'+'mariovy'>>4+8/14)"
  52. set "mariobx" to "('mariopx'>>4+1/8)"
  53. if c?? CustomBlock p?? at "mariobx" "marioby" then "#hitceiling"
  54. set "mariobx" to "('mariopx'>>4+14/8)"
  55. if c?? CustomBlock p?? at "mariobx" "marioby" then "#hitceiling"
  56.  
  57. inc "mariopy" by "mariovy"
  58.  
  59. . "check for coins"
  60. set "marioby" to "('mariopy'>>4+14/14)"
  61. set "mariobx" to "('mariopx'>>4+1/8)"
  62. if c?? CustomFloor p?? at "mariobx" "marioby" then "#touchmiddle"
  63. if c?? Tree p?? at "mariobx" "marioby" then "#touchtree"
  64. set "mariobx" to "('mariopx'>>4+14/8)"
  65. if c?? CustomFloor p?? at "mariobx" "marioby" then "#touchmiddle"
  66. if c?? Tree p?? at "mariobx" "marioby" then "#touchtree"
  67.  
  68. if "mariopy" < "(25*14*16)" then "nodiepit"
  69. : "mariodie"
  70. mod fade out
  71. wait for 10
  72. play "&smw_lost_a_life.wav&"
  73. wait for 200
  74. mod fade in "*"
  75. set "mariopx" to "mariocheckpx"
  76. set "mariopy" to "mariocheckpy"
  77. set "mariovy" to 0
  78. : "nodiepit"
  79.  
  80.  
  81. . "adjust camera"
  82. set "targetx" to "('mariopx'-(320*16)-'camerax'>>>2)"
  83. inc "camerax" by "targetx"
  84. set "camerax" to "('camerax'<0?0:'camerax')"
  85.  
  86. set "local1" to "('BOARD_W'-80*8*16)"
  87. set "camerax" to "('camerax'>'local1'?'local1':'camerax')"
  88. set "local1" to "('camerax'>>>4)"
  89. set "spr1_x" to "(-('local1'%8))"
  90. set "spr1_refx" to "('local1'/8)"
  91.  
  92. . "display"
  93. set "mariorx" to "('mariopx'-'camerax'>>4)"
  94. set "mariory" to "('mariopy'>>4)"
  95.  
  96. if "('frames'a8>0a('key75'o'key77'))" = 0 then "notwalk"
  97. set "marioframe" to 1
  98. : "notwalk"
  99.  
  100. if "('mariovy'>>>4)" < 0 then "#jumpframe"
  101. if "('mariovy'>>>4)" > 0 then "#fallframe"
  102.  
  103. set "layer" to 10
  104. : "layerset"
  105. set "spr&layer&_x" to "mariorx"
  106. set "spr&layer&_y" to "mariory"
  107. set "spr&layer&_refx" to "('marioframe'<<1)"
  108. set "spr&layer&_offset" to "('mariodir'<<8+256)"
  109. inc "layer" by 1
  110. if "layer" != 19 then "layerset"
  111.  
  112. cycle 1
  113. goto "gameloop"
  114.  
  115.  
  116. : "#hitleft"
  117. inc "mariopx" by "runspeed"
  118. goto "#return"
  119.  
  120. : "#hitright"
  121. dec "mariopx" by "runspeed"
  122. goto "#return"
  123.  
  124. : "#hitground"
  125. if "alreadybounce" = 1 then "#return"
  126. if c?? CustomBlock pd2 at "mariobx" "marioby" then "bouncenote"
  127. if c?? CustomBlock pd3 at "mariobx" "marioby" then "bouncenote"
  128. set "mariovy" to 0
  129. if "('key57'o'key45')" = 0 then "notjump"
  130. play "&smw_jump.wav&"
  131. set "mariovy" to -96
  132. : "notjump"
  133. goto "#return"
  134.  
  135. : "bouncenote"
  136. play "&smw_spring_jump.wav&"
  137. if "('key57'o'key45')" = 1 then "higherjump"
  138. set "mariovy" to -96
  139. set "alreadybounce" to 1
  140. goto "#return"
  141. : "higherjump"
  142. set "mariovy" to -140
  143. set "alreadybounce" to 1
  144. goto "#return"
  145.  
  146. : "#jumpframe"
  147. set "marioframe" to 2
  148. goto "#return"
  149. : "#fallframe"
  150. set "marioframe" to 3
  151. goto "#return"
  152.  
  153. : "#hitceiling"
  154. inc "mariopy" by 10
  155. set "mariovy" to -5
  156. if c?? CustomBlock pcc at "mariobx" "marioby" then "breakbrickl"
  157. if c?? CustomBlock pcd at "mariobx" "marioby" then "breakbrickr"
  158. if c?? CustomBlock pc8 at "mariobx" "marioby" then "openprizel"
  159. if c?? CustomBlock pc9 at "mariobx" "marioby" then "openprizer"
  160. goto "#return"
  161.  
  162. : "breakbrickl"
  163. play "&smw_break_block.wav&"
  164. : "destroyl"
  165. put c00 Space p00 at "mariobx" "marioby"
  166. put c00 Space p00 at "('mariobx'+1)" "marioby"
  167. goto "#return"
  168. : "breakbrickr"
  169. play "&smw_break_block.wav&"
  170. : "destroyr"
  171. put c00 Space p00 at "mariobx" "marioby"
  172. put c00 Space p00 at "('mariobx'-1)" "marioby"
  173. goto "#return"
  174. : "openprizel"
  175. play "&smw_coin.wav&"
  176. inc "COINS" by 1
  177. put ca9 CustomBlock pce at "mariobx" "marioby"
  178. put ca9 CustomBlock pcf at "('mariobx'+1)" "marioby"
  179. goto "#return"
  180. : "openprizer"
  181. play "&smw_coin.wav&"
  182. inc "COINS" by 1
  183. put ca9 CustomBlock pce at "('mariobx'-1)" "marioby"
  184. put ca9 CustomBlock pcf at "mariobx" "marioby"
  185. goto "#return"
  186.  
  187. : "#touchmiddle"
  188. if c?? CustomFloor pca at "mariobx" "marioby" then "getcoinl"
  189. if c?? CustomFloor pcb at "mariobx" "marioby" then "getcoinr"
  190. goto "#return"
  191. : "getcoinl"
  192. play "&smw_coin.wav&"
  193. inc "COINS" by 1
  194. goto "destroyl"
  195. : "getcoinr"
  196. play "&smw_coin.wav&"
  197. inc "COINS" by 1
  198. goto "destroyr"
  199.  
  200. : "#touchtree"
  201. if c0b Tree p?? at "mariobx" "marioby" then "level1"
  202. if c0a Tree p?? at "mariobx" "marioby" then "level2"
  203. if c05 Tree p?? at "mariobx" "marioby" then "level3"
  204. if c06 Tree p?? at "mariobx" "marioby" then "level4"
  205. if c01 Tree p?? at "mariobx" "marioby" then "lobby"
  206. goto "#return"
  207. : "level1"
  208. teleport player to "dorito land" at 10 19
  209. goto "#return"
  210. : "level2"
  211. teleport player to "frito land" at 11 15
  212. goto "#return"
  213. : "level3"
  214. teleport player to "cheetos land" at 3 13
  215. goto "#return"
  216. : "level4"
  217. teleport player to "sun chips land" at 49 17
  218. goto "#return"
  219. : "lobby"
  220. teleport player to "Lobby" at 38 19
  221. goto "#return"
  222.  
  223.  
  224. . "------------------------------------------------------------"
  225. : "#init"
  226. set "COMMANDS" to 32000
  227. set "MZX_SPEED" to 2
  228. load char set "@256mario.chr"
  229. load char set "@512mario2.chr"
  230.  
  231. . "Put mario layers in the vlayer"
  232. set "layer" to 0
  233. : "layerloop"
  234. set "clayer" to 0
  235. : "clayerloop"
  236. set "layeroffset" to "('layer'*2)"
  237. set "vx" to "('clayer'/2)"
  238. set "vy" to "('clayer'a1+'layeroffset')"
  239. set "vch&vx&,&vy&" to "('layer'*16+'clayer')"
  240. set "vco&vx&,&vy&" to "('layer'+1)"
  241.  
  242. inc "clayer" by 1
  243. if "clayer" != 16 then "clayerloop"
  244. inc "layer" by 1
  245. if "layer" != 9 then "layerloop"
  246.  
  247. set "sprnum" to 10
  248. : "spritemake"
  249. set "spr&sprnum&_refx" to 0
  250. set "spr&sprnum&_refy" to "('sprnum'-10*2)"
  251. set "spr&sprnum&_width" to 2
  252. set "spr&sprnum&_height" to 2
  253. set "spr&sprnum&_vlayer" to 1
  254. set "spr&sprnum&_unbound" to 1
  255. set "spr&sprnum&_offset" to 256
  256. put c?? Sprite "sprnum" at 50 50
  257.  
  258. inc "sprnum" by 1
  259. if "sprnum" != 19 then "spritemake"
  260.  
  261. . "get scrolling background ready"
  262. set "local1" to 80
  263. set "local2" to 0
  264. : "fillvlayer1"
  265. set "vco&local1&,&local2&" to 0
  266. set "vch&local1&,&local2&" to 219
  267. inc "local1" by 1
  268. if "local1" != 160 then "fillvlayer1"
  269. set "local1" to 80
  270. inc "local2" by 1
  271. if "local2" != 25 then "fillvlayer2"
  272.  
  273. set "spr0_refx" to 80
  274. set "spr0_refy" to 0
  275. set "spr0_width" to 80
  276. set "spr0_height" to 25
  277. set "spr0_unbound" to 1
  278. set "spr0_vlayer" to 1
  279. set "spr0_tcol" to 1
  280. put c?? Sprite p00 at 0 0
  281. set "spr1_refx" to 0
  282. set "spr1_refy" to 0
  283. set "spr1_width" to 81
  284. set "spr1_height" to 25
  285. set "spr1_unbound" to 1
  286. put c?? Sprite p01 at 0 0
  287.  
  288. goto "#return"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement