Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- : "JUSTENTERED"
- set "spr20_off" to 1
- playercolor is c00
- lockplayer
- goto "#init"
- set "mariopx" to "('PLAYERX'*8*16)"
- set "mariopy" to "('PLAYERY'*14*16)"
- set "mariocheckpx" to "mariopx"
- set "mariocheckpy" to "mariopy"
- set "mariovx" to 0
- set "mariovy" to 0
- set "camerax" to 0
- set "mariodir" to 0
- : "gameloop"
- inc "frames" by 1
- set "alreadybounce" to 0
- set "runspeed" to "(('key42'o'key54'o'key44')?64:32)"
- set "marioframe" to 0
- if "key75" = 0 then "notleft"
- dec "mariopx" by "runspeed"
- set "mariodir" to 1
- : "notleft"
- if "key77" = 0 then "notright"
- inc "mariopx" by "runspeed"
- set "mariodir" to 0
- : "notright"
- . "check for side collisions"
- set "marioby" to "('mariopy'>>4+8/14)"
- if c?? CustomBlock p?? at "('mariopx'>>4+1/8)" "marioby" then "#hitleft"
- if c?? CustomBlock p?? at "('mariopx'>>4+15/8)" "marioby" then "#hitright"
- set "marioby" to "('mariopy'>>4+26/14)"
- if c?? CustomBlock p?? at "('mariopx'>>4+1/8)" "marioby" then "#hitleft"
- if c?? CustomBlock p?? at "('mariopx'>>4+15/8)" "marioby" then "#hitright"
- . "add gravity"
- inc "mariovy" by 4
- set "marioby" to "('mariopy'+'mariovy'>>4+27/14)"
- set "mariobx" to "('mariopx'>>4+1/8)"
- if c?? CustomBlock p?? at "mariobx" "marioby" then "#hitground"
- set "mariobx" to "('mariopx'>>4+14/8)"
- if c?? CustomBlock p?? at "mariobx" "marioby" then "#hitground"
- . "check top"
- set "marioby" to "('mariopy'+'mariovy'>>4+8/14)"
- set "mariobx" to "('mariopx'>>4+1/8)"
- if c?? CustomBlock p?? at "mariobx" "marioby" then "#hitceiling"
- set "mariobx" to "('mariopx'>>4+14/8)"
- if c?? CustomBlock p?? at "mariobx" "marioby" then "#hitceiling"
- inc "mariopy" by "mariovy"
- . "check for coins"
- set "marioby" to "('mariopy'>>4+14/14)"
- set "mariobx" to "('mariopx'>>4+1/8)"
- if c?? CustomFloor p?? at "mariobx" "marioby" then "#touchmiddle"
- if c?? Tree p?? at "mariobx" "marioby" then "#touchtree"
- set "mariobx" to "('mariopx'>>4+14/8)"
- if c?? CustomFloor p?? at "mariobx" "marioby" then "#touchmiddle"
- if c?? Tree p?? at "mariobx" "marioby" then "#touchtree"
- if "mariopy" < "(25*14*16)" then "nodiepit"
- : "mariodie"
- mod fade out
- wait for 10
- play "&smw_lost_a_life.wav&"
- wait for 200
- mod fade in "*"
- set "mariopx" to "mariocheckpx"
- set "mariopy" to "mariocheckpy"
- set "mariovy" to 0
- : "nodiepit"
- . "adjust camera"
- set "targetx" to "('mariopx'-(320*16)-'camerax'>>>2)"
- inc "camerax" by "targetx"
- set "camerax" to "('camerax'<0?0:'camerax')"
- set "local1" to "('BOARD_W'-80*8*16)"
- set "camerax" to "('camerax'>'local1'?'local1':'camerax')"
- set "local1" to "('camerax'>>>4)"
- set "spr1_x" to "(-('local1'%8))"
- set "spr1_refx" to "('local1'/8)"
- . "display"
- set "mariorx" to "('mariopx'-'camerax'>>4)"
- set "mariory" to "('mariopy'>>4)"
- if "('frames'a8>0a('key75'o'key77'))" = 0 then "notwalk"
- set "marioframe" to 1
- : "notwalk"
- if "('mariovy'>>>4)" < 0 then "#jumpframe"
- if "('mariovy'>>>4)" > 0 then "#fallframe"
- set "layer" to 10
- : "layerset"
- set "spr&layer&_x" to "mariorx"
- set "spr&layer&_y" to "mariory"
- set "spr&layer&_refx" to "('marioframe'<<1)"
- set "spr&layer&_offset" to "('mariodir'<<8+256)"
- inc "layer" by 1
- if "layer" != 19 then "layerset"
- cycle 1
- goto "gameloop"
- : "#hitleft"
- inc "mariopx" by "runspeed"
- goto "#return"
- : "#hitright"
- dec "mariopx" by "runspeed"
- goto "#return"
- : "#hitground"
- if "alreadybounce" = 1 then "#return"
- if c?? CustomBlock pd2 at "mariobx" "marioby" then "bouncenote"
- if c?? CustomBlock pd3 at "mariobx" "marioby" then "bouncenote"
- set "mariovy" to 0
- if "('key57'o'key45')" = 0 then "notjump"
- play "&smw_jump.wav&"
- set "mariovy" to -96
- : "notjump"
- goto "#return"
- : "bouncenote"
- play "&smw_spring_jump.wav&"
- if "('key57'o'key45')" = 1 then "higherjump"
- set "mariovy" to -96
- set "alreadybounce" to 1
- goto "#return"
- : "higherjump"
- set "mariovy" to -140
- set "alreadybounce" to 1
- goto "#return"
- : "#jumpframe"
- set "marioframe" to 2
- goto "#return"
- : "#fallframe"
- set "marioframe" to 3
- goto "#return"
- : "#hitceiling"
- inc "mariopy" by 10
- set "mariovy" to -5
- if c?? CustomBlock pcc at "mariobx" "marioby" then "breakbrickl"
- if c?? CustomBlock pcd at "mariobx" "marioby" then "breakbrickr"
- if c?? CustomBlock pc8 at "mariobx" "marioby" then "openprizel"
- if c?? CustomBlock pc9 at "mariobx" "marioby" then "openprizer"
- goto "#return"
- : "breakbrickl"
- play "&smw_break_block.wav&"
- : "destroyl"
- put c00 Space p00 at "mariobx" "marioby"
- put c00 Space p00 at "('mariobx'+1)" "marioby"
- goto "#return"
- : "breakbrickr"
- play "&smw_break_block.wav&"
- : "destroyr"
- put c00 Space p00 at "mariobx" "marioby"
- put c00 Space p00 at "('mariobx'-1)" "marioby"
- goto "#return"
- : "openprizel"
- play "&smw_coin.wav&"
- inc "COINS" by 1
- put ca9 CustomBlock pce at "mariobx" "marioby"
- put ca9 CustomBlock pcf at "('mariobx'+1)" "marioby"
- goto "#return"
- : "openprizer"
- play "&smw_coin.wav&"
- inc "COINS" by 1
- put ca9 CustomBlock pce at "('mariobx'-1)" "marioby"
- put ca9 CustomBlock pcf at "mariobx" "marioby"
- goto "#return"
- : "#touchmiddle"
- if c?? CustomFloor pca at "mariobx" "marioby" then "getcoinl"
- if c?? CustomFloor pcb at "mariobx" "marioby" then "getcoinr"
- goto "#return"
- : "getcoinl"
- play "&smw_coin.wav&"
- inc "COINS" by 1
- goto "destroyl"
- : "getcoinr"
- play "&smw_coin.wav&"
- inc "COINS" by 1
- goto "destroyr"
- : "#touchtree"
- if c0b Tree p?? at "mariobx" "marioby" then "level1"
- if c0a Tree p?? at "mariobx" "marioby" then "level2"
- if c05 Tree p?? at "mariobx" "marioby" then "level3"
- if c06 Tree p?? at "mariobx" "marioby" then "level4"
- if c01 Tree p?? at "mariobx" "marioby" then "lobby"
- goto "#return"
- : "level1"
- teleport player to "dorito land" at 10 19
- goto "#return"
- : "level2"
- teleport player to "frito land" at 11 15
- goto "#return"
- : "level3"
- teleport player to "cheetos land" at 3 13
- goto "#return"
- : "level4"
- teleport player to "sun chips land" at 49 17
- goto "#return"
- : "lobby"
- teleport player to "Lobby" at 38 19
- goto "#return"
- . "------------------------------------------------------------"
- : "#init"
- set "COMMANDS" to 32000
- set "MZX_SPEED" to 2
- load char set "@256mario.chr"
- load char set "@512mario2.chr"
- . "Put mario layers in the vlayer"
- set "layer" to 0
- : "layerloop"
- set "clayer" to 0
- : "clayerloop"
- set "layeroffset" to "('layer'*2)"
- set "vx" to "('clayer'/2)"
- set "vy" to "('clayer'a1+'layeroffset')"
- set "vch&vx&,&vy&" to "('layer'*16+'clayer')"
- set "vco&vx&,&vy&" to "('layer'+1)"
- inc "clayer" by 1
- if "clayer" != 16 then "clayerloop"
- inc "layer" by 1
- if "layer" != 9 then "layerloop"
- set "sprnum" to 10
- : "spritemake"
- set "spr&sprnum&_refx" to 0
- set "spr&sprnum&_refy" to "('sprnum'-10*2)"
- set "spr&sprnum&_width" to 2
- set "spr&sprnum&_height" to 2
- set "spr&sprnum&_vlayer" to 1
- set "spr&sprnum&_unbound" to 1
- set "spr&sprnum&_offset" to 256
- put c?? Sprite "sprnum" at 50 50
- inc "sprnum" by 1
- if "sprnum" != 19 then "spritemake"
- . "get scrolling background ready"
- set "local1" to 80
- set "local2" to 0
- : "fillvlayer1"
- set "vco&local1&,&local2&" to 0
- set "vch&local1&,&local2&" to 219
- inc "local1" by 1
- if "local1" != 160 then "fillvlayer1"
- set "local1" to 80
- inc "local2" by 1
- if "local2" != 25 then "fillvlayer2"
- set "spr0_refx" to 80
- set "spr0_refy" to 0
- set "spr0_width" to 80
- set "spr0_height" to 25
- set "spr0_unbound" to 1
- set "spr0_vlayer" to 1
- set "spr0_tcol" to 1
- put c?? Sprite p00 at 0 0
- set "spr1_refx" to 0
- set "spr1_refy" to 0
- set "spr1_width" to 81
- set "spr1_height" to 25
- set "spr1_unbound" to 1
- put c?? Sprite p01 at 0 0
- goto "#return"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement