Mario Maker Scrolling Platformer #Games #All

Instructions: Unfinished\nPLEASE READ\nthis is a remix please go to the original\n\nIf the project is slow:\nhttps://turbowarp.org/511986782\n===============Instructions==================\n\nAWSD or arrows keys to move player\n\nPress 0 to change editor mode\nPress 1-4 to choose the block, press again to switch blocks\nPress 9 to spawn Goomba or life \nPress E to select block where mouse points\nPress L to select level\nPress R to restart level\n\n\n=============Notes and Credits==============\n Sprites are from Super Mario Advance 4 (SMB 3)\n\nCredits to @griffpatch_tutor for tutorials\n\nPlease follow the @griffpatch_tutor he is an amazing person\n\nUpdate:\n\nenemies added:19/04/2021\nbug fix "jetpack goomba" 04/05/2021\nmushroom life,animation mistery block 19/05/2021\n\n\n#Games #All #Games #All #Games #All #Games #All #Games #All #Games #All #Games #All #Games #All\n#Games #All #Games #All #Games #All #Games #All #Games #All #Games #All #Games #All #Games #All\n\n\n\n\n\n26/04/2021: WOW 626 VIEWS THANKS :D\n28/04/2021: 1312 views,35 love and 25 favorite    OMG !!!!!!!\n30/04/2021:2296 views its not possible\n03/05/2021: 3053 views :D \n04/05/2021: 3410 view and 83 love 63 favorites \n06/05/2021 : 4107 views \n19/05/2021 7390 views (10k pls) and 154 love,111 favorite (thanks :D)\n

@Stage\n\n@Ator1\n\nwhen flag clicked\nwait (1) seconds\nshow\ngo to x: (0) y: (0)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nforever\n    go to [front v] layer\nend\n\n@Mario\n\nwhen flag clicked\nbroadcast (generate level v) and wait\nbroadcast (clone level tiles v) and wait\nbroadcast (LEVEL - Start Game Loop - Respawn v) and wait\n\ndefine move camera\nset [camera x v] to (x)\nchange [camera y v] by (((y) - (CAMERA Y)) / (4))\nif <(EDITOR) > [0]> then\n    limit camera edge x: [240] edge y: [180]\nelse\n    limit camera edge x: [272] edge y: [180]\nend\n\ndefine reset player\nset [-tiny v] to [-0.000001]\nif <(spawn index) > [0]> then\n    set [x v] to ([floor v] of (((spawn index) - (1)) / (GRID HEIGHT)) )\n    set [y v] to (((spawn index) - (1)) mod (GRID HEIGHT))\nelse\n    set [x v] to [3]\n    set [y v] to [3]\nend\nset [x v] to (((x) * (32)) + (16))\nset [y v] to (((y) * (32)) + (height))\nset [width v] to [8]\nset [height v] to [24]\nset [camera x v] to (x)\nset [camera y v] to (y)\nset [jumping v] to [99]\nset [falling v] to [99]\nset [speed x v] to [0]\nset [speed y v] to [0]\npoint in direction (90)\nmove camera\n\ndefine game loop\nset [coins v] to [0]\nforever\n    broadcast (check controls v)\n    broadcast (move player v)\n    broadcast (move enemy v)\n    broadcast (move player after enemy v)\n    broadcast (position tiles v)\nend\n\nwhen I receive [move player v]\nset [bump index v] to []\nif <(EDITOR) > [0]> then\n    handle - God Mode\nelse\n    if <<(falling) > [2]> and <(speed y) < [-1]>> then\n        set [bop y v] to (y)\n    else\n        set [bop y v] to []\n    end\n    handle keys - left right\n    handle keys - jump\n    move sprite x\n    move sprite y\n    check around player\nend\npaint sprite \n\ndefine get tile at x: (x) y: (y)\nset [tile grid x v] to ([floor v] of ((x) / (32)) )\nset [tile grid y v] to ([floor v] of ((y) / (32)) )\nset [tile index v] to (((1) + (tile grid y)) + ((tile grid x) * (GRID HEIGHT)))\nif <(tile grid y) < [0]> then\n    set [tile v] to []\nelse\n    set [tile v] to (item (tile index) of [tile grid v])\nend\nset [tile shape v] to (item (tile) of [tile shape v])\n\ndefine fix collision in direction dx: (dx) dy: (dy)\nset [fix dx v] to (dx)\nset [fix dy v] to (dy)\nset [solid v] to []\nfix collision at point x: ((x) - (width)) y: ((y) - (height)) part: [feet]\nfix collision at point x: ((x) - (width)) y: (y) part: []\nfix collision at point x: ((x) - (width)) y: ((y) + (height)) part: []\nfix collision at point x: ((x) + ((width) + (-TINY))) y: ((y) - (height)) part: [feet]\nfix collision at point x: ((x) + ((width) + (-TINY))) y: (y) part: []\nfix collision at point x: ((x) + ((width) + (-TINY))) y: ((y) + (height)) part: []\n\ndefine fix collision at point x: (x) y: (y) part: (part)\nget tile at x: (x) y: (y)\nif <(tile shape) = []> then\n    stop [this script v]\nend\nset [mod x v] to ((x) mod (32))\nset [mod y v] to ((y) mod (32))\nif <(tile shape) = [=]> then\n    if <<not <(part) = [feet]>> or <((mod y) - (fix dy)) < [32]>> then\n        stop [this script v]\n    end\n    if <([down v] of [controls v]) > [0]> then\n        stop [this script v]\n    end\nend\nset [solid v] to [10]\nif <(fix dy) < [0]> then\n    change [y v] by ((32) - (mod y))\nend\nif <(fix dx) < [0]> then\n    change [x v] by ((32) - (mod x))\nend\nif <(fix dy) > [0]> then\n    change [y v] by ((-TINY) - (mod y))\nend\nif <(fix dx) > [0]> then\n    change [x v] by ((-TINY) - (mod x))\nend\n\ndefine handle keys - left right\nset [player action v] to [walk]\nset [key walk v] to ([x axis v] of [controls v])\nif <(KEY WALK) = [0]> then\n    if <(falling) < [2]> then\n        if <(speed x) > [0.4]> then\n            change [speed x v] by (-0.4)\n        else\n            if <(speed x) < [-0.4]> then\n                change [speed x v] by (0.4)\n            else\n                set [speed x v] to [0]\n                set [player frame v] to [0]\n            end\n        end\n    end\nelse\n    point in direction ((90) * (KEY WALK))\n    if <((KEY WALK) * (speed x)) < [10]> then\n        if <((KEY WALK) * (speed x)) < [0]> then\n            change [speed x v] by ((KEY WALK) * (0.8))\n            if <(falling) < [2]> then\n                set [player action v] to [turn]\n                make skid smoke\n            end\n        else\n            change [speed x v] by ((KEY WALK) * (0.4))\n        end\n    end\nend\nset [temp v] to (([abs v] of (speed x) ) / (19))\nif <(temp) < [0.2]> then\n    set [temp v] to [0.2]\nend\nchange [player frame v] by (temp)\n\ndefine handle keys - jump\nchange [speed y v] by (-2)\nif <(speed y) < [-22]> then\n    set [speed y v] to [-22]\nend\nif <([up v] of [controls v]) > [0]> then\n    if <<(falling) < [2]> or <(jumping) > [0]>> then\n        change [jumping v] by (1)\n        if <(jumping) < [11]> then\n            set [speed y v] to [13]\n        end\n    end\nelse\n    set [jumping v] to [0]\nend\n\ndefine move sprite x\nchange [x v] by (speed x)\nfix collision in direction dx: (speed x) dy: [0]\nif <(solid) > [0]> then\n    set [speed x v] to [0]\nend\n\ndefine move sprite y\nchange [y v] by (speed y)\nchange [falling v] by (1)\nfix collision in direction dx: [0] dy: (speed y)\nif <(solid) > [0]> then\n    if <(speed y) < [0]> then\n        set [falling v] to [0]\n    else\n        set [jumping v] to [99]\n        Bump head\n    end\n    set [speed y v] to [0]\nend\n\ndefine paint sprite \ngo to x: ((x) - (CAMERA X)) y: ((y) - (CAMERA Y))\nif <(falling) > [1]> then\n    if <(speed y) > [0]> then\n        switch costume to (mariojump v)\n    else\n        switch costume to (mariowalk3 v)\n    end\n    stop [this script v]\nend\nif <(player action) = [turn]> then\n    switch costume to (marioturn v)\n    stop [this script v]\nend\nswitch costume to ((1) + (([floor v] of (player frame) ) mod (4)))\n\ndefine make skid smoke\nchange [player frame v] by (1)\nif <((player frame) mod (3)) < [1]> then\n    add [smoke] to [particles v]\n    add (x) to [particles v]\n    add ((y) - (20)) to [particles v]\nend\n\ndefine handle - God Mode\nchange [speed x v] by ((6) * ([x axis v] of [controls v]))\nchange [speed y v] by ((6) * ([y axis v] of [controls v]))\nset [speed x v] to ((0.7) * (speed x))\nset [speed y v] to ((0.7) * (speed y))\nchange [x v] by (speed x)\nchange [y v] by (speed y)\n\ndefine check around player\nif <(y) < [0]> then\n    reset player\nend\ncheck around player at x: (x) y: ((y) - (16))\ncheck around player at x: (x) y: ((y) + (16))\n\ndefine limit camera edge x: (edge x) edge y: (edge y)\nif <(CAMERA X) < (edge x)> then\n    set [camera x v] to (edge x)\nend\nif <(CAMERA Y) < (edge y)> then\n    set [camera y v] to (edge y)\nend\nif <(CAMERA X) > (((32) * (GRID WIDTH)) - (edge x))> then\n    set [camera x v] to (((32) * (GRID WIDTH)) - (edge x))\nend\nif <(CAMERA Y) > (((32) * (GRID HEIGHT)) - (edge y))> then\n    set [camera y v] to (((32) * (GRID HEIGHT)) - (edge y))\nend\n\nwhen I receive [level - stop!! v]\nstop [other scripts in sprite v]\n\nwhen I receive [level - start game loop v]\ngame loop\n\ndefine check around player at x: (x) y: (y)\nget tile at x: (x) y: (y)\nif <(tile) = [24]> then\n    replace item (tile index) of [tile grid v] with [2]\n    change [coins v] by (1)\n    start sound [Coin v]\nend\n\nwhen I receive [level - start game loop - respawn v]\nreset player\ngame loop\n\nwhen I receive [level - done loading... v]\nset [spawn index v] to (item # of [28] in [tile grid v])\nif <(EDITOR) < [1]> then\n    replace item (spawn index) of [tile grid v] with [2]\nend\n\nwhen I receive [move player after enemy v]\nif <(BOUNCE PLAYER) > [0]> then\n    change [bounce player v] by (-1)\n    set [speed y v] to [13]\n    set [falling v] to [2]\n    set [jumping v] to [1]\nend\nmove camera\npaint sprite \n\ndefine Bump head\nget tile at x: (x) y: ((y) + ((height) + (8)))\nif <(tile) = [20]> then\n    set [bump index v] to (tile index)\nend\n\n@Tiles\n\ndefine setup\nshow\nset [tile index v] to [1]\nset [tiles: tile x v] to [16]\nrepeat (CLONE COUNT X)\n    set [tiles: tile y v] to [16]\n    repeat (CLONE COUNT Y)\n        create clone of (_myself_ v)\n        change [tiles: tile y v] by (32)\n        change [tile index v] by (1)\n    end\n    change [tiles: tile x v] by (32)\n    change [tile index v] by ((GRID HEIGHT) - (CLONE COUNT Y))\nend\nhide\nset [tile index v] to []\n\nwhen I receive [position tiles v]\nif <(tile index) = []> then\n    editor brush\nelse\n    if <([abs v] of ((Tiles: tile x) - (CAMERA X)) ) > ((CLONE COUNT X) * (16))> then\n        if <(Tiles: tile x) < (CAMERA X)> then\n            loop tile x (CLONE COUNT X)\n        else\n            loop tile x ((0) - (CLONE COUNT X))\n        end\n    end\n    if <([abs v] of ((Tiles: tile y) - (CAMERA Y)) ) > ((CLONE COUNT Y) * (16))> then\n        if <(Tiles: tile y) < (CAMERA Y)> then\n            loop tile y (CLONE COUNT Y)\n        else\n            loop tile y ((0) - (CLONE COUNT Y))\n        end\n    end\n    set [tile v] to (item (tile index) of [tile grid v])\nend\nswitch costume to (big v)\ngo to x: ((Tiles: tile x) - (CAMERA X)) y: ((Tiles: tile y) - (CAMERA Y))\nif <(tile) < [2]> then\n    set [tile v] to [2]\nelse\n    if <<(tile) = [20]> or <(tile) = [24]>> then\n        change [tile v] by (([floor v] of ((timer) * (8)) ) mod (4))\n        if <(EDITOR) < [1]> then\n            if <(BUMP INDEX) = (tile index)> then\n                replace item (tile index) of [tile grid v] with [9]\n                set [bumped v] to [180]\n                if <(item # of (tile index) in [object idx v]) = [0]> then\n                    add [coin] to [particles v]\n                    add (Tiles: tile x) to [particles v]\n                    add ((Tiles: tile y) + (32)) to [particles v]\n                end\n            end\n        end\n    end\nend\nif <(bumped) > [0]> then\n    change [bumped v] by (-30)\n    change y by ((24) * ([sin v] of (bumped) ))\nend\nswitch costume to (tile)\n\ndefine loop tile x (tile skip)\nchange [tiles: tile x v] by ((tile skip) * (32))\nchange [tile index v] by ((tile skip) * (GRID HEIGHT))\n\ndefine loop tile y (tile skip)\nchange [tiles: tile y v] by ((tile skip) * (32))\nchange [tile index v] by (tile skip)\n\nwhen I receive [clone level tiles v]\nset size to (200) %\nset [clone count x v] to [16]\nset [clone count y v] to [13]\nsetup\n\ndefine editor brush\nif <<(EDITOR) < [1]> or <mouse down?>> then\n    hide\n    stop [this script v]\nend\nset [tiles: tile x v] to (((32) * ([tile grid x v] of [editor v])) + (16))\nset [tiles: tile y v] to (((32) * ([tile grid y v] of [editor v])) + (16))\nset [tile v] to ([chosen brush v] of [editor v])\nset [ghost v] effect to (50)\nshow\n\nwhen I receive [level - done loading... v]\nif <(tile index) > []> then\n    set [tile index v] to ((1) + ([floor v] of ((Tiles: tile y) / (32)) ))\n    change [tile index v] by ((GRID HEIGHT) * ([floor v] of ((Tiles: tile x) / (32)) ))\nend\n\n@Editor\n\ndefine generate level\ndelete all of [tile grid v]\nadd wall column\nrepeat ((GRID WIDTH) - (2))\n    add boxed column\nend\nadd wall column\n\ndefine add wall column\nrepeat (GRID HEIGHT)\n    add [10] to [tile grid v]\nend\n\ndefine add boxed column\nadd [7] to [tile grid v]\nrepeat ((GRID HEIGHT) - (2))\n    add [2] to [tile grid v]\nend\nadd [10] to [tile grid v]\n\nwhen I receive [generate level v]\nset [editor v] to [0]\nset [level # v] to [1]\ndelete all of [tile grid v]\ndelete all of [object idx v]\ndelete all of [object type v]\nbroadcast (LEVEL - Load v) and wait\nset [brush v] to [0]\nset [chosen brush v] to [10]\nif <(length of [tile grid v]) = [0]> then\n    set [grid width v] to [100]\n    set [grid height v] to [40]\n    generate level\nend\n\nwhen I receive [move player v]\nif <(EDITOR) < [1]> then\n    stop [this script v]\nend\nget tile at x: ((mouse x) + (CAMERA X)) y: ((mouse y) + (CAMERA Y))\nif <not <mouse down?>> then\n    set [brush v] to [0]\n    stop [this script v]\nend\nif <(item (chosen brush) of [tile keymap v]) = [9]> then\n    Paint Enemy\n    stop [this script v]\nend\nif <(brush) = [0]> then\n    if <(tile) = (chosen brush)> then\n        set [brush v] to [2]\n    else\n        set [brush v] to (chosen brush)\n    end\nend\nif <(brush) = [28]> then\n    set [found index v] to (item # of (brush) in [tile grid v])\n    replace item (found index) of [tile grid v] with [2]\nend\nreplace item (tile index) of [tile grid v] with (brush)\n\ndefine get tile at x: (x) y: (y)\nset [tile grid x v] to ([floor v] of ((x) / (32)) )\nset [tile grid y v] to ([floor v] of ((y) / (32)) )\nset [tile index v] to (((1) + (tile grid y)) + ((tile grid x) * (GRID HEIGHT)))\nset [tile v] to (item (tile index) of [tile grid v])\n\nwhen [1 v] key pressed\nnext brush [1]\n\nwhen [2 v] key pressed\nnext brush [2]\n\nwhen [0 v] key pressed\nif <(EDITOR) > [0]> then\n    broadcast (LEVEL - STOP!! v) and wait\n    broadcast (LEVEL - Save v) and wait\n    set [editor v] to [0]\n    hide variable [level # v]\n    broadcast (LEVEL - Done Loading... v) and wait\n    broadcast (LEVEL - Start Game Loop v)\nelse\n    broadcast (LEVEL - STOP!! v) and wait\n    set [editor v] to [1]\n    show variable [level # v]\n    broadcast (LEVEL - Load v) and wait\n    broadcast (LEVEL - Start Game Loop v)\nend\n\ndefine next brush (key)\nrepeat (length of [tile keymap v])\n    if <(chosen brush) < (length of [tile keymap v])> then\n        change [chosen brush v] by (1)\n    else\n        set [chosen brush v] to [1]\n    end\n    if <(item (chosen brush) of [tile keymap v]) = (key)> then\n        stop [this script v]\n    end\nend\n\nwhen [3 v] key pressed\nnext brush [3]\n\nwhen [4 v] key pressed\nnext brush [4]\n\nwhen [e v] key pressed\nset [chosen brush v] to (tile)\n\nwhen [l v] key pressed\nif <(EDITOR) < [1]> then\n    stop [this script v]\nend\nask (join [Enter Level Number \(Current ] (join (LEVEL #) [\)])) and wait\nif <(round (answer)) < [1]> then\n    stop [this script v]\nend\nbroadcast (LEVEL - STOP!! v) and wait\nbroadcast (LEVEL - Save v) and wait\nset [level # v] to (round (answer))\nbroadcast (LEVEL - Load v) and wait\nbroadcast (LEVEL - Start Game Loop - Respawn v)\n\nwhen [r v] key pressed\nif <(EDITOR) < [1]> then\n    stop [this script v]\nend\nask [Reset Level - Are you sure?? \[Y\]\[N\]] and wait\nif <not <(answer) = [Y]>> then\n    stop [this script v]\nend\nbroadcast (LEVEL - STOP!! v) and wait\nask (join [Enter Level Width \(Current ] (join (GRID WIDTH) [\)])) and wait\nif <not <(answer) = []>> then\n    set [grid width v] to (answer)\nend\nask (join [Enter Level Height \(Current ] (join (GRID HEIGHT) [\)])) and wait\nif <not <(answer) = []>> then\n    set [grid height v] to (answer)\nend\ngenerate level\nbroadcast (LEVEL - Done Loading... v) and wait\nbroadcast (LEVEL - Start Game Loop - Respawn v)\n\nwhen [9 v] key pressed\nnext brush [9]\n\ndefine Paint Enemy\nif <(brush) > [0]> then\n    stop [this script v]\nend\nset [brush v] to (chosen brush)\nset [found index v] to (item # of (tile index) in [object idx v])\nif <(found index) > [0]> then\n    delete (found index) of [object idx v]\n    delete (found index) of [object type v]\nelse\n    add (tile index) to [object idx v]\n    add (brush) to [object type v]\nend\nbroadcast (ENTITY - clear v)\nbroadcast (ENTITY - setup v)\n\n@Enemy\n\ndefine get tile at x: (x) y: (y)\nset [tile grid x v] to ([floor v] of ((x) / (32)) )\nset [tile grid y v] to ([floor v] of ((y) / (32)) )\nset [tile index v] to (((1) + (tile grid y)) + ((tile grid x) * (GRID HEIGHT)))\nif <(tile grid y) < [0]> then\n    set [tile v] to []\nelse\n    set [tile v] to (item (tile index) of [tile grid v])\nend\nset [tile shape v] to (item (tile) of [tile shape v])\n\ndefine fix collision at point x: (x) y: (y) part: (part)\nget tile at x: (x) y: (y)\nif <(tile shape) = []> then\n    stop [this script v]\nend\nset [mod x v] to ((x) mod (32))\nset [mod y v] to ((y) mod (32))\nif <(tile shape) = [=]> then\n    if <<not <(part) = [feet]>> or <((mod y) - (fix dy)) < [32]>> then\n        stop [this script v]\n    end\nend\nset [solid v] to [10]\nif <(fix dy) < [0]> then\n    change [y v] by ((32) - (mod y))\nend\nif <(fix dx) < [0]> then\n    change [x v] by ((32) - (mod x))\nend\nif <(fix dy) > [0]> then\n    change [y v] by ((-TINY) - (mod y))\nend\nif <(fix dx) > [0]> then\n    change [x v] by ((-TINY) - (mod x))\nend\n\ndefine fix collision in direction dx: (dx) dy: (dy)\nset [fix dx v] to (dx)\nset [fix dy v] to (dy)\nset [solid v] to []\nfix collision at point x: ((x) - (width)) y: ((y) - (height)) part: [feet]\nfix collision at point x: ((x) - (width)) y: (y) part: []\nfix collision at point x: ((x) - (width)) y: ((y) + (height)) part: []\nfix collision at point x: ((x) + ((width) + (-TINY))) y: ((y) - (height)) part: [feet]\nfix collision at point x: ((x) + ((width) + (-TINY))) y: (y) part: []\nfix collision at point x: ((x) + ((width) + (-TINY))) y: ((y) + (height)) part: []\n\ndefine move sprite x\nchange [x v] by (speed x)\nfix collision in direction dx: (speed x) dy: [0]\nif <(solid) > [0]> then\n    set [speed x v] to [0]\n    turn right (180) degrees\nend\n\ndefine move sprite y\nchange [y v] by (speed y)\nchange [falling v] by (1)\nfix collision in direction dx: [0] dy: (speed y)\nif <(solid) > [0]> then\n    if <(speed y) < [0]> then\n        set [falling v] to [0]\n    else\n        set [jumping v] to [99]\n    end\n    set [speed y v] to [0]\nend\n\nwhen flag clicked\nset size to (200) %\nhide\nset [type v] to []\nset [speed x v] to [0]\nset [speed y v] to [0]\n\ndefine paint sprite\nswitch costume to (big v)\ngo to x: ((x) - (CAMERA X)) y: ((y) - (CAMERA Y))\nswitch costume to (costume)\n\nwhen I receive [position tiles v]\nif <(type) > []> then\n    paint sprite\nend\n\nwhen [g v] key pressed\nif <(type) = []> then\n    set [spawn index v] to ([tile index v] of [editor v])\n    spawn type [29]\nend\n\nwhen I receive [move enemy v]\nif <<(EDITOR) > [0]> or <(type) = []>> then\n    stop [this script v]\nend\nif <(type) = [flip]> then\n    change [x v] by (speed x)\n    change [speed y v] by (-1)\n    change [y v] by (speed y)\n    if <(y) < ((CAMERA Y) - (200))> then\n        delete this clone\n    end\n    stop [this script v]\nend\nif <(type) = [squish]> then\n    change [frame v] by (1)\n    if <(frame) > [10]> then\n        delete this clone\n    end\nend\nif <(frame) < [0]> then\n    if <(frame) = [-1]> then\n        if <(BUMP INDEX) = (spawn index)> then\n            set [frame v] to [0]\n            point in direction ([direction v] of [mario v])\n            go to [back v] layer\n            go [forward v] (LAYERS - BACKGROUND) layers\n        end\n        stop [this script v]\n    end\n    if <([abs v] of ((x) - (CAMERA X)) ) > [260]> then\n        stop [this script v]\n    end\n    if <([abs v] of ((y) - (CAMERA Y)) ) > [200]> then\n        stop [this script v]\n    end\n    if <(x) > ([x v] of [mario v])> then\n        point in direction (-90)\n    else\n        point in direction (90)\n    end\nend\nif <(type) = [Goomba]> then\n    tick goomba\n    stop [this script v]\nend\nif <(type) = [Life]> then\n    Tick Life\n    stop [this script v]\nend\n\ndefine tick goomba\nchange [speed y v] by (-1)\nmove sprite y\nif <(direction) > [0]> then\n    if <(speed x) < [1]> then\n        change [speed x v] by (0.1)\n    end\nelse\n    if <(speed x) > [-1]> then\n        change [speed x v] by (-0.1)\n    end\nend\nmove sprite x\nchange [frame v] by (0.25)\nset [costume v] to ((2) + ([floor v] of ((frame) mod (2)) ))\npaint sprite\nif <touching (mario v)?> then\n    if <([bop y v] of [mario v]) > []> then\n        point in direction (90)\n        set [frame v] to [0]\n        set [type v] to [squish]\n        set [costume v] to [Goomba Squish]\n        set [bounce player v] to [5]\n    end\nend\nCheck Flip\n\ndefine spawn type (tile type)\nset [frame v] to []\nif <(tile type) = [29]> then\n    Set Type [Goomba] costume [2] widht [14] height [14]\nend\nif <(tile type) = [30]> then\n    set [frame v] to [-1]\n    Set Type [Life] costume [Life] widht [16] height [16]\nend\n\nwhen I receive [level - done loading... v]\nbroadcast (ENTITY - clear v)\nbroadcast (ENTITY - setup v)\n\nwhen I receive [entity - clear v]\ndelete this clone\n\nwhen I receive [entity - setup v]\nSpawn Loop\n\ndefine Spawn Loop\nset [object item # v] to [1]\nrepeat (length of [object idx v])\n    set [spawn index v] to (item (object item #) of [object idx v])\n    spawn type (item (object item #) of [object type v])\n    hide\n    change [object item # v] by (1)\nend\nset [object item # v] to []\nset [type v] to []\n\ndefine Set Type (type) costume (costume) widht (widht) height (height)\nset [type v] to (type)\nset [costume v] to (costume)\nset [width v] to (widht)\nset [height v] to (height)\nset [x v] to ([floor v] of (((spawn index) - (1)) / (GRID HEIGHT)) )\nset [y v] to (((spawn index) - (1)) mod (GRID HEIGHT))\nset [x v] to (((x) * (32)) + (16))\nset [y v] to (((y) * (32)) + (height))\npoint in direction ([direction v] of [mario v])\npaint sprite\nif <<(EDITOR) > [0]> or <(frame) = []>> then\n    show\nend\ncreate clone of (_myself_ v)\n\ndefine Tick Life\nchange [frame v] by (1)\nif <(frame) < [16]> then\n    stop [this script v]\nend\nif <(frame) < [48]> then\n    show\n    change [y v] by (1)\nelse\n    if <touching (mario v)?> then\n        delete this clone\n    end\nend\n\ndefine Check Flip\nif <(BUMP INDEX) < [1]> then\n    stop [this script v]\nend\nget tile at x: ((x) - (width)) y: (((y) - (height)) - (8))\nif <not <(tile index) = (BUMP INDEX)>> then\n    get tile at x: ((x) + (width)) y: (((y) - (height)) - (8))\n    if <not <(tile index) = (BUMP INDEX)>> then\n        stop [this script v]\n    end\nend\nset [speed y v] to [14]\nset [speed x v] to (([direction v] of [mario v]) / (45))\nset [type v] to [flip]\nset rotation style [all around v]\npoint in direction (-90)\n\n@particles\n\nwhen flag clicked\ndelete all of [particles v]\nset [frame v] to []\nset size to (200) %\nhide\n\nwhen I start as a clone\nset [frame v] to [1]\nif <(type) = [coin]> then\n    set [speed y v] to [12]\nend\n\nwhen I receive [position tiles v]\nif <(frame) = []> then\n    Spawn Particles\n    stop [this script v]\nend\nif <(type) = [coin]> then\n    Tick-Coin\n    stop [this script v]\nend\nTick-Smoke\n\ndefine Tick-Smoke\nif <not <(frame) < [3]>> then\n    delete this clone\nend\nPosition With Costume ([floor v] of (frame) )\nchange [frame v] by (0.4)\n\ndefine Spawn Particles\nrepeat until <(length of [particles v]) = [0]>\n    set [type v] to (item (1) of [particles v])\n    set [x v] to (item (2) of [particles v])\n    set [y v] to (item (3) of [particles v])\n    create clone of (_myself_ v)\n    repeat (3)\n        delete (1) of [particles v]\n    end\nend\n\ndefine Tick-Coin\nchange [speed y v] by (-1)\nif <(speed y) < [-12]> then\n    delete this clone\nend\nchange [y v] by (speed y)\nPosition With Costume ((3) + (([floor v] of (frame) ) mod (4)))\nchange [frame v] by (0.5)\n\ndefine Position With Costume (costume)\nswitch costume to (big v)\ngo to x: ((x) - (CAMERA X)) y: ((y) - (CAMERA Y))\nswitch costume to (costume)\nshow\n\n@Controls\n\nwhen I receive [check controls v]\nset [left v] to <<key (left arrow v) pressed?> or <key (a v) pressed?>>\nset [right v] to <<key (right arrow v) pressed?> or <key (d v) pressed?>>\nset [up v] to <<key (up arrow v) pressed?> or <key (w v) pressed?>>\nset [down v] to <<key (down arrow v) pressed?> or <key (s v) pressed?>>\nset [x axis v] to ((right) - (left))\nset [y axis v] to ((up) - (down))\n\n@Level Store\n\ndefine write value (value) delimiter (letter)\nset [encoded v] to (join (encoded) (join (value) (letter)))\n\ndefine save level (level #)\nset [encoded v] to []\nwrite value [1] delimiter [_]\nSave - Tile Grid\nSave - Objects\nrepeat ((level #) - (length of [level store v]))\n    add [] to [level store v]\nend\nreplace item (level #) of [level store v] with (encoded)\n\ndefine load level (level #)\nset [encoded v] to (item (level #) of [level store v])\nset [read index v] to [1]\nread value\nif <not <(value) = [1]>> then\n    stop [this script v]\nend\nLoad - Tile Grid\nLoad - Objects\n\ndefine read letter\nset [letter v] to (letter (read index) of (encoded))\nchange [read index v] by (1)\n\ndefine read value\nset [value v] to []\nread letter\nrepeat until <<(letter) > [9]> or <(letter) = []>>\n    set [value v] to (join (value) (letter))\n    read letter\nend\n\nwhen I receive [level - save v]\nsave level (LEVEL #)\n\nwhen I receive [level - load v]\nload level (LEVEL #)\nbroadcast (LEVEL - Done Loading... v) and wait\n\ndefine Save - Tile Grid\nwrite value (GRID WIDTH) delimiter [_]\nwrite value (GRID HEIGHT) delimiter [_]\nset [tile index v] to [1]\nset [tile v] to (item (tile index) of [tile grid v])\nset [length v] to [0]\nrepeat (GRID HEIGHT)\n    repeat (GRID WIDTH)\n        if <<(length) < [26]> and <(tile) = (item (tile index) of [tile grid v])>> then\n            change [length v] by (1)\n        else\n            if <(tile) = [2]> then\n                set [tile v] to []\n            end\n            write value (tile) delimiter (item (length) of [a to z v])\n            set [tile v] to (item (tile index) of [tile grid v])\n            set [length v] to [1]\n        end\n        change [tile index v] by (GRID HEIGHT)\n    end\n    change [tile index v] by ((1) - ((GRID WIDTH) * (GRID HEIGHT)))\nend\nwrite value (tile) delimiter (item (length) of [a to z v])\n\ndefine Load - Tile Grid\ndelete all of [tile grid v]\nread value\nset [grid width v] to (value)\nread value\nset [grid height v] to (value)\nrepeat ((GRID WIDTH) * (GRID HEIGHT))\n    add [] to [tile grid v]\nend\nset [tile index v] to [1]\nrepeat until <(read index) > (length of (encoded))>\n    read value\n    if <(value) = []> then\n        set [value v] to [2]\n    end\n    repeat (item # of (letter) in [a to z v])\n        replace item (tile index) of [tile grid v] with (value)\n        change [tile index v] by (GRID HEIGHT)\n        if <(tile index) > ((GRID WIDTH) * (GRID HEIGHT))> then\n            change [tile index v] by ((1) - ((GRID WIDTH) * (GRID HEIGHT)))\n            if <(tile index) > (GRID HEIGHT)> then\n                stop [this script v]\n            end\n        end\n    end\nend\n\ndefine Save - Objects\nset [row v] to [1]\nwrite value (length of [object idx v]) delimiter [_]\nrepeat (length of [object idx v])\n    write value (item (row) of [object idx v]) delimiter [_]\n    write value (item (row) of [object type v]) delimiter [_]\n    change [row v] by (1)\nend\n\ndefine Load - Objects\ndelete all of [object idx v]\ndelete all of [object type v]\nread value\nrepeat (value)\n    read value\n    add (value) to [object idx v]\n    read value\n    add (value) to [object type v]\nend\n\n