2d Galaxy Style Platformer v0.15


@Stage\n\nwhen flag clicked\nerase all\nbroadcast (zoomout v)\n\nset [level v] to [1]\nbroadcast (game v)\n\nwhen flag clicked\nset [paused? v] to [0]\n\nset [lives v] to [0]\n\n@game\n\ndefine point A (ax) (ay) point B (bx) (by) handles (hx) (hy) (hx) (hy)\ncalculate position ((ax) + (((hx) - (ax)) * ((#) / (item (8) of [launch star v])))) ((ay) + (((hy) - (ay)) * ((#) / (item (8) of [launch star v])))) ((hx) + (((hx) - (hx)) * ((#) / (item (8) of [launch star v])))) ((hy) + (((hy) - (hy)) * ((#) / (item (8) of [launch star v])))) ((hx) + (((bx) - (hx)) * ((#) / (item (8) of [launch star v])))) ((hy) + (((by) - (hy)) * ((#) / (item (8) of [launch star v]))))\n\ndefine calculate position (x1) (y1) (x2) (y2) (x3) (y3)\ncalculate position ((x1) + (((x2) - (x1)) * ((#) / (item (8) of [launch star v])))) ((y1) + (((y2) - (y1)) * ((#) / (item (8) of [launch star v])))) ((x2) + (((x3) - (x2)) * ((#) / (item (8) of [launch star v])))) ((y2) + (((y3) - (y2)) * ((#) / (item (8) of [launch star v]))))\n\ndefine calculate position (x1) (y1) (x2) (y2)\nset [charxvel v] to (((x1) + (((x2) - (x1)) * ((#) / (item (8) of [launch star v])))) - (charX))\nset [charyvel v] to (((y1) + (((y2) - (y1)) * ((#) / (item (8) of [launch star v])))) - (charY))\n\ndefine move player:  L/R <left> <right> Jump/Crouch <jump> <crouch> Spin <spin>\nif <[-20] < (hit)> then\n    change [hit v] by (-1)\nelse\n    set [hit v] to [-20]\nend\nif <(black hole?) = [0]> then\n    if <(inair?) = [0]> then\n        if <not <(<right> - <left>) = [0]>> then\n            if <right> then\n                set [l/r? v] to [1]\n            end\n            if <left> then\n                set [l/r? v] to [-1]\n            end\n        end\n        if <(squashed?) = [0]> then\n            set [jumpt v] to [3]\n            set [onwall? v] to [0]\n            if <(hit) < [1]> then\n                change [charxvel v] by (((<right> - <left>) * (0.65)) * <not <crouch>>)\n                if <[7] < ([abs v] of (charXvel) )> then\n                    set [charxvel v] to ((charXvel) * (0.8))\n                else\n                    if <(<right> - <left>) = [0]> then\n                        set [charxvel v] to ((charXvel) * (0.8))\n                    else\n                        set [charxvel v] to ((charXvel) * (0.9))\n                    end\n                end\n            else\n                set [charxvel v] to ((charXvel) * (0.9))\n            end\n            set [charyvel v] to [0]\n            if <(hit) < [1]> then\n                if <crouch> then\n                    set [charxvel v] to ((charXvel) * (0.95))\n                    if <<([abs v] of (charXvel) ) < [3]> and <(<right> - <left>) = [0]>> then\n                        if <jump> then\n                            set [up? v] to [0]\n                            set [jumpt v] to [1]\n                            set [inair? v] to [1]\n                            set [charyvel v] to [14]\n                            set [charxvel v] to ((l/r?) * (-3))\n                            start sound (pick random (7) to (8))\n                            set [#2 v] to [10]\n                            set [down? v] to [1]\n                        end\n                    else\n                        if <jump> then\n                            set [up? v] to [0]\n                            set [jumpt v] to [2]\n                            set [inair? v] to [1]\n                            set [charyvel v] to [6.5]\n                            set [charxvel v] to (((charXvel) / ([abs v] of (charXvel) )) * (11))\n                            start sound (pick random (7) to (8))\n                            set [#2 v] to [10]\n                            set [down? v] to [1]\n                        end\n                    end\n                else\n                    if <((charXvel) / ([abs v] of (charXvel) )) = ((<right> - <left>) * (-1))> then\n                        if <jump> then\n                            set [up? v] to [0]\n                            set [jumpt v] to [1]\n                            set [inair? v] to [1]\n                            set [charyvel v] to [14]\n                            set [l/r? v] to ((<right> - <left>) * (-1))\n                            set [charxvel v] to (<right> - <left>)\n                            start sound (pick random (7) to (8))\n                            set [#2 v] to [10]\n                            set [down? v] to [1]\n                        end\n                    else\n                        if <jump> then\n                            set [up? v] to [0]\n                            set [jumpt v] to [0]\n                            set [inair? v] to [1]\n                            set [charyvel v] to [8]\n                            start sound (pick random (11) to (13))\n                            set [#2 v] to [10]\n                            set [down? v] to [1]\n                        end\n                    end\n                end\n            end\n        end\n    else\n        if <(squashed?) = [1]> then\n            set [charxvel v] to [0]\n            set [charyvel v] to [0]\n        else\n            if <(onwall?) = [0]> then\n                if <(hit) < [1]> then\n                    if <(jumpt) = [4]> then\n                        set [charxvel v] to [0]\n                        if <[0] < (#2)> then\n                            change [#2 v] by (-1)\n                        else\n                            set [charyvel v] to [-16]\n                        end\n                    else\n                        if <[0] < (#2)> then\n                            change [#2 v] by (-1)\n                        end\n                        if <not <crouch>> then\n                            set [down? v] to [0]\n                        end\n                        change [charxvel v] by ((<right> - <left>) * (0.2))\n                        if <((charXvel) / ([abs v] of (charXvel) )) = ((<right> - <left>) * (-1))> then\n                            set [charxvel v] to ((charXvel) * (0.9))\n                        else\n                            set [charxvel v] to ((charXvel) * (0.98))\n                        end\n                        if <(jumpt) = [2]> then\n                            change [charyvel v] by (-0.5)\n                        else\n                            if <(jumpt) = [3]> then\n                                if <[0] < (charYvel)> then\n                                    change [charyvel v] by (-0.3)\n                                else\n                                    change [charyvel v] by (-1)\n                                end\n                            else\n                                if <(jumpt) = [5]> then\n                                    if <[0] < (charYvel)> then\n                                        change [charyvel v] by (-0.3)\n                                    else\n                                        change [charyvel v] by (-1)\n                                    end\n                                else\n                                    if <[2] < (charYvel)> then\n                                        if <jump> then\n                                            change [charyvel v] by (-0.5)\n                                        else\n                                            change [charyvel v] by (-1)\n                                        end\n                                    else\n                                        change [charyvel v] by (-1)\n                                    end\n                                end\n                            end\n                        end\n                        set [charyvel v] to ((charYvel) * (0.96))\n                        if <[1] < (timer)> then\n                            if <(jumpt) = [5]> then\n                                set [jumpt v] to [3]\n                            end\n                            if <[1.3] < (timer)> then\n                                set [up? v] to [0]\n                            end\n                        end\n                        if <spin> then\n                            if <(launch star?) = [0]> then\n                                if <(up?) = [0]> then\n                                    reset timer\n                                    set [charxvel v] to ((charXvel) * (0.4))\n                                    set [jumpt v] to [5]\n                                    set [charyvel v] to [5]\n                                    set [up? v] to [1]\n                                    start sound (pick random (32) to (34))\n                                end\n                            else\n                                start sound (pick random (3) to (5))\n                            end\n                        end\n                        if <crouch> then\n                            if <not <<(jumpt) = [2]> or <(jumpt) = [3]>>> then\n                                if <<(#2) = [0]> and <(down?) = [0]>> then\n                                    set [#2 v] to [10]\n                                    set [charyvel v] to [0]\n                                    set [jumpt v] to [4]\n                                end\n                            end\n                        end\n                    end\n                else\n                    set [charxvel v] to ((charXvel) * (0.9))\n                    change [charyvel v] by (-1)\n                    set [charyvel v] to ((charYvel) * (0.96))\n                end\n            else\n                if <(hit) < [1]> then\n                    if <jump> then\n                        if <(up?) = [0]> then\n                            set [l/r? v] to ((onwall?) * (-1))\n                            set [charxvel v] to ((onwall?) * (-7))\n                            set [charyvel v] to [12]\n                            set [onwall? v] to [0]\n                            set [up? v] to [0]\n                            start sound (pick random (11) to (15))\n                            set [#2 v] to [8]\n                            set [down? v] to [1]\n                        end\n                    else\n                        set [up? v] to [0]\n                    end\n                    if <(<left> - <right>) = (onwall?)> then\n                        set [onwall? v] to [0]\n                    end\n                end\n                change [charyvel v] by (-0.5)\n                set [charyvel v] to ((charYvel) * (0.7))\n            end\n        end\n    end\nend\nset [ground? v] to [0]\nset [test# v] to [0]\n\ndefine collisions\nset [#5 v] to [0]\nrepeat (length of [level collisions v])\n    change [#5 v] by (1)\n    object (item (#5) of [level collisions v])\nend\n\nif <(level) = [1]> then\n\ncollisions dev level\n\nfloor [-100] [300] [0] []\nceiling [-100] [300] [200]\nwall [-130] [0] [-100] [200] [-1] [1]\nwall [300] [0] [330] [200] [1] [1]\n\nblack hole [-200] [0] [-300] [2]\nfloor [-50] [50] [0] []\nfloor [20] [280] [-20] []\nfloor [250] [330] [20] []\nfloor [330] [750] [0] []\nfloor [730] [850] [20] []\nfloor [850] [990] [60] []\nfloor [950] [1030] [100] []\nfloor [910] [990] [140] []\nfloor [790] [950] [160] []\nfloor [1030] [1110] [180] []\nfloor [1070] [1130] [220] []\nfloor [890] [1090] [240] []\nfloor [530] [930] [280] []\nfloor [750] [890] [440] []\nfloor [850] [1050] [480] []\nfloor [1030] [1150] [460] []\nfloor [1130] [2130] [440] []\nfloor [1250] [1430] [460] []\nfloor [1530] [1710] [460] []\nfloor [1810] [1990] [460] []\nfloor [2090] [2270] [460] []\nfloor [2210] [2350] [500] []\nfloor [2150] [2290] [540] []\nfloor [2230] [2330] [580] []\nfloor [450] [550] [540] []\nceiling [-50] [330] [-60]\nceiling [850] [990] [-80]\nceiling [450] [550] [220]\nceiling [750] [890] [380]\nceiling [880] [1050] [400]\nceiling [2100] [2270] [360]\nwall [-50] [-60] [-30] [0] [1] [1]\nwall [30] [-60] [50] [0] [-1] [1]\nwall [250] [-40] [270] [20] [1] [1]\nwall [310] [-60] [330] [20] [-1] [1]\nwall [730] [-60] [750] [20] [1] [1]\nwall [850] [-60] [870] [60] [1] [1]\nwall [850] [-80] [990] [60] [-1] [1]\nwall [530] [220] [550] [540] [-1] [1]\nwall [450] [220] [470] [540] [1] [1]\nwall [750] [380] [770] [440] [1] [1]\nwall [870] [380] [890] [440] [-1] [1]\nwall [850] [430] [900] [480] [1] [1]\nwall [1030] [430] [1050] [480] [-1] [1]\nwall [1130] [360] [1150] [460] [-1] [1]\nwall [1010] [360] [1030] [420] [1] [1]\nwall [1250] [420] [1270] [460] [1] [1]\nwall [1410] [420] [1430] [460] [-1] [1]\nwall [1530] [420] [1550] [460] [1] [1]\nwall [1690] [420] [1710] [460] [-1] [1]\nwall [1810] [420] [1830] [460] [1] [1]\nwall [1970] [420] [1990] [460] [-1] [1]\nwall [2090] [420] [2110] [460] [1] [1]\nwall [2250] [360] [2270] [460] [-1] [1]\n\nif <[120] < ((charX) + (8))> then\n    set [charx v] to [112]\n    if <<(inair?) = [1]> and <[7] < ([abs v] of (charXvel) )>> then\n        set [charxvel v] to ((([abs v] of (charXvel) ) / (charXvel)) * (-2))\n    else\n        if <(inair?) = [1]> then\n            set [onwall? v] to [1]\n            set [up? v] to [1]\n        else\n            set [onwall? v] to [0]\n        end\n        set [charxvel v] to [0]\n    end\nend\ngo to x: (121) y: (-180)\npen down\ngo to x: (121) y: (180)\npen up\n\ndefine ground (y)\nif <(charY) < (y)> then\n    set [chary v] to (y)\n    set [inair? v] to [0]\nend\nif <(charY) = (y)> then\n    set [ground? v] to [1]\nend\ngo to x: (-240) y: (((y) - (1)) - (camY))\npen down\ngo to x: (240) y: (((y) - (1)) - (camY))\npen up\n\ndefine floor (-x) (+x) (y) (moving?)\nchange [test# v] by (1)\nif <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n    if <(gravity) = [0]> then\n        if <(inair?) = [1]> then\n            if <(moving?) = [0]> then\n                if <not <(charY') < (y)>> then\n                    if <(charY) < (y)> then\n                        set [chary v] to (y)\n                        set [inair? v] to [0]\n                        set [ground? v] to [1]\n                    end\n                end\n            else\n                if <not <(charY') < ((y) - (moving?))>> then\n                    if <(charY) < ((y) - (moving?))> then\n                        set [chary v] to (y)\n                        set [inair? v] to [0]\n                        set [ground? v] to [1]\n                    end\n                end\n            end\n        else\n            if <([abs v] of ((charY) - (y)) ) < [1]> then\n                set [ground? v] to [1]\n            else\n                if <not <<(moving?) = [0]> or <(moving?) = []>>> then\n                    if <<([abs v] of (((y) - (charY)) - (moving?)) ) < [3]> or <([abs v] of (((y) - (charY')) - (moving?)) ) < [3]>> then\n                        set [ground? v] to [1]\n                        set [chary v] to (y)\n                    end\n                end\n            end\n        end\n    else\n        if <<(y) < (charY')> and <(charY) < (y)>> then\n            set [chary v] to (y)\n            set [charyvel v] to [0]\n        end\n    end\nend\n\ndefine wall (-x) (-y) (+x) (+y) (move) (walljump?)\nchange [test# v] by (1)\nif <not <(onwall?) = [0]>> then\n    if <(prev  wall) = (test#)> then\n        if <<<(-y) < (charY)> and <(charY) < (+y)>> or <<(-y) < ((charY) + (24))> and <((charY) + (24)) < (+y)>>> then\n            set [onwall? v] to (move)\n            if <<(-x) < ((charX) + ((move) * (8)))> and <((charX) + ((move) * (8))) < (+x)>> then\n                set [prev  wall v] to (test#)\n                if <(move) = [1]> then\n                    set [charx v] to ((-x) - (8))\n                else\n                    set [charx v] to ((+x) + (8))\n                end\n            end\n        else\n            set [onwall? v] to [0]\n        end\n    end\nelse\n    if <<<(-y) < (charY)> and <(charY) < (+y)>> or <<(-y) < ((charY) + (24))> and <((charY) + (24)) < (+y)>>> then\n        if <<(-x) < ((charX) + ((move) * (8)))> and <((charX) + ((move) * (8))) < (+x)>> then\n            set [prev  wall v] to (test#)\n            if <(move) = [1]> then\n                set [charx v] to ((-x) - (8))\n            else\n                set [charx v] to ((+x) + (8))\n            end\n            if <(walljump?) = [1]> then\n                if <<(inair?) = [1]> and <[7] < ([abs v] of (charXvel) )>> then\n                    set [charxvel v] to ((move) * (-2))\n                else\n                    if <(inair?) = [1]> then\n                        set [onwall? v] to (move)\n                        set [up? v] to [1]\n                        set [jumpt v] to [0]\n                        set [charxvel v] to [0]\n                    else\n                        set [onwall? v] to [0]\n                        set [charxvel v] to [0]\n                    end\n                end\n            else\n                set [charxvel v] to ((move) * (-2))\n                set [jumpt v] to [0]\n            end\n        end\n    end\nend\n\nif <(move) = [1]> then\n    if <([abs v] of (((-x) + (move)) - (camX)) ) < [240]> then\n        set x to ([floor v] of (((-x) + (move)) - (camX)) )\n        set y to ([ceiling v] of (((-y) + (1)) - (camY)) )\n        pen down\n        set y to ([floor v] of (((+y) - (1)) - (camY)) )\n        pen up\n    end\nelse\n    if <([abs v] of (((+x) + (move)) - (camX)) ) < [240]> then\n        set x to ([ceiling v] of (((+x) + (move)) - (camX)) )\n        set y to ([ceiling v] of (((-y) + (1)) - (camY)) )\n        pen down\n        set y to ([floor v] of (((+y) - (1)) - (camY)) )\n        pen up\n    end\nend\n\ndefine ceiling (-x) (+x) (y)\nchange [test# v] by (1)\nif <(gravity) = [0]> then\n    if <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n        if <((charY') + (24)) < (y)> then\n            if <(y) < ((charY) + (24))> then\n                set [chary v] to ((y) - (24))\n                set [charyvel v] to [0]\n            end\n        end\n    end\nelse\n    if <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n        if <(inair?) = [1]> then\n            if <not <(y) < ((charY') + (24))>> then\n                if <(y) < ((charY) + (24))> then\n                    set [chary v] to ((y) - (24))\n                    set [inair? v] to [0]\n                    set [ground? v] to [1]\n                end\n            end\n        else\n            if <((charY) + (24)) = (y)> then\n                set [ground? v] to [1]\n            end\n        end\n    end\nend\n\ndefine spawn coin (x) (y)\nset [entitytype v] to [0]\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nchange [# v] by (9)\n\ndefine initialize entities\nif <(level) = [1]> then\n    entities level 1\nend\n\nset [entitytype v] to [5]\nset [# v] to [0]\nset [x v] to [100]\nset [y v] to [0]\ncreate clone of (_myself_ v)\nset [entitytype v] to [5]\nset [# v] to [1]\nset [x v] to [0]\nset [y v] to [200]\ncreate clone of (_myself_ v)\ndelete all of [launch star v]\nadd [1] to [launch star v]\nadd [130] to [launch star v]\nadd [30] to [launch star v]\nadd [200] to [launch star v]\nadd [800] to [launch star v]\nadd [400] to [launch star v]\nadd [600] to [launch star v]\nadd [80] to [launch star v]\nset [entitytype v] to [7]\nset [x v] to [0]\nset [y v] to [50]\ncreate clone of (_myself_ v)\ndelete all of [launch star v]\nadd [2] to [launch star v]\nadd [60] to [launch star v]\nadd [30] to [launch star v]\nadd [400] to [launch star v]\nadd [800] to [launch star v]\nadd [-200] to [launch star v]\nadd [400] to [launch star v]\nadd [80] to [launch star v]\nset [entitytype v] to [7]\nset [x v] to [150]\nset [y v] to [50]\ncreate clone of (_myself_ v)\n\ndefine slope (-x) (+x) (y) (slope)\nif <(inair?) = [1]> then\n    if <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n        if <<(-x) < (charX)> and <(charX) < (+x)>> then\n            if <((y) + (((charX') - (-x)) * (slope))) < (charY')> then\n                if <(charY) < ((y) + (((charX) - (-x)) * (slope)))> then\n                    set [chary v] to ((y) + (((charX) - (-x)) * (slope)))\n                    set [inair? v] to [0]\n                    set [ground? v] to [1]\n                end\n            end\n        else\n            if <([abs v] of ((-x) - (charX)) ) < ([abs v] of ((+x) - (charX)) )> then\n                if <(y) < (charY')> then\n                    if <(charY) < (y)> then\n                        set [chary v] to (y)\n                        set [inair? v] to [0]\n                        set [ground? v] to [1]\n                    end\n                end\n            else\n                if <((y) + (((+x) - (-x)) * (slope))) < (charY')> then\n                    if <(charY) < ((y) + (((+x) - (-x)) * (slope)))> then\n                        set [chary v] to ((y) + (((+x) - (-x)) * (slope)))\n                        set [inair? v] to [0]\n                        set [ground? v] to [1]\n                    end\n                end\n            end\n        end\n    end\nelse\n    if <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n        if <<(-x) < (charX)> and <(charX) < (+x)>> then\n            if <<(-x) < (charX')> and <(charX') < (+x)>> then\n                if <((y) + (((charX') - (-x)) * (slope))) = (charY')> then\n                    set [chary v] to ((y) + (((charX) - (-x)) * (slope)))\n                    set [ground? v] to [1]\n                end\n            else\n                if <([abs v] of ((-x) - (charX')) ) < ([abs v] of ((+x) - (charX')) )> then\n                    if <(charY') = (y)> then\n                        set [chary v] to ((y) + (((charX) - (-x)) * (slope)))\n                        set [ground? v] to [1]\n                    end\n                else\n                    if <(charY') = ((y) + (((+x) - (-x)) * (slope)))> then\n                        set [chary v] to ((y) + (((charX) - (-x)) * (slope)))\n                        set [ground? v] to [1]\n                    end\n                end\n            end\n        else\n            if <<(-x) < (charX')> and <(charX') < (+x)>> then\n                if <((y) + (((charX') - (-x)) * (slope))) = (charY')> then\n                    if <([abs v] of ((-x) - (charX')) ) < ([abs v] of ((+x) - (charX')) )> then\n                        if <(charY') = (y)> then\n                            set [chary v] to (y)\n                            set [ground? v] to [1]\n                        end\n                    else\n                        if <(charY') = ((y) + (((+x) - (-x)) * (slope)))> then\n                            set [chary v] to ((y) + (((+x) - (-x)) * (slope)))\n                            set [ground? v] to [1]\n                        end\n                    end\n                end\n            else\n                if <([abs v] of ((-x) - (charX')) ) < ([abs v] of ((+x) - (charX')) )> then\n                    if <(charY') = (y)> then\n                        set [chary v] to (y)\n                        set [ground? v] to [1]\n                    end\n                else\n                    if <(charY') = ((y) + (((+x) - (-x)) * (slope)))> then\n                        set [chary v] to ((y) + (((+x) - (-x)) * (slope)))\n                        set [ground? v] to [1]\n                    end\n                end\n            end\n        end\n    else\n        if <<(-x) < ((charX') + (8))> and <((charX') - (8)) < (+x)>> then\n            if <<(-x) < (charX')> and <(charX') < (+x)>> then\n                if <((y) + (((charX') - (-x)) * (slope))) = (charY')> then\n                    if <([abs v] of ((-x) - (charX)) ) < ([abs v] of ((+x) - (charX)) )> then\n                        set [chary v] to (y)\n                        set [ground? v] to [1]\n                    else\n                        set [chary v] to ((y) + (((+x) - (-x)) * (slope)))\n                        set [ground? v] to [1]\n                    end\n                end\n            else\n                if <([abs v] of ((-x) - (charX')) ) < ([abs v] of ((+x) - (charX')) )> then\n                    if <(charY') = (y)> then\n                        if <([abs v] of ((-x) - (charX)) ) < ([abs v] of ((+x) - (charX)) )> then\n                            set [chary v] to (y)\n                            set [ground? v] to [1]\n                        else\n                            set [chary v] to ((y) + (((+x) - (-x)) * (slope)))\n                            set [ground? v] to [1]\n                        end\n                    end\n                else\n                    if <(charY') = ((y) + (((+x) - (-x)) * (slope)))> then\n                        if <([abs v] of ((-x) - (charX)) ) < ([abs v] of ((+x) - (charX)) )> then\n                            set [chary v] to (y)\n                            set [ground? v] to [1]\n                        else\n                            set [chary v] to ((y) + (((+x) - (-x)) * (slope)))\n                            set [ground? v] to [1]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine check collisions\nset [charx' v] to (charX)\nset [chary' v] to (charY)\nchange [charx v] by (charXvel)\nif <(gravity) = [1]> then\n    change [chary v] by ((charYvel) * (-1))\nelse\n    change [chary v] by (charYvel)\nend\ncollisions\nif <(ground?) = [0]> then\n    set [inair? v] to [1]\nend\n\ndefine black hole (ytrig) (x) (y) (hole?)\nswitch costume to (full v)\nchange [test# v] by (1)\nif <(hole?) = [1]> then\n    if <<(charY) < (ytrig)> and <not <(([abs v] of ((ytrig) - (y)) ) * (2)) < ([abs v] of ((charX) - (x)) )>>> then\n        set [black hole? v] to [1]\n        set [charxvel v] to (((y) - (charY)) / (4))\n        set [charyvel v] to (((x) - (charX)) / (-4))\n        change [charx v] by (((x) - (charX)) / (15))\n        change [chary v] by (((y) - (charY)) / (15))\n    end\n    set pen size to ([abs v] of ((ytrig) - (y)) )\n    go to x: ((x) - (camX)) y: ((y) - (camY))\n    pen down\n    pen up\n    set pen size to (2)\nelse\n    if <(charY) < (ytrig)> then\n        set [black hole? v] to [2]\n    end\nend\n\ndefine star (x) (y)\nset pen size to (24)\nset pen color to (#ffd000)\ngo to x: ((x) - (camX)) y: ((y) - (camY))\npen down\npen up\nset pen size to (2)\nset pen color to (#21aaff)\nif <([abs v] of ((x) - (charX)) ) < [32]> then\n    if <([abs v] of ((y) - (charY)) ) < [32]> then\n        switch costume to (empty v)\n        stop [all v]\n    end\nend\n\nwhen I receive [game v]\nset volume to (30) %\nset [mario? v] to [0]\nset [camx v] to [0]\nset [camy v] to [0]\nset [charx v] to [0]\nset [chary v] to [5]\nset [charxvel v] to [0]\nset [charyvel v] to [0]\nset [inair? v] to [0]\nset [black hole? v] to [0]\nset [squashed? v] to [0]\nset [jumpt v] to [0]\nset [health v] to [3]\nset [hit v] to [0]\nset [mario? v] to [1]\nset [win? v] to [0]\nset [gravity v] to [0]\nset [launch star? v] to [0]\nset [l/r? v] to [1]\nforever\n    if <(Paused?) = [0]> then\n        if <(win?) = [0]> then\n            if <(level) = [3]> then\n                set [camx v] to ((((camX) * (9)) + (((charX) * (1.5)) + (goldX))) / (11.5))\n                set [camy v] to ((((camY) * (9)) + (((charY) * (1.5)) + (goldY))) / (11.5))\n            else\n                if <(launch star?) = [1]> then\n                    set [camx v] to ((((camX) * (7)) + (charX)) / (8))\n                    set [camy v] to ((((camY) * (7)) + (charY)) / (8))\n                else\n                    set [camx v] to ((((camX) * (9)) + (charX)) / (10))\n                    set [camy v] to ((((camY) * (9)) + (charY)) / (10))\n                end\n            end\n        end\n        if <<(launch star?) = [0]> or <(launch star?) = [2]>> then\n            check collisions\n            if <(win?) = [0]> then\n                if <[0] < (health)> then\n                    move player:  L/R <key (a v) pressed?> <key (d v) pressed?> Jump/Crouch <key (w v) pressed?> <key (s v) pressed?> Spin <key (space v) pressed?>\n                else\n                    move player:  L/R <> <> Jump/Crouch <> <> Spin <>\n                end\n            else\n                set [charxvel v] to [0]\n                set [charyvel v] to [0]\n            end\n        end\n    end\nend\n\ninitialize entities\n\nwhen I receive [game v]\nwait (0.1) seconds\nwait until <<(black hole?) = [1]> or <(black hole?) = [2]>>\nbroadcast (death v)\nwait (0.3) seconds\nstart sound [B70kawa_59 v]\n\nwhen flag clicked\nset [lives v] to [3]\nhide\n\nif <(jumpt) = [3]> then\n    set [charxvel v] to ((([abs v] of (charXvel) ) / (charXvel)) * (-2))\nend\n\nset [start collision v] to ((test#) + (1))\n\nwhen I receive [game v]\nwait (0.1) seconds\nwait until <<(squashed?) = [1]> or <(health) = [0]>>\nbroadcast (death v)\nwait (0.1) seconds\nstart sound [B70kawa_47 v]\n\ndefine squashbox (-x) (-y) (+x) (+y)\nchange [test# v] by (1)\nif <<(-x) < (charX)> and <(charX) < (+x)>> then\n    if <<<(-y) < (charY)> and <(charY) < (+y)>> or <<(-y) < ((charY) + (24))> and <((charY) + (24)) < (+y)>>> then\n        if <(squashed?) = [0]> then\n            set [squashed? v] to [1]\n            set [inair? v] to [0]\n            set [charxvel v] to [0]\n            set [charyvel v] to [0]\n            set [chary v] to (-y)\n        end\n    end\nend\n\ndefine spawn thwomp/chainchomp (x) (miny) (maxy) (thwomp/chainchomp) (#)\nset [# v] to (#)\nset [x v] to (x)\nset [y v] to (miny)\nset [miny v] to (miny)\nset [maxy v] to (maxy)\nset [entitytype v] to (thwomp/chainchomp)\ncreate clone of (_myself_ v)\n\ndefine spawn 1up (x) (y)\nset [entitytype v] to [2]\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [death v]\nwait (3) seconds\nstop [other scripts in sprite v]\nstop [this script v]\n\ndefine lift (-x) (-y) (+x) (+y) (dsty)\nchange [test# v] by (1)\nif <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n    if <<(-y) < (charY)> and <(charY) < (+y)>> then\n        if <(inair?) = [1]> then\n            set [chary v] to (dsty)\n            set [charyvel v] to [0]\n            set [inair? v] to [0]\n            set [ground? v] to [1]\n        end\n    end\nend\n\nwhen flag clicked\nset [coins v] to [0]\n\nwhen I receive [hit v]\nif <(hit) = [-20]> then\n    start sound [hit v]\n    set [hit v] to [10]\n    change [health v] by (-1)\nend\n\nwhen I receive [world map v]\nstop [other scripts in sprite v]\ndelete this clone\n\ndefine spawn star (x) (y)\nset [entitytype v] to [4]\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [win v]\nset [win? v] to [1]\nif <not <(entitytype) = [4]>> then\n    delete this clone\nend\n\nset [charx v] to [2280]\nset [chary v] to [500]\n\nset [level v] to [0]\n\ndefine entities level 1\nspawn star [2280] [650]\nspawn thwomp/chainchomp [686] [280] [380] [1] []\nspawn thwomp/chainchomp [380] [64] [-104] [3] [270]\nspawn thwomp/chainchomp [480] [64] [-104] [3] [180]\nspawn thwomp/chainchomp [580] [64] [-104] [3] [90]\nspawn thwomp/chainchomp [680] [64] [-104] [3] [0]\nspawn thwomp/chainchomp [1200] [504] [336] [3] [1]\nspawn thwomp/chainchomp [1480] [504] [336] [3] [0]\nspawn thwomp/chainchomp [1760] [504] [336] [3] [1]\nspawn thwomp/chainchomp [2040] [504] [336] [3] [0]\nspawn thwomp/chainchomp [1340] [460] [560] [1] [0]\nspawn thwomp/chainchomp [1620] [460] [560] [1] [0]\nspawn thwomp/chainchomp [1900] [460] [560] [1] [0]\nspawn 1up [500] [540]\nspawn 1up [1620] [720]\nset [# v] to [0]\nspawn coin [100] [0]\nspawn coin [120] [0]\nspawn coin [140] [0]\nspawn coin [160] [0]\nspawn coin [180] [0]\nspawn coin [200] [0]\nspawn coin [370] [20]\nspawn coin [390] [20]\nspawn coin [470] [20]\nspawn coin [490] [20]\nspawn coin [570] [20]\nspawn coin [590] [20]\nspawn coin [670] [20]\nspawn coin [690] [20]\nspawn coin [750] [40]\nspawn coin [770] [40]\nspawn coin [1330] [480]\nspawn coin [1350] [480]\nspawn coin [1610] [480]\nspawn coin [1630] [480]\nspawn coin [1890] [480]\nspawn coin [1910] [480]\n\ndefine collisions dev level\nobject | id [3] | position [-20] [0] [-30] [2] | extras [] []\nobject | id [0] | position [-5] [5] [0] [] | extras [] []\nobject | id [0] | position [2] [28] [-2] [] | extras [] []\nobject | id [0] | position [25] [33] [2] [] | extras [] []\nobject | id [0] | position [33] [75] [0] [] | extras [] []\nobject | id [0] | position [73] [85] [2] [] | extras [] []\nobject | id [0] | position [85] [99] [6] [] | extras [] []\nobject | id [0] | position [95] [103] [10] [] | extras [] []\nobject | id [0] | position [91] [99] [14] [] | extras [] []\nobject | id [0] | position [79] [95] [16] [] | extras [] []\nobject | id [0] | position [103] [111] [18] [] | extras [] []\nobject | id [0] | position [107] [113] [22] [] | extras [] []\nobject | id [0] | position [89] [109] [24] [] | extras [] []\nobject | id [0] | position [53] [93] [28] [] | extras [] []\nobject | id [0] | position [75] [89] [44] [] | extras [] []\nobject | id [0] | position [85] [105] [48] [] | extras [] []\nobject | id [0] | position [103] [115] [46] [] | extras [] []\nobject | id [0] | position [113] [213] [44] [] | extras [] []\nobject | id [0] | position [125] [143] [46] [] | extras [] []\nobject | id [0] | position [153] [171] [46] [] | extras [] []\nobject | id [0] | position [181] [199] [46] [] | extras [] []\nobject | id [0] | position [209] [227] [46] [] | extras [] []\nobject | id [0] | position [221] [235] [50] [] | extras [] []\nobject | id [0] | position [215] [229] [54] [] | extras [] []\nobject | id [0] | position [223] [233] [58] [] | extras [] []\nobject | id [0] | position [45] [55] [54] [] | extras [] []\nobject | id [2] | position [-5] [33] [-6] [] | extras [] []\nobject | id [2] | position [85] [99] [-8] [] | extras [] []\nobject | id [2] | position [45] [55] [22] [] | extras [] []\nobject | id [2] | position [75] [89] [38] [] | extras [] []\nobject | id [2] | position [88] [105] [40] [] | extras [] []\nobject | id [2] | position [210] [227] [36] [] | extras [] []\nobject | id [1] | position [-5] [-6] [-3] [0] | extras [1] [1]\nobject | id [1] | position [3] [-6] [5] [0] | extras [-1] [1]\nobject | id [1] | position [25] [-4] [27] [2] | extras [1] [1]\nobject | id [1] | position [31] [-6] [33] [2] | extras [-1] [1]\nobject | id [1] | position [73] [-6] [75] [2] | extras [1] [1]\nobject | id [1] | position [85] [-6] [87] [6] | extras [1] [1]\nobject | id [1] | position [85] [-8] [99] [6] | extras [-1] [1]\nobject | id [1] | position [53] [22] [55] [54] | extras [-1] [1]\nobject | id [1] | position [45] [22] [47] [54] | extras [1] [1]\nobject | id [1] | position [75] [38] [77] [44] | extras [1] [1]\nobject | id [1] | position [87] [38] [89] [44] | extras [-1] [1]\nobject | id [1] | position [85] [43] [90] [48] | extras [1] [1]\nobject | id [1] | position [103] [43] [105] [48] | extras [-1] [1]\nobject | id [1] | position [113] [36] [115] [46] | extras [-1] [1]\nobject | id [1] | position [101] [36] [103] [42] | extras [1] [1]\nobject | id [1] | position [125] [42] [127] [46] | extras [1] [1]\nobject | id [1] | position [141] [42] [143] [46] | extras [-1] [1]\nobject | id [1] | position [153] [42] [155] [46] | extras [1] [1]\nobject | id [1] | position [169] [42] [171] [46] | extras [-1] [1]\nobject | id [1] | position [181] [42] [183] [46] | extras [1] [1]\nobject | id [1] | position [197] [42] [199] [46] | extras [-1] [1]\nobject | id [1] | position [209] [42] [211] [46] | extras [1] [1]\nobject | id [1] | position [225] [36] [227] [46] | extras [-1] [1]\n\ndefine object | id (id) | position (-x) (-y) (+x) (+y) | extras (move) (walljump)\nif <(id) = [0]> then\n    floor ((-x) * (10)) ((-y) * (10)) ((+x) * (10)) [0]\nelse\n    if <(id) = [1]> then\n        wall ((-x) * (10)) ((-y) * (10)) ((+x) * (10)) ((+y) * (10)) (move) (walljump)\n    else\n        if <(id) = [2]> then\n            ceiling ((-x) * (10)) ((-y) * (10)) ((+x) * (10))\n        else\n            if <(id) = [3]> then\n                if <(win?) = [0]> then\n                    black hole ((-x) * (10)) ((-y) * (10)) ((+x) * (10)) (+y)\n                end\n            else\n                if <(id) = [4]> then\n                    slope ((-x) * (10)) ((-y) * (10)) ((+x) * (10)) ((+y) / (10))\n                end\n            end\n        end\n    end\nend\n\nset [level v] to [0]\n\ndefine object (string)\ndelete all of [collider unpack v]\nadd (letter (1) of (string)) to [collider unpack v]\nunpack (string) [3] [7]\nadd (#4) to [collider unpack v]\nunpack (string) [9] [13]\nadd (#4) to [collider unpack v]\nunpack (string) [15] [19]\nadd (#4) to [collider unpack v]\nif <(letter (1) of (string)) = [1]> then\n    unpack (string) [21] [25]\n    add (#4) to [collider unpack v]\n    unpack (string) [27] [28]\n    add (#4) to [collider unpack v]\n    add (letter (length of (string)) of (string)) to [collider unpack v]\nelse\n    if <(letter (1) of (string)) = [3]> then\n        add (letter (length of (string)) of (string)) to [collider unpack v]\n    else\n        if <(letter (1) of (string)) = [4]> then\n            unpack (string) [21] [25]\n            add (#4) to [collider unpack v]\n        end\n    end\nend\nobject | id (item (1) of [collider unpack v]) | position (item (2) of [collider unpack v]) (item (3) of [collider unpack v]) (item (4) of [collider unpack v]) (item (5) of [collider unpack v]) | extras (item (6) of [collider unpack v]) (item (7) of [collider unpack v])\n\ndefine unpack (string) (start) (end)\nset [#4 v] to []\nset [#3 v] to [0]\nrepeat (((end) - (start)) + (1))\n    set [#4 v] to (join (#4) (letter ((start) + (#3)) of (string)))\n    change [#3 v] by (1)\nend\nset [#4 v] to ((#4) + (0))\n\nobject (item (33) of [level collisions v])\n\nset [# v] to [0]\n\nset [# v] to [0]\nset [entitytype v] to [6]\nset [x v] to [100]\nset [y v] to [100]\nset [maxy v] to [5]\nset [miny v] to [16]\ncreate clone of (_myself_ v)\nset [maxy v] to [5]\nset [miny v] to [32]\ncreate clone of (_myself_ v)\nset [maxy v] to [5]\nset [miny v] to [48]\ncreate clone of (_myself_ v)\nset [maxy v] to [-2]\nset [miny v] to [64]\nrepeat (8)\n    change [# v] by (45)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [win v]\nwait (7.5) seconds\nstop [other scripts in sprite v]\n\nwhen I receive [win v]\nwait (7) seconds\ndelete this clone\n\nwhen I receive [return to map v]\nstop [other scripts in sprite v]\n\n@entities\n\ndefine point A (ax) (ay) point B (bx) (by) handles (hx) (hy) (hx) (hy)\ncalculate position ((ax) + (((hx) - (ax)) * ((#) / (item (7) of [launch star v])))) ((ay) + (((hy) - (ay)) * ((#) / (item (7) of [launch star v])))) ((hx) + (((hx) - (hx)) * ((#) / (item (7) of [launch star v])))) ((hy) + (((hy) - (hy)) * ((#) / (item (7) of [launch star v])))) ((hx) + (((bx) - (hx)) * ((#) / (item (7) of [launch star v])))) ((hy) + (((by) - (hy)) * ((#) / (item (7) of [launch star v]))))\n\ndefine calculate position (x1) (y1) (x2) (y2) (x3) (y3)\ncalculate position ((x1) + (((x2) - (x1)) * ((#) / (item (7) of [launch star v])))) ((y1) + (((y2) - (y1)) * ((#) / (item (7) of [launch star v])))) ((x2) + (((x3) - (x2)) * ((#) / (item (7) of [launch star v])))) ((y2) + (((y3) - (y2)) * ((#) / (item (7) of [launch star v]))))\n\ndefine calculate position (x1) (y1) (x2) (y2)\nset [charxvel v] to (((x1) + (((x2) - (x1)) * ((#) / (item (7) of [launch star v])))) - (charX))\nset [charyvel v] to (((y1) + (((y2) - (y1)) * ((#) / (item (7) of [launch star v])))) - (charY))\n\ndefine collisions\nset [#5 v] to [0]\nrepeat (length of [level collisions v])\n    change [#5 v] by (1)\n    object (item (#5) of [level collisions v])\nend\n\ndefine ground (y)\nif <(charY) < (y)> then\n    set [chary v] to (y)\n    set [inair? v] to [0]\nend\nif <(charY) = (y)> then\n    set [ground? v] to [1]\nend\ngo to x: (-240) y: (((y) - (1)) - (camY))\npen down\ngo to x: (240) y: (((y) - (1)) - (camY))\npen up\n\ndefine floor (-x) (+x) (y) (moving?)\nif <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n    if <(gravity) = [0]> then\n        if <(inair?) = [1]> then\n            if <<not <(charY') < (y)>> or <not <(charY') < ((y) - (moving?))>>> then\n                if <<(charY) < (y)> or <(charY) < ((y) - (moving?))>> then\n                    set [chary v] to (y)\n                    set [inair? v] to [0]\n                    set [ground? v] to [1]\n                end\n            end\n        else\n            if <(charY) = (y)> then\n                set [ground? v] to [1]\n            else\n                if <not <<(moving?) = [0]> or <(moving?) = []>>> then\n                    if <<([abs v] of (((y) - (charY)) - (moving?)) ) < [3]> or <([abs v] of (((y) - (charY')) - (moving?)) ) < [3]>> then\n                        set [ground? v] to [1]\n                        set [chary v] to (y)\n                    end\n                end\n            end\n        end\n    else\n        if <<(y) < (charY')> and <(charY) < (y)>> then\n            set [chary v] to (y)\n            set [charyvel v] to [0]\n        end\n    end\nend\n\ndefine wall (-x) (-y) (+x) (+y) (move) (walljump?)\nchange [test# v] by (1)\nif <not <(onwall?) = [0]>> then\n    if <(prev  wall) = (test#)> then\n        if <<<(-y) < (charY)> and <(charY) < (+y)>> or <<(-y) < ((charY) + (24))> and <((charY) + (24)) < (+y)>>> then\n            set [onwall? v] to (move)\n            if <<(-x) < ((charX) + ((move) * (8)))> and <((charX) + ((move) * (8))) < (+x)>> then\n                set [prev  wall v] to (test#)\n                if <(move) = [1]> then\n                    set [charx v] to ((-x) - (8))\n                else\n                    set [charx v] to ((+x) + (8))\n                end\n            end\n        else\n            set [onwall? v] to [0]\n        end\n    end\nelse\n    if <<<(-y) < (charY)> and <(charY) < (+y)>> or <<(-y) < ((charY) + (24))> and <((charY) + (24)) < (+y)>>> then\n        if <<(-x) < ((charX) + ((move) * (8)))> and <((charX) + ((move) * (8))) < (+x)>> then\n            set [prev  wall v] to (test#)\n            if <(move) = [1]> then\n                set [charx v] to ((-x) - (8))\n            else\n                set [charx v] to ((+x) + (8))\n            end\n            if <(walljump?) = [1]> then\n                if <<(inair?) = [1]> and <[7] < ([abs v] of (charXvel) )>> then\n                    set [charxvel v] to ((move) * (-2))\n                else\n                    if <(inair?) = [1]> then\n                        set [onwall? v] to (move)\n                        set [up? v] to [1]\n                        set [jumpt v] to [0]\n                        set [charxvel v] to [0]\n                    else\n                        set [onwall? v] to [0]\n                        set [charxvel v] to [0]\n                    end\n                end\n            else\n                set [charxvel v] to ((move) * (-2))\n                set [jumpt v] to [0]\n            end\n        end\n    end\nend\n\ndefine ceiling (-x) (+x) (y)\nif <(gravity) = [0]> then\n    if <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n        if <((charY') + (24)) < (y)> then\n            if <(y) < ((charY) + (24))> then\n                set [chary v] to ((y) - (24))\n                set [charyvel v] to [0]\n            end\n        end\n    end\nelse\n    if <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n        if <(inair?) = [1]> then\n            if <not <(y) < ((charY') + (24))>> then\n                if <(y) < ((charY) + (24))> then\n                    set [chary v] to ((y) - (24))\n                    set [inair? v] to [0]\n                    set [ground? v] to [1]\n                end\n            end\n        else\n            if <((charY) + (24)) = (y)> then\n                set [ground? v] to [1]\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(entitytype) = [0]> then\n    switch costume to (coin v)\n    show\n    if <(entity?) = [0]> then\n        repeat until <((((charX) - (x)) * ((charX) - (x))) + ((((charY) + (8)) - (y)) * (((charY) + (8)) - (y)))) < [256]>\n            change [# v] by (1)\n            if <([abs v] of ((x) - (camX)) ) < [260]> then\n                if <([abs v] of (((y) + ((4) * ([sin v] of ((#) * (10)) ))) - (camY)) ) < [200]> then\n                    switch costume to (full v)\n                    point in direction (90)\n                    go to x: ((x) - (camX)) y: (((y) + ((2) * ([sin v] of ((#) * (10)) ))) - (camY))\n                    switch costume to ((([floor v] of ((#) / (4)) ) mod (6)) + (7))\n                    show\n                else\n                    hide\n                end\n            else\n                hide\n            end\n        end\n        broadcast (coin v)\n        change [coins v] by (1)\n        if <<(health) < [3]> and <[0] < (health)>> then\n            change [health v] by (1)\n        end\n        set [# v] to [0]\n        repeat (12)\n            change [# v] by (1)\n            go to x: ((x) - (camX)) y: (((y) + ((16) * ([sin v] of ((#) * (15)) ))) - (camY))\n            switch costume to ((([floor v] of (#) ) mod (6)) + (7))\n        end\n        delete this clone\n    else\n        set [ent-inair? v] to [1]\n        set [entground v] to [0]\n        repeat until <((((charX) - (x)) * ((charX) - (x))) + ((((charY) + (8)) - (y)) * (((charY) + (8)) - (y)))) < [256]>\n            if <(entground) = [0]> then\n                set [ent-inair? v] to [1]\n            else\n                set [ent-inair? v] to [0]\n            end\n            if <(miny) = [1]> then\n                change [maxy v] by (1)\n            end\n            if <(ent-inair?) = [1]> then\n                change [yvel v] by (-1)\n                set [yvel v] to ((Yvel) * (0.95))\n            else\n                set [yvel v] to [0]\n                set [xvel v] to ((Xvel) * (0.95))\n            end\n            set [entground v] to [0]\n            collisions\n            change [x v] by (Xvel)\n            change [y v] by (Yvel)\n            change [# v] by (1)\n            if <([abs v] of ((x) - (camX)) ) < [260]> then\n                if <([abs v] of (((y) + ((4) * ([sin v] of ((#) * (10)) ))) - (camY)) ) < [200]> then\n                    switch costume to (full v)\n                    point in direction (90)\n                    go to x: ((x) - (camX)) y: (((y) - (camY)) + (8))\n                    switch costume to ((([floor v] of ((#) / (4)) ) mod (6)) + (7))\n                    show\n                else\n                    hide\n                end\n            else\n                hide\n            end\n        end\n        broadcast (coin v)\n        change [coins v] by (1)\n        if <<(health) < [3]> and <[0] < (health)>> then\n            change [health v] by (1)\n        end\n        set [# v] to [0]\n        repeat (12)\n            change [# v] by (1)\n            go to x: ((x) - (camX)) y: ((((y) + ((16) * ([sin v] of ((#) * (15)) ))) - (camY)) + (8))\n            switch costume to ((([floor v] of (#) ) mod (6)) + (7))\n        end\n        delete this clone\n    end\nelse\n    set [entity? v] to [1]\n    if <(entitytype) = [1]> then\n        switch costume to (thwomp v2 v)\n        show\n        forever\n            if <(Paused?) = [0]> then\n                set [prevy v] to (y)\n                if <<([abs v] of ((x) - (camX)) ) < [300]> and <<([abs v] of ((maxy) - (camY)) ) < [240]> or <([abs v] of ((miny) - (camY)) ) < [240]>>> then\n                    calc thwomp position [30] [0.5] [30] [0.1]\n                end\n                change [# v] by (1)\n                lift ((x) - (64)) ((y) + (140)) ((x) + (64)) ((prevy) + (160)) ((y) + (160))\n                floor ((x) - (64)) ((x) + (64)) ((y) + (160)) ((y) - (prevy))\n                if <<([abs v] of ((y) - (miny)) ) < [25]> and <[0] < ([abs v] of ((y) - (miny)) )>> then\n                    squashbox ((x) - (60)) (miny) ((x) + (60)) ((miny) + (80))\n                else\n                    ceiling ((x) - (64)) ((x) + (64)) (y)\n                end\n                wall ((x) + (44)) (y) ((x) + (64)) ((y) + (160)) [-1] [1]\n                wall ((x) - (64)) (y) ((x) - (44)) ((y) + (160)) [1] [1]\n                switch costume to (full v)\n                go to x: ((x) - (camX)) y: ((y) - (camY))\n                switch costume to (empty v)\n                set size to (100) %\n                if <<[0] < ((y) - (prevy))> or <(y) = (maxy)>> then\n                    switch costume to (thwomp v2-2 v)\n                else\n                    switch costume to (thwomp v2 v)\n                end\n            end\n        end\n    else\n        if <(entitytype) = [2]> then\n            repeat until <((((charX) - (x)) * ((charX) - (x))) + (((charY) - (y)) * ((charY) - (y)))) < [256]>\n                if <([abs v] of ((x) - (camX)) ) < [260]> then\n                    if <([abs v] of ((y) - (camY)) ) < [200]> then\n                        switch costume to (full v)\n                        point in direction (90)\n                        go to x: ((x) - (camX)) y: ((y) - (camY))\n                        switch costume to (1up v2 v)\n                        show\n                    else\n                        hide\n                    end\n                else\n                    hide\n                end\n            end\n            broadcast (1up v)\n            delete this clone\n        else\n            if <(entitytype) = [3]> then\n                if <(([floor v] of (#) ) mod (2)) = [1]> then\n                    forever\n                        if <(Paused?) = [0]> then\n                            chain chomp collision\n                            switch costume to (full v)\n                            point in direction (90)\n                            go to x: ((x) - (camX)) y: ((y) - (camY))\n                            switch costume to (empty v)\n                            set size to (100) %\n                            switch costume to ((48) + (([floor v] of ((#) / (8)) ) mod (16)))\n                            show\n                            set [ghost v] effect to ((([sin v] of (#) ) + (-0.6)) * (100))\n                            if <([sin v] of (#) ) < [0]> then\n                                go to [back v] layer\n                                go [forward v] (1) layers\n                            else\n                                go to [front v] layer\n                            end\n                            change [# v] by ((360) / ([abs v] of ((maxy) - (miny)) ))\n                            set [# v] to ((#) mod ((360) * (128)))\n                            set [y v] to ((((maxy) + (miny)) + (([cos v] of (#) ) * (((maxy) - (miny)) + (64)))) / (2))\n                        end\n                    end\n                else\n                    forever\n                        if <(Paused?) = [0]> then\n                            chain chomp collision\n                            switch costume to (full v)\n                            point in direction (90)\n                            go to x: ((x) - (camX)) y: ((y) - (camY))\n                            switch costume to (empty v)\n                            set size to (100) %\n                            switch costume to ((48) + (([floor v] of ((#) / (8)) ) mod (16)))\n                            show\n                            set [ghost v] effect to ((([sin v] of (#) ) + (-0.6)) * (100))\n                            if <([sin v] of (#) ) < [0]> then\n                                go to [back v] layer\n                                go [forward v] (1) layers\n                            else\n                                go to [front v] layer\n                            end\n                            change [# v] by ((-360) / ([abs v] of ((maxy) - (miny)) ))\n                            set [# v] to ((#) mod ((360) * (128)))\n                            set [y v] to ((((maxy) + (miny)) + (([cos v] of (#) ) * (((maxy) - (miny)) + (64)))) / (2))\n                        end\n                    end\n                end\n            else\n                if <(entitytype) = [4]> then\n                    set [# v] to [0]\n                    repeat until <(win?) = [1]>\n                        if <<([abs v] of ((x) - (camX)) ) < [260]> and <([abs v] of ((y) - (camY)) ) < [200]>> then\n                            change [# v] by (1)\n                            switch costume to (full v)\n                            go to x: ((x) - (camX)) y: (((y) + ((4) * ([sin v] of ((#) * (5)) ))) - (camY))\n                            switch costume to ((28) + (([floor v] of ((#) / (5)) ) mod (20)))\n                            show\n                            set rotation style [don't rotate v]\n                            point in direction (90)\n                        else\n                            hide\n                        end\n                        if <<((x) - (16)) < ((charX) + (8))> and <((charX) - (8)) < ((x) + (16))>> then\n                            if <<((y) - (16)) < ((charY) + (24))> and <(charY) < ((y) + (16))>> then\n                                broadcast (win v)\n                            end\n                        end\n                    end\n                    set [# v] to [0]\n                    repeat (90)\n                        set [x v] to ((charX) + (([sin v] of (#) ) * (30)))\n                        set [y v] to (((charY) + (16)) + (([cos v] of ((#) * (0.8)) ) * (10)))\n                        set [camx v] to ((((camX) * (9)) + ((((x) * (2)) + (charX)) / (3))) / (10))\n                        set [camy v] to ((((camY) * (9)) + ((((y) * (2)) + (charY)) / (3))) / (10))\n                        change [# v] by (6)\n                        switch costume to (full v)\n                        go to x: ((x) - (camX)) y: ((y) - (camY))\n                        switch costume to ((28) + (([floor v] of ((#) / (10)) ) mod (20)))\n                        show\n                    end\n                    repeat (40)\n                        set [x v] to (charX)\n                        set [y v] to (((charY) + (16)) + (([sin v] of (#) ) * (-80)))\n                        set [camx v] to ((((camX) * (9)) + ((((x) * (2)) + (charX)) / (3))) / (10))\n                        set [camy v] to ((((camY) * (9)) + ((((y) * (2)) + (charY)) / (3))) / (10))\n                        change [# v] by (4.5)\n                        switch costume to (full v)\n                        go to x: ((x) - (camX)) y: ((y) - (camY))\n                        switch costume to ((28) + (([floor v] of ((#) / (2.5)) ) mod (20)))\n                        show\n                    end\n                    switch costume to (0000 v)\n                    repeat (25)\n                        set [camx v] to ((((camX) * (9)) + ((((x) * (2)) + (charX)) / (3))) / (10))\n                        set [camy v] to ((((camY) * (9)) + ((((y) * (2)) + (charY)) / (3))) / (10))\n                        go to x: ((x) - (camX)) y: ((y) - (camY))\n                    end\n                    set [# v] to [0]\n                    repeat (120)\n                        set [x v] to ((charX) + (([sin v] of (#) ) * (30)))\n                        set [y v] to (((charY) + (16)) + (([sin v] of ((#) * (0.8)) ) * (10)))\n                        set [camx v] to ((((camX) * (9)) + ((((x) * (2)) + (charX)) / (3))) / (10))\n                        set [camy v] to ((((camY) * (9)) + ((((y) * (2)) + (charY)) / (3))) / (10))\n                        change [# v] by (3)\n                        switch costume to (full v)\n                        go to x: ((x) - (camX)) y: ((y) - (camY))\n                        switch costume to ((28) + (([floor v] of ((#) / (10)) ) mod (20)))\n                        show\n                    end\n                    delete this clone\n                else\n                    if <(entitytype) = [5]> then\n                        forever\n                            switch costume to (empty v)\n                            set size to (100) %\n                            switch costume to (full v)\n                            go to x: ((x) - (camX)) y: ((y) - (camY))\n                            show\n                            if <(#) = [0]> then\n                                if <(gravity) = [0]> then\n                                    switch costume to (button up low v)\n                                    if <(inair?) = [1]> then\n                                        if <(charYvel) < [2]> then\n                                            if <<([abs v] of ((x) - (charX)) ) < [20]> and <<((charY) - (y)) < [16]> and <(y) < (charY)>>> then\n                                                set [gravity v] to [1]\n                                                set [jumpt v] to [3]\n                                                set [charyvel v] to [0]\n                                            end\n                                        end\n                                    end\n                                else\n                                    switch costume to (button pressed low v)\n                                end\n                            else\n                                if <(gravity) = [0]> then\n                                    switch costume to (button pressed high v)\n                                else\n                                    switch costume to (button up high v)\n                                    if <(inair?) = [1]> then\n                                        if <(charYvel) < [2]> then\n                                            if <<([abs v] of ((x) - (charX)) ) < [20]> and <<((y) - ((charY) + (24))) < [16]> and <((charY) + (24)) < (y)>>> then\n                                                set [gravity v] to [0]\n                                                set [jumpt v] to [3]\n                                                set [charyvel v] to [0]\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    else\n                        if <(entitytype) = [6]> then\n                            forever\n                                if <(Paused?) = [0]> then\n                                    change [# v] by (maxy)\n                                    switch costume to (empty v)\n                                    set size to (100) %\n                                    switch costume to (full v)\n                                    go to x: (((x) - (([sin v] of (#) ) * (miny))) - (camX)) y: (((y) + (([cos v] of (#) ) * (miny))) - (camY))\n                                    switch costume to (fireball v)\n                                    show\n                                end\n                            end\n                        else\n                            if <(entitytype) = [7]> then\n                                set rotation style [all around v]\n                                set [# v] to [0]\n                                set [miny v] to [0]\n                                set [maxy v] to [0]\n                                set [#2 v] to [0]\n                                forever\n                                    change [miny v] by (1)\n                                    switch costume to (empty v)\n                                    set size to (100) %\n                                    switch costume to (full v)\n                                    go to x: ((x) - (camX)) y: (((y) + (16)) - (camY))\n                                    show\n                                    if <(Paused?) = [0]> then\n                                        set [#2 v] to ((#2) * (0.8))\n                                        if <(maxy) = [1]> then\n                                            set [gravity v] to [0]\n                                            change [charx v] by (charXvel)\n                                            change [chary v] by (charYvel)\n                                            if <(#) < [30]> then\n                                                change [miny v] by ((12) / ((#) + (1)))\n                                                switch costume to ((77) + (([floor v] of ((miny) / (1)) ) mod (8)))\n                                            else\n                                                switch costume to ((69) + (([floor v] of ((miny) / (4)) ) mod (8)))\n                                            end\n                                            if <(#) < (item (7) of [launch star v])> then\n                                                point A (x) (y) point B (item (1) of [launch star v]) (item (2) of [launch star v]) handles (item (3) of [launch star v]) (item (4) of [launch star v]) (item (5) of [launch star v]) (item (6) of [launch star v])\n                                                change [# v] by (1)\n                                            else\n                                                set [# v] to [0]\n                                                set [launch star? v] to [0]\n                                                set [maxy v] to [0]\n                                            end\n                                        else\n                                            switch costume to ((69) + (([floor v] of ((miny) / (4)) ) mod (8)))\n                                            if <not <(launch star?) = [1]>> then\n                                                if <<([abs v] of ((x) - (charX)) ) < [16]> and <([abs v] of ((y) - (charY)) ) < [16]>> then\n                                                    if <(#) < [50]> then\n                                                        change [#2 v] by (1)\n                                                        set [launch star? v] to [2]\n                                                        change [miny v] by (0.5)\n                                                        set [jumpt v] to [0]\n                                                        change [charxvel v] by ((((x) - (charX)) / (10)) - ((charXvel) / (1.3)))\n                                                        change [charyvel v] by ((((y) - (charY)) / (10)) - ((charYvel) / (1.3)))\n                                                        if <<<key (s v) pressed?> or <key (w v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>> then\n                                                            change [# v] by (3)\n                                                        end\n                                                        change [# v] by (1)\n                                                        if <key (space v) pressed?> then\n                                                            set [# v] to [0]\n                                                            set [launch star? v] to [1]\n                                                            set [maxy v] to [1]\n                                                        end\n                                                        if <not <(#) < [50]>> then\n                                                            set [launch star? v] to [0]\n                                                        end\n                                                    end\n                                                else\n                                                    set [# v] to [0]\n                                                end\n                                            end\n                                        end\n                                    else\n                                        if <(maxy) = [1]> then\n                                            if <(#) < [30]> then\n                                                switch costume to ((77) + (([floor v] of ((miny) / (1)) ) mod (8)))\n                                            else\n                                                switch costume to ((69) + (([floor v] of ((miny) / (4)) ) mod (8)))\n                                            end\n                                        else\n                                            switch costume to ((69) + (([floor v] of ((miny) / (4)) ) mod (8)))\n                                        end\n                                    end\n                                end\n                            else\n                                if <(entitytype) = [8]> then\n                                    if <(miny) = [0]> then\n                                        set rotation style [all around v]\n                                        point in direction (90)\n                                        repeat (maxy)\n                                            if <(Paused?) = [0]> then\n                                                if <(entground) = [0]> then\n                                                    set [ent-inair? v] to [1]\n                                                else\n                                                    set [ent-inair? v] to [0]\n                                                end\n                                                change [x v] by (Xvel)\n                                                change [y v] by (Yvel)\n                                                show\n                                                switch costume to (full v)\n                                                go to x: ((x) - (camX)) y: ((y) - (camY))\n                                                switch costume to (empty v)\n                                                set size to (100) %\n                                                switch costume to (chomp side v)\n                                                turn right ((#) * (360)) degrees\n                                                go to [front v] layer\n                                                chain chomp collision\n                                                rolling chomp movement\n                                            end\n                                        end\n                                        repeat (20)\n                                            if <(entground) = [0]> then\n                                                set [ent-inair? v] to [1]\n                                            else\n                                                set [ent-inair? v] to [0]\n                                            end\n                                            change [x v] by (Xvel)\n                                            change [y v] by (Yvel)\n                                            show\n                                            switch costume to (full v)\n                                            go to x: ((x) - (camX)) y: ((y) - (camY))\n                                            switch costume to (empty v)\n                                            set size to (100) %\n                                            switch costume to (chomp side v)\n                                            turn right ((#) * (360)) degrees\n                                            go to [front v] layer\n                                            rolling chomp movement\n                                            change [ghost v] effect by (5)\n                                        end\n                                        delete this clone\n                                    else\n                                        set rotation style [all around v]\n                                        point in direction (90)\n                                        forever\n                                            if <(Paused?) = [0]> then\n                                                if <(entground) = [0]> then\n                                                    set [ent-inair? v] to [1]\n                                                else\n                                                    set [ent-inair? v] to [0]\n                                                end\n                                                change [x v] by (Xvel)\n                                                change [y v] by (Yvel)\n                                                set [goldx v] to (x)\n                                                set [goldy v] to (y)\n                                                show\n                                                switch costume to (full v)\n                                                go to x: ((x) - (camX)) y: ((y) - (camY))\n                                                switch costume to (empty v)\n                                                set size to (100) %\n                                                switch costume to (gold chomp side v)\n                                                turn right ((#) * (360)) degrees\n                                                go to [front v] layer\n                                                if <<([abs v] of (#) ) < ((5) / (201.06))> or <not <((#) / ([abs v] of (#) )) = (([abs v] of ((charX) - (x)) ) / ((charX) - (x)))>>> then\n                                                    change [# v] by (((([abs v] of ((charX) - (x)) ) / ((charX) - (x))) / (18)) / (201.06))\n                                                end\n                                                chain chomp collision\n                                                rolling chomp movement\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine spawn coin (x) (y)\nset [entitytype v] to [0]\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nchange [# v] by (9)\n\ndefine initialize entities\nset [render? v] to [0]\nif <(level) = [1]> then\n    entities level 1\nelse\n    if <(level) = [2]> then\n        delete all of [launch star v]\n        add [1420] to [launch star v]\n        add [810] to [launch star v]\n        add [700] to [launch star v]\n        add [1000] to [launch star v]\n        add [1200] to [launch star v]\n        add [1400] to [launch star v]\n        add [100] to [launch star v]\n        set [entitytype v] to [7]\n        set [x v] to [650]\n        set [y v] to [140]\n        create clone of (_myself_ v)\n        delete all of [launch star v]\n        add [3300] to [launch star v]\n        add [420] to [launch star v]\n        add [2400] to [launch star v]\n        add [1800] to [launch star v]\n        add [3000] to [launch star v]\n        add [1400] to [launch star v]\n        add [100] to [launch star v]\n        set [entitytype v] to [7]\n        set [x v] to [2250]\n        set [y v] to [680]\n        create clone of (_myself_ v)\n        delete all of [launch star v]\n        spawn thwomp/chainchomp [3480] [404] [196] [3] [0]\n        spawn thwomp/chainchomp [3480] [404] [196] [3] [120]\n        spawn thwomp/chainchomp [3480] [404] [196] [3] [240]\n        spawn thwomp/chainchomp [3600] [424] [176] [3] [91]\n        spawn thwomp/chainchomp [3600] [424] [176] [3] [211]\n        spawn thwomp/chainchomp [3600] [424] [176] [3] [331]\n        spawn thwomp/chainchomp [3720] [384] [216] [3] [0]\n        spawn thwomp/chainchomp [3720] [384] [216] [3] [120]\n        spawn thwomp/chainchomp [3720] [384] [216] [3] [240]\n        spawn goomba [2040] [640] [1]\n        spawn goomba [2140] [640] [1]\n    else\n        if <(level) = [3]> then\n            set [miny v] to [1]\n            set [x v] to [0]\n            set [y v] to [200]\n            set [xvel v] to [0]\n            set [yvel v] to [0]\n            set [# v] to [0]\n            set [entitytype v] to [8]\n            set [maxy v] to [100]\n            create clone of (_myself_ v)\n        end\n    end\nend\n\ndefine slope (-x) (+x) (y) (slope)\nchange [test# v] by (1)\nif <(inair?) = [1]> then\n    if <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n        if <<(-x) < (charX)> and <(charX) < (+x)>> then\n            if <((y) + (((charX') - (-x)) * (slope))) < (charY')> then\n                if <(charY) < ((y) + (((charX) - (-x)) * (slope)))> then\n                    set [chary v] to ((y) + (((charX) - (-x)) * (slope)))\n                    set [inair? v] to [0]\n                    set [ground? v] to [1]\n                end\n            end\n        else\n            if <([abs v] of ((-x) - (charX)) ) < ([abs v] of ((+x) - (charX)) )> then\n                if <(y) < (charY')> then\n                    if <(charY) < (y)> then\n                        set [chary v] to (y)\n                        set [inair? v] to [0]\n                        set [ground? v] to [1]\n                    end\n                end\n            else\n                if <((y) + (((+x) - (-x)) * (slope))) < (charY')> then\n                    if <(charY) < ((y) + (((+x) - (-x)) * (slope)))> then\n                        set [chary v] to ((y) + (((+x) - (-x)) * (slope)))\n                        set [inair? v] to [0]\n                        set [ground? v] to [1]\n                    end\n                end\n            end\n        end\n    end\nelse\n    if <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n        if <<(-x) < (charX)> and <(charX) < (+x)>> then\n            if <([abs v] of ((charY) - ((y) + (((charX) - (-x)) * (slope)))) ) < [3]> then\n                set [chary v] to ((y) + (((charX) - (-x)) * (slope)))\n                set [ground? v] to [1]\n            end\n        else\n            if <([abs v] of ((-x) - (charX)) ) < ([abs v] of ((+x) - (charX)) )> then\n                if <([abs v] of ((charY) - (y)) ) < [3]> then\n                    set [chary v] to (y)\n                    set [ground? v] to [1]\n                end\n            else\n                if <([abs v] of ((charY) - ((y) + (((+x) - (-x)) * (slope)))) ) < [3]> then\n                    set [chary v] to ((y) + (((+x) - (-x)) * (slope)))\n                    set [ground? v] to [1]\n                end\n            end\n        end\n    end\nend\n\ndefine black hole (ytrig) (x) (y) (hole?)\nswitch costume to (full v)\nchange [test# v] by (1)\nif <(hole?) = [1]> then\n    if <<(charY) < (ytrig)> and <not <(([abs v] of ((ytrig) - (y)) ) * (2)) < ([abs v] of ((charX) - (x)) )>>> then\n        set [black hole? v] to [1]\n        set [charxvel v] to (((y) - (charY)) / (4))\n        set [charyvel v] to (((x) - (charX)) / (-4))\n        change [charx v] by (((x) - (charX)) / (15))\n        change [chary v] by (((y) - (charY)) / (15))\n    end\n    set pen size to ([abs v] of ((ytrig) - (y)) )\n    go to x: ((x) - (camX)) y: ((y) - (camY))\n    pen down\n    pen up\n    set pen size to (2)\nelse\n    if <(charY) < (ytrig)> then\n        set [black hole? v] to [2]\n    end\nend\n\nwhen I receive [game v]\nwait (0.05) seconds\ninitialize entities\nif <(level) = [3]> then\n    set [render? v] to [1]\n    forever\n        erase all\n        switch costume to (full v)\n        collisions\n    end\nend\n\ndefine calc thwomp position (startpause) (risespeed) (midpause) (fallspeed)\nif <((#) mod ((((maxy) - (miny)) * ((risespeed) + (fallspeed))) + ((startpause) + (midpause)))) < ((((maxy) - (miny)) * (risespeed)) + (startpause))> then\n    if <((#) mod ((((maxy) - (miny)) * ((risespeed) + (fallspeed))) + ((startpause) + (midpause)))) < (startpause)> then\n        if <((#) mod ((((maxy) - (miny)) * ((risespeed) + (fallspeed))) + ((startpause) + (midpause)))) < ((startpause) / (3))> then\n            if <((#) mod ((((maxy) - (miny)) * ((risespeed) + (fallspeed))) + ((startpause) + (midpause)))) < [1]> then\n                start sound [Thwomp Sound v]\n            end\n            change [camx v] by (pick random (-5) to (5))\n            change [camy v] by (pick random (-5) to (5))\n        end\n        set [y v] to (miny)\n    else\n        set [y v] to ((miny) + ((((#) mod ((((maxy) - (miny)) * ((risespeed) + (fallspeed))) + ((startpause) + (midpause)))) - (startpause)) / (risespeed)))\n    end\nelse\n    if <((#) mod ((((maxy) - (miny)) * ((risespeed) + (fallspeed))) + ((startpause) + (midpause)))) < ((((maxy) - (miny)) * (risespeed)) + ((startpause) + (midpause)))> then\n        set [y v] to (maxy)\n    else\n        set [y v] to ((miny) + (((maxy) - (miny)) * ([cos v] of ((90) * ((((#) mod ((((maxy) - (miny)) * ((risespeed) + (fallspeed))) + ((startpause) + (midpause)))) - ((((maxy) - (miny)) * (risespeed)) + ((startpause) + (midpause)))) / (((maxy) - (miny)) * (fallspeed)))) )))\n    end\nend\n\ndefine squashbox (-x) (-y) (+x) (+y)\nif <<(-x) < (charX)> and <(charX) < (+x)>> then\n    if <<<(-y) < (charY)> and <(charY) < (+y)>> or <<(-y) < ((charY) + (24))> and <((charY) + (24)) < (+y)>>> then\n        if <(squashed?) = [0]> then\n            set [squashed? v] to [1]\n            set [inair? v] to [0]\n            set [charxvel v] to [0]\n            set [charyvel v] to [0]\n            set [chary v] to (-y)\n        end\n    end\nend\n\ndefine spawn thwomp/chainchomp (x) (miny) (maxy) (thwomp/chainchomp) (#)\nset [# v] to (#)\nset [x v] to (x)\nset [y v] to (miny)\nset [miny v] to (miny)\nset [maxy v] to (maxy)\nset [entitytype v] to (thwomp/chainchomp)\ncreate clone of (_myself_ v)\n\ndefine spawn 1up (x) (y)\nset [entitytype v] to [2]\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [death v]\nwait (2) seconds\ndelete this clone\n\ndefine lift (-x) (-y) (+x) (+y) (dsty)\nchange [test# v] by (1)\nif <<(-x) < ((charX) + (8))> and <((charX) - (8)) < (+x)>> then\n    if <<(-y) < (charY)> and <(charY) < (+y)>> then\n        if <(inair?) = [1]> then\n            set [chary v] to (dsty)\n            set [charyvel v] to [0]\n            set [inair? v] to [0]\n            set [ground? v] to [1]\n        end\n    end\nend\n\ndefine chain chomp collision\nif <([abs v] of (([sin v] of (#) ) * ((maxy) - (miny))) ) < [24]> then\n    if <(hit) = [-20]> then\n        if <((charY) + (18)) < (y)> then\n            set [yref v] to ((y) - ((charY) + (18)))\n        else\n            if <(y) < (charY)> then\n                set [yref v] to ((y) - (charY))\n            else\n                set [yref v] to [0]\n            end\n        end\n        if <((charX) + (6)) < (x)> then\n            set [xref v] to ((x) - ((charX) + (6)))\n        else\n            if <(x) < ((charX) - (6))> then\n                set [xref v] to ((x) - ((charX) - (6)))\n            else\n                set [xref v] to [0]\n            end\n        end\n        if <(((xref) * (xref)) + ((yref) * (yref))) < [1600]> then\n            set [charxvel v] to ((((charX) - (x)) / ([abs v] of ((charX) - (x)) )) * (4))\n            set [charyvel v] to [3]\n            set [inair? v] to [1]\n            set [jumpt v] to [0]\n            start sound (pick random (5) to (7))\n            broadcast (hit v)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(entitytype) = [3]> then\n    forever\n        if <(Paused?) = [0]> then\n            if <<([abs v] of ((x) - (camX)) ) < [240]> and <([abs v] of ((y) - (camY)) ) < [180]>> then\n                play sound (pick random (5) to (7)) until done\n                wait (pick random (4) to (6)) seconds\n            end\n        end\n    end\nend\nif <(entitytype) = [7]> then\n    set volume to (0) %\n    forever\n        if <<([abs v] of ((x) - (charX)) ) < [300]> and <([abs v] of ((y) - (charY)) ) < [300]>> then\n            play sound [Super Mario Galaxy Launch Star Idle Sound v] until done\n        end\n    end\nend\n\nwhen I receive [world map v]\ndelete this clone\n\ndefine spawn star (x) (y)\nset [entitytype v] to [4]\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [win v]\nset [win? v] to [1]\nif <not <(entitytype) = [4]>> then\n    delete this clone\nend\n\ndefine entities level 1\nspawn goomba [200] [-20] [-1]\nspawn star [2280] [650]\nspawn thwomp/chainchomp [686] [280] [380] [1] []\nspawn thwomp/chainchomp [380] [64] [-104] [3] [270]\nspawn thwomp/chainchomp [480] [64] [-104] [3] [180]\nspawn thwomp/chainchomp [580] [64] [-104] [3] [90]\nspawn thwomp/chainchomp [680] [64] [-104] [3] [0]\nspawn thwomp/chainchomp [1200] [504] [336] [3] [1]\nspawn thwomp/chainchomp [1480] [504] [336] [3] [0]\nspawn thwomp/chainchomp [1760] [504] [336] [3] [1]\nspawn thwomp/chainchomp [2040] [504] [336] [3] [0]\nspawn thwomp/chainchomp [1340] [460] [560] [1] [0]\nspawn thwomp/chainchomp [1620] [460] [560] [1] [0]\nspawn thwomp/chainchomp [1900] [460] [560] [1] [0]\nspawn 1up [500] [540]\nspawn 1up [1620] [720]\nset [# v] to [0]\nspawn coin [100] [0]\nspawn coin [120] [0]\nspawn coin [140] [0]\nspawn coin [160] [0]\nspawn coin [180] [0]\nspawn coin [200] [0]\nspawn coin [370] [20]\nspawn coin [390] [20]\nspawn coin [470] [20]\nspawn coin [490] [20]\nspawn coin [570] [20]\nspawn coin [590] [20]\nspawn coin [670] [20]\nspawn coin [690] [20]\nspawn coin [750] [40]\nspawn coin [770] [40]\nspawn coin [1330] [480]\nspawn coin [1350] [480]\nspawn coin [1610] [480]\nspawn coin [1630] [480]\nspawn coin [1890] [480]\nspawn coin [1910] [480]\n\ndefine object | id (id) | position (-x) (-y) (+x) (+y) | extras (move) (walljump)\nif <(render?) = [1]> then\n    if <(id) = [0]> then\n        go to x: (((-x) * (10)) - (camX)) y: (((+x) * (10)) - (camY))\n        pen down\n        set x to (((-y) * (10)) - (camX))\n    else\n        if <(id) = [1]> then\n            if <(move) = [1]> then\n                go to x: (((-x) * (10)) - (camX)) y: (((-y) * (10)) - (camY))\n            else\n                go to x: (((+x) * (10)) - (camX)) y: (((-y) * (10)) - (camY))\n            end\n            pen down\n            set y to (((+y) * (10)) - (camY))\n        else\n            if <(id) = [2]> then\n                go to x: (((-x) * (10)) - (camX)) y: (((+x) * (10)) - (camY))\n                pen down\n                set x to (((-y) * (10)) - (camX))\n            else\n                if <(id) = [4]> then\n                    go to x: (((-x) * (10)) - (camX)) y: (((+x) * (10)) - (camY))\n                    pen down\n                    go to x: (((-y) * (10)) - (camX)) y: ((((+x) * (10)) + (([abs v] of ((-x) - (-y)) ) * (+y))) - (camY))\n                end\n            end\n        end\n    end\n    pen up\nelse\n    if <(id) = [0]> then\n        entity floor ((-x) * (10)) ((-y) * (10)) ((+x) * (10))\n    else\n        if <(id) = [1]> then\n            entity wall ((-x) * (10)) ((-y) * (10)) ((+x) * (10)) ((+y) * (10)) (move)\n        else\n            if <(id) = [2]> then\n                entity ceiling ((-x) * (10)) ((-y) * (10)) ((+x) * (10))\n            end\n        end\n    end\nend\n\ndefine object (string)\ndelete all of [entity unpack v]\nadd (letter (1) of (string)) to [entity unpack v]\nunpack (string) [3] [7]\nadd (#4) to [entity unpack v]\nunpack (string) [9] [13]\nadd (#4) to [entity unpack v]\nunpack (string) [15] [19]\nadd (#4) to [entity unpack v]\nif <(letter (1) of (string)) = [1]> then\n    unpack (string) [21] [25]\n    add (#4) to [entity unpack v]\n    unpack (string) [27] [28]\n    add (#4) to [entity unpack v]\n    add (letter (length of (string)) of (string)) to [entity unpack v]\nelse\n    if <(letter (1) of (string)) = [3]> then\n        add (letter (length of (string)) of (string)) to [entity unpack v]\n    else\n        if <(letter (1) of (string)) = [4]> then\n            unpack (string) [21] [25]\n            add (#4) to [entity unpack v]\n        end\n    end\nend\nobject | id (item (1) of [entity unpack v]) | position (item (2) of [entity unpack v]) (item (3) of [entity unpack v]) (item (4) of [entity unpack v]) (item (5) of [entity unpack v]) | extras (item (6) of [entity unpack v]) (item (7) of [entity unpack v])\n\ndefine unpack (string) (start) (end)\nset [#4 v] to []\nset [#3 v] to [0]\nrepeat (((end) - (start)) + (1))\n    set [#4 v] to (join (#4) (letter ((start) + (#3)) of (string)))\n    change [#3 v] by (1)\nend\nset [#4 v] to ((#4) + (0))\n\nobject (item (33) of [level collisions v])\n\nset [# v] to [0]\nset [entitytype v] to [6]\nset [x v] to [100]\nset [y v] to [100]\nset [maxy v] to [5]\nset [miny v] to [16]\ncreate clone of (_myself_ v)\nset [maxy v] to [5]\nset [miny v] to [32]\ncreate clone of (_myself_ v)\nset [maxy v] to [5]\nset [miny v] to [48]\ncreate clone of (_myself_ v)\nset [maxy v] to [-2]\nset [miny v] to [64]\nrepeat (8)\n    change [# v] by (45)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [win v]\nwait (7.5) seconds\nstop [other scripts in sprite v]\n\nwhen I receive [win v]\nwait (7) seconds\ndelete this clone\n\ndefine rolling chomp movement\nif <(ent-inair?) = [1]> then\n    change [yvel v] by (-0.3)\n    if <[2] < ([abs v] of (Yvel) )> then\n        set [yvel v] to ((Yvel) * (0.98))\n    else\n        if <[1] < ([abs v] of (Yvel) )> then\n            set [yvel v] to ((Yvel) * (0.95))\n        else\n            set [yvel v] to ((Yvel) * (0.9))\n        end\n    end\nelse\n    set [# v] to ((#) * (0.997))\n    set [xvel v] to ((#) * (201.06))\n    set [yvel v] to [0]\nend\nset [entground v] to [0]\ncollisions\n\nunpack [] [] []\n\ndefine entity floor (-x) (+x) (y)\nif <(entitytype) = [9]> then\n    if <<(-x) < (x)> and <(x) < (+x)>> then\n        if <not <(y) < (y)>> then\n            if <((y) + (Yvel)) < (y)> then\n                delete this clone\n            end\n        end\n    end\nelse\n    if <(entitytype) = [10]> then\n        if <<(-x) < ((x) + (12))> and <((x) - (12)) < (+x)>> then\n            if <(ent-inair?) = [1]> then\n                if <not <(y) < (y)>> then\n                    if <((y) + (Yvel)) < (y)> then\n                        set [y v] to (y)\n                        set [ent-inair? v] to [0]\n                        set [entground v] to [1]\n                        set [yvel v] to [0]\n                    end\n                end\n            else\n                if <(y) = (y)> then\n                    set [entground v] to [1]\n                    set [yvel v] to [0]\n                end\n            end\n        end\n    else\n        if <(entitytype) = [0]> then\n            if <<(-x) < ((x) + (8))> and <((x) - (8)) < (+x)>> then\n                if <(ent-inair?) = [1]> then\n                    if <not <(y) < (y)>> then\n                        if <((y) + (Yvel)) < (y)> then\n                            set [y v] to (y)\n                            if <([abs v] of (Yvel) ) < [2]> then\n                                set [ent-inair? v] to [0]\n                                set [entground v] to [1]\n                                set [yvel v] to [0]\n                            else\n                                set [yvel v] to ((Yvel) * (-0.7))\n                            end\n                        end\n                    end\n                else\n                    if <(y) = (y)> then\n                        set [entground v] to [1]\n                        set [yvel v] to [0]\n                    end\n                end\n            end\n        else\n            if <<(-x) < ((x) + (16))> and <((x) - (16)) < (+x)>> then\n                if <(ent-inair?) = [1]> then\n                    if <not <((y) - (32)) < (y)>> then\n                        if <(((y) + (Yvel)) - (32)) < (y)> then\n                            set [y v] to ((y) + (32))\n                            if <([abs v] of (Yvel) ) < [1]> then\n                                set [ent-inair? v] to [0]\n                                set [entground v] to [1]\n                                set [yvel v] to [0]\n                            else\n                                rotation to movement (#) (Xvel) [0]\n                                set [yvel v] to ((Yvel) * (-1))\n                            end\n                        end\n                    end\n                else\n                    if <((y) - (32)) = (y)> then\n                        set [entground v] to [1]\n                        set [yvel v] to [0]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine rotation to movement (r) (m) (type)\nif <(type) = [0]> then\n    set [xvel v] to (((m) + (((r) * (201.06)) * (2))) / (3))\n    set [# v] to (((r) + (((m) / (201.06)) * (2))) / (3))\nelse\n    if <(type) = [2]> then\n        set [xvel v] to (((m) + (((r) * (-201.06)) * (2))) / (3))\n        set [# v] to (((r) + (((m) / (-201.06)) * (2))) / (3))\n    else\n        if <(type) = [1]> then\n            set [yvel v] to (((m) + (((r) * (-201.06)) * (2))) / (3))\n            set [# v] to (((r) + (((m) / (-201.06)) * (2))) / (3))\n        else\n            if <(type) = [3]> then\n                set [yvel v] to (((m) + (((r) * (201.06)) * (2))) / (3))\n                set [# v] to (((r) + (((m) / (201.06)) * (2))) / (3))\n            end\n        end\n    end\nend\n\nwhen I receive [zoomout v]\ndelete this clone\n\ndefine entity ceiling (-x) (+x) (y)\nif <(entitytype) = [9]> then\n    if <<(-x) < (x)> and <(x) < (+x)>> then\n        if <not <(y) < (y)>> then\n            if <(y) < ((y) + (Yvel))> then\n                delete this clone\n            end\n        end\n    end\nelse\n    if <(entitytype) = [8]> then\n        if <<(-x) < ((x) + (16))> and <((x) - (16)) < (+x)>> then\n            if <not <(y) < ((y) - (32))>> then\n                if <(y) < (((y) + (Yvel)) - (32))> then\n                    set [y v] to ((y) - (32))\n                    rotation to movement (#) (Xvel) [2]\n                    set [yvel v] to ((Yvel) * (-1))\n                end\n            end\n        end\n    end\nend\n\ndefine entity wall (-x) (-y) (+x) (+y) (move)\nif <(entitytype) = [9]> then\n    if <<<(-y) < (y)> and <(y) < (+y)>> or <<(-y) < (y)> and <(y) < (+y)>>> then\n        if <[0] < (move)> then\n            if <<not <(-x) < (x)>> and <(-x) < ((x) + (Xvel))>> then\n                delete this clone\n            end\n        else\n            if <<not <(x) < (+x)>> and <((x) + (Xvel)) < (+x)>> then\n                delete this clone\n            end\n        end\n    end\nelse\n    if <(entitytype) = [10]> then\n        if <<<(-y) < ((y) + (24))> and <((y) + (24)) < (+y)>> or <<(-y) < (y)> and <(y) < (+y)>>> then\n            if <[0] < (move)> then\n                if <<not <(-x) < ((x) + (12))>> and <(-x) < (((x) + (Xvel)) + (12))>> then\n                    set [x v] to ((-x) - (12))\n                    set [xvel v] to ((Xvel) * (-1))\n                end\n            else\n                if <<not <((x) - (12)) < (+x)>> and <(((x) + (Xvel)) - (12)) < (+x)>> then\n                    set [x v] to ((+x) + (12))\n                    set [xvel v] to ((Xvel) * (-1))\n                end\n            end\n        end\n    else\n        if <(entitytype) = [0]> then\n            if <<<(-y) < ((y) + (16))> and <((y) + (16)) < (+y)>> or <<(-y) < (y)> and <(y) < (+y)>>> then\n                if <[0] < (move)> then\n                    if <<not <(-x) < ((x) + (8))>> and <(-x) < (((x) + (Xvel)) + (8))>> then\n                        set [x v] to ((-x) - (8))\n                        set [xvel v] to ((Xvel) * (-1))\n                    end\n                else\n                    if <<not <((x) - (8)) < (+x)>> and <(((x) + (Xvel)) - (8)) < (+x)>> then\n                        set [x v] to ((+x) + (8))\n                        set [xvel v] to ((Xvel) * (-1))\n                    end\n                end\n            end\n        else\n            if <<<(-y) < ((y) + (32))> and <((y) + (32)) < (+y)>> or <<(-y) < ((y) - (32))> and <((y) - (32)) < (+y)>>> then\n                if <[0] < (move)> then\n                    if <<not <(-x) < ((x) + (32))>> and <(-x) < (((x) + (Xvel)) + (32))>> then\n                        set [x v] to ((-x) - (32))\n                        set [xvel v] to ((Xvel) * (-1))\n                        rotation to movement (#) (Yvel) [3]\n                    end\n                else\n                    if <<not <((x) - (32)) < (+x)>> and <(((x) + (Xvel)) - (32)) < (+x)>> then\n                        set [x v] to ((+x) + (32))\n                        set [xvel v] to ((Xvel) * (-1))\n                        rotation to movement (#) (Yvel) [1]\n                    end\n                end\n            end\n        end\n    end\nend\n\nset [miny v] to [1]\nwait until <key (space v) pressed?>\nset [x v] to [-100]\nset [y v] to [100]\nset [xvel v] to [6]\nset [yvel v] to [8]\nset [# v] to ((pick random (0) to (4)) / (201.06))\nset [entitytype v] to [8]\nset [maxy v] to [100]\ncreate clone of (_myself_ v)\nset [miny v] to [0]\n\nwhen I start as a clone\nif <(entitytype) = [9]> then\n    set [# v] to [0]\n    forever\n        if <(Paused?) = [0]> then\n            collisions\n            Get Direction ((charX) - (x)) (((charY) - (y)) + (12))\n            if <([abs v] of ((((((maxy) - (miny)) mod (360)) + (180)) mod (360)) - (180)) ) < [3]> then\n            set [# v] to ((#) * (0.9))\n            change [miny v] by (#)\n            set [xvel v] to (((Xvel) * (0.2)) + (([sin v] of (miny) ) * (3)))\n            set [yvel v] to (((Yvel) * (0.2)) + (([cos v] of (miny) ) * (3)))\n            change [x v] by (Xvel)\n            change [y v] by (Yvel)\n        end\n        show\n        set rotation style [all around v]\n        point in direction (90)\n        switch costume to (full v)\n        go to x: ((x) - (camX)) y: ((y) - (camY))\n        switch costume to (bullet bill v)\n        point in direction (miny)\n    end\nelse\n    if <(entitytype) = [10]> then\n        set [miny v] to [0]\n        set [maxy v] to [0]\n        set [# v] to [0]\n        forever\n            show\n            set rotation style [left-right v]\n            if <(miny) = [1]> then\n                point in direction (([abs v] of ((charX) - (x)) ) / ((charX) - (x)))\n            else\n                point in direction (Xvel)\n            end\n            switch costume to (full v)\n            go to x: ((x) - (camX)) y: (((y) - (camY)) + (12))\n            goomba costume\n            if <(Paused?) = [0]> then\n                if <([abs v] of ((charX) - (x)) ) < [12]> then\n                    if <<<(charY) < ((y) + (12))> and <(charYvel) < [0]>> and <<([abs v] of ((charX) - (x)) ) < [10]> and <([abs v] of ((charY) - (y)) ) < [24]>>> then\n                        switch costume to (55 v)\n                        set [charyvel v] to ((charYvel) * (-1))\n                        set [inair? v] to [1]\n                        set [jumpt v] to [0]\n                        repeat (20)\n                            go to x: ((x) - (camX)) y: (((y) - (camY)) + (12))\n                        end\n                        set [entitytype v] to [0]\n                        change [y v] by (12)\n                        set [yvel v] to [6]\n                        set [xvel v] to [0]\n                        create clone of (_myself_ v)\n                        delete this clone\n                    else\n                        if <<<(y) < ((charY) + (24))> and <not <(y) < (charY)>>> or <<((y) + (8)) < ((charY) + (24))> and <not <((y) + (8)) < (charY)>>>> then\n                            set [charxvel v] to ((((charX) - (x)) / ([abs v] of ((charX) - (x)) )) * (4))\n                            set [charyvel v] to [3]\n                            set [inair? v] to [1]\n                            set [jumpt v] to [0]\n                            set [maxy v] to [250]\n                            broadcast (hit v)\n                        end\n                    end\n                end\n                goomba behavior\n                set [entground v] to [0]\n                collisions\n                change [x v] by (Xvel)\n                change [y v] by (Yvel)\n            end\n        end\n    end\nend\n\ndefine Get Direction (dx) (dy)\nif <(dy) = [0]> then\n    if <(dx) > [0]> then\n        set [maxy v] to [90]\n    else\n        set [maxy v] to [-90]\n    end\nelse\n    set [maxy v] to ([atan v] of ((dx) / (dy)) )\n    if <(dy) < [0]> then\n        if <(dx) > [0]> then\n            change [maxy v] by (180)\n        else\n            if <(dx) < [0]> then\n                change [maxy v] by (-180)\n            else\n                set [maxy v] to [180]\n            end\n        end\n    end\nend\n\nset [miny v] to (maxy)\n\ndefine goomba behavior\nif <(entground) = [0]> then\n    set [ent-inair? v] to [1]\nelse\n    set [ent-inair? v] to [0]\nend\nif <(miny) = [1]> then\n    change [maxy v] by (1)\nend\nif <(ent-inair?) = [1]> then\n    change [yvel v] by (-0.5)\n    set [yvel v] to ((Yvel) * (0.9))\nelse\n    set [yvel v] to [0]\n    if <(miny) = [1]> then\n        if <(maxy) = [3]> then\n            set [yvel v] to [3]\n            set [ent-inair? v] to [1]\n        end\n        if <[20] < (maxy)> then\n            change [xvel v] by ((([abs v] of ((charX) - (x)) ) / ((charX) - (x))) / (5))\n            set [xvel v] to ((Xvel) * (0.95))\n        end\n    else\n        set [xvel v] to ((([abs v] of (Xvel) ) / (Xvel)) * (0.7))\n        if <(([abs v] of (Xvel) ) / (Xvel)) = (([abs v] of ((charX) - (x)) ) / ((charX) - (x)))> then\n            if <<([abs v] of ((charX) - (x)) ) < [80]> and <([abs v] of ((charY) - (y)) ) < [40]>> then\n                if <(maxy) = [0]> then\n                    set [# v] to [0]\n                    set [miny v] to [1]\n                    set [xvel v] to [0]\n                end\n            else\n                set [maxy v] to [0]\n            end\n        else\n            set [maxy v] to [0]\n        end\n    end\n    if <[200] < (maxy)> then\n        set [miny v] to [0]\n    end\nend\n\nset [x v] to (pick random (-110) to (-90))\nset [y v] to [50]\nset [miny v] to [0]\nset [entitytype v] to [9]\ncreate clone of (_myself_ v)\n\ndefine goomba costume\nif <(ent-inair?) = [1]> then\n    switch costume to (0020 v)\nelse\n    if <(Paused?) = [0]> then\n        change [# v] by (1)\n    end\n    if <(miny) = [1]> then\n        if <(maxy) < [20]> then\n            switch costume to ((102) + ([floor v] of ((maxy) / (2)) ))\n        else\n            switch costume to ((113) + (([floor v] of ((#) / (2)) ) mod (4)))\n        end\n    else\n        switch costume to ((89) + (([floor v] of ((#) / (2.5)) ) mod (12)))\n    end\nend\n\ndefine spawn goomba (x) (y) (xvel)\nset [x v] to (x)\nset [y v] to (y)\nset [entitytype v] to [10]\nset [xvel v] to (xvel)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [entity? v] to [0]\n\nwhen I start as a clone\nif <(entitytype) = [7]> then\n    set volume to (0) %\n    forever\n        set volume to (0) %\n        wait until <<([abs v] of ((x) - (charX)) ) < [200]> and <([abs v] of ((y) - (charY)) ) < [200]>>\n        set volume to ((#2) * (3)) %\n        wait (0.05) seconds\n    end\nend\n\nwhen I receive [zoomout v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@music\n\ndefine animate\ngo to [front v] layer\nset [# v] to [500]\nset [#2 v] to [1]\nrepeat (60)\n    set [# v] to ((2500) * ((#2) * (#2)))\n    switch costume to (costume1 v)\n    if <[100] < (#)> then\n        set size to (#) %\n        switch costume to (bowser close v)\n    else\n        if <[25] < (#)> then\n            set size to ((#) * (4)) %\n            switch costume to (bowser far v)\n        else\n            if <[6.25] < (#)> then\n                set size to ((#) * (16)) %\n                switch costume to (bowser very far v)\n            else\n                set size to (100) %\n                switch costume to (black v)\n            end\n        end\n    end\n    show\n    if <[0] < (#2)> then\n        change [#2 v] by (-0.022)\n    end\nend\n\nwait (0.8) seconds\nplay sound [Super Mario Galaxy 2 music - Game Over v] until done\n\nwhen I receive [game v]\nset volume to (75) %\nwait (0.1) seconds\nif <(level) = [1]> then\n    forever\n        play sound [Toy Time Galaxy - Super Mario Galaxy Music v] until done\n    end\nelse\n    if <(level) = [2]> then\n        forever\n            play sound [Gusty Garden Galaxy Theme - Super Mario Galaxy v] until done\n        end\n    else\n        if <(level) = [3]> then\n            forever\n                play sound [Spin-Dig Galaxy - Super Mario Galaxy 2 v] until done\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [death v]\nrepeat (10)\n    change volume by (-10)\nend\nstop [other scripts in sprite v]\nset volume to (100) %\nif <[0] < (lives)> then\n    set [#3 v] to [0]\n    create clone of (_myself_ v)\n    set [#3 v] to [1]\n    create clone of (_myself_ v)\n    start sound [Super Mario Galaxy 2 music - Game Over v]\n    change [lives v] by (-1)\n    wait (1.3) seconds\n    show\n    animate\n    wait (3) seconds\n    broadcast (game v)\n    stop [this script v]\nelse\n    hide\n    start sound [Super Mario Galaxy 2 music - Game Over2 v]\n    wait (0.45) seconds\n    show\n    animate 3\n    set [#3 v] to [2]\n    create clone of (_myself_ v)\n    wait (3) seconds\n    set [#3 v] to [3]\n    create clone of (_myself_ v)\n    wait (1) seconds\n    switch costume to (black v)\n    stop [all v]\nend\n\nwhen I receive [fadeout v]\nswitch costume to (costume1 v)\nset size to (100) %\ngo to [front v] layer\nswitch costume to (black v)\nshow\nset [ghost v] effect to (100)\nrepeat (40)\n    change [ghost v] effect by (-2.5)\nend\nwait (0.5) seconds\nbroadcast (game v)\n\nwhen I receive [game v]\nclear graphic effects\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nclear graphic effects\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\nset volume to (100) %\nstart sound [Super Mario Galaxy 2 Music - Power Star Get! v]\nwait (6.5) seconds\nswitch costume to (costume1 v)\nset size to (100) %\nanimate 2\nswitch costume to (black v)\nwait (1) seconds\nbroadcast (zoomout v)\nclear graphic effects\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nclear graphic effects\n\ndefine animate 2\ngo to [front v] layer\nset [# v] to [500]\nset [#2 v] to [1]\nrepeat (36)\n    set [# v] to ((1000) * ((#2) * (#2)))\n    switch costume to (costume1 v)\n    if <[100] < (#)> then\n        set size to (#) %\n        switch costume to (circle med v)\n    else\n        if <[25] < (#)> then\n            set size to ((#) * (4)) %\n            switch costume to (circle small v)\n        else\n            if <[6.25] < (#)> then\n                set size to ((#) * (16)) %\n                switch costume to (circle smaller v)\n            else\n                set size to (100) %\n                switch costume to (black v)\n            end\n        end\n    end\n    show\n    change [#2 v] by (-0.03)\nend\n\nset [ghost v] effect to (100)\nrepeat (40)\n    change [ghost v] effect by (-2.5)\nend\nstop [all v]\n\nwhen I receive [game v]\nforever\n    wait until <(Paused?) = [1]>\n    repeat (12)\n        change volume by (-5)\n    end\n    wait until <(Paused?) = [0]>\n    repeat (12)\n        change volume by (5)\n    end\nend\n\nwhen I start as a clone\ngo to [front v] layer\nif <(#3) = [3]> then\n    switch costume to (costume1 v)\n    set size to (100) %\n    go to [front v] layer\n    switch costume to (black v)\n    show\n    set [ghost v] effect to (100)\n    repeat (40)\n        change [ghost v] effect by (-5)\n    end\n    wait (8) seconds\nend\nif <(#3) = [2]> then\n    go [backward v] (1) layers\n    switch costume to (yellow v)\n    show\n    set [ghost v] effect to (100)\n    repeat (50)\n        change [ghost v] effect by (-2)\n    end\n    wait (8) seconds\nend\nif <(#3) = [0]> then\n    switch costume to (black v)\n    set size to (100) %\n    go to x: (0) y: (0)\n    show\n    set [ghost v] effect to (100)\n    repeat (10)\n        change [ghost v] effect by (-3)\n    end\n    wait (7) seconds\nend\nif <(#3) = [1]> then\n    set size to (120) %\n    set [# v] to [0]\n    set [#2 v] to [80]\n    switch costume to (too bad! v)\n    show\n    set [ghost v] effect to (100)\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to x: (0) y: ([abs v] of (([cos v] of (#) ) * (#2)) )\n        change [# v] by (9)\n    end\n    set [#2 v] to [40]\n    repeat (15)\n        change [ghost v] effect by (-10)\n        go to x: (0) y: ([abs v] of (([cos v] of (#) ) * (#2)) )\n        change [# v] by (12)\n    end\n    set [#2 v] to [20]\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to x: (0) y: ([abs v] of (([cos v] of (#) ) * (#2)) )\n        change [# v] by (18)\n    end\n    set [#2 v] to [10]\n    repeat (6)\n        change [ghost v] effect by (-10)\n        go to x: (0) y: ([abs v] of (([cos v] of (#) ) * (#2)) )\n        change [# v] by (30)\n    end\n    set [#2 v] to [4]\n    repeat (5)\n        change [ghost v] effect by (-10)\n        go to x: (0) y: ([abs v] of (([cos v] of (#) ) * (#2)) )\n        change [# v] by (36)\n    end\n    go to x: (0) y: (0)\n    wait (1) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\ndelete this clone\n\nshow\nanimate\n\ngo to [front v] layer\nset [# v] to [2000]\nset [#2 v] to [1]\nrepeat (50)\n    switch costume to (costume1 v)\n    if <[100] < (#)> then\n        set size to (#) %\n        switch costume to (bowser close v)\n    else\n        if <[25] < (#)> then\n            set size to ((#) * (4)) %\n            switch costume to (bowser far v)\n        else\n            if <[6.25] < (#)> then\n                set size to ((#) * (16)) %\n                switch costume to (bowser very far v)\n            else\n                switch costume to (black v)\n                stop [this script v]\n            end\n        end\n    end\n    change [#2 v] by (-0.02)\n    set [# v] to ((2000) * ((#2) * (#2)))\nend\n\nwhen I receive [game v]\ndelete this clone\n\nswitch costume to (yellow v)\nset size to (100) %\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-3)\nend\n\ndefine animate 3\nset [ghost v] effect to (100)\ngo to [front v] layer\nset [# v] to [500]\nset [#2 v] to [1]\nrepeat (50)\n    change [ghost v] effect by (-5)\n    set [# v] to ((1000) * ((#2) * (#2)))\n    switch costume to (costume1 v)\n    if <[100] < (#)> then\n        point in direction ((((#) - (100)) / (3)) + (90))\n        set size to (#) %\n    else\n        point in direction (90)\n        set size to (100) %\n    end\n    switch costume to (game over v)\n    show\n    if <[0] < (#2)> then\n        change [#2 v] by (-0.02)\n    end\nend\n\nwhen I receive [return to map v]\nwait (0.5) seconds\nrepeat (10)\n    change volume by (-10)\nend\nstop [other scripts in sprite v]\nstop all sounds\nset volume to (100) %\n\n@sound effects\n\nwhen I receive [coin v]\nif <((coins) mod (50)) = [0]> then\n    broadcast (1up v)\nelse\n    if <(#) = [0]> then\n        start sound [Super Mario Galaxy Gold Coin Pickup Sound v]\n        set [# v] to [1]\n    else\n        if <(#) = [1]> then\n            start sound [Super Mario Galaxy Gold Coin Pickup Sound2 v]\n            set [# v] to [2]\n        else\n            start sound [Super Mario Galaxy Gold Coin Pickup Sound3 v]\n            set [# v] to [0]\n        end\n    end\nend\n\nbroadcast (game v)\n\nwhen I receive [death v]\nif <(black hole?) = [1]> then\n    start sound [The Sounds of the Black Hole \(from mario galaxy\) v]\nend\n\nwhen I receive [1up v]\nstart sound [Super Mario Galaxy 1-UP Mushroom Pickup Sound v]\nchange [lives v] by (1)\n\nwhen I receive [death v]\nwait (3) seconds\nstop [other scripts in sprite v]\nstop [this script v]\n\n@ui\n\nwhen I start as a clone\nshow\nif <(id) = [0]> then\n    forever\n        show\n        set size to (100) %\n        switch costume to (lives3 v)\n    end\nelse\n    if <(id) = [1]> then\n        forever\n            show\n            switch costume to ((37) + (letter (1) of (lives)))\n        end\n    else\n        if <(id) = [2]> then\n            forever\n                if <[1] < (length of (lives))> then\n                    show\n                    switch costume to ((37) + (letter (2) of (lives)))\n                else\n                    hide\n                end\n            end\n        else\n            if <(id) = [3]> then\n                forever\n                    if <[2] < (length of (lives))> then\n                        show\n                        switch costume to ((37) + (letter (3) of (lives)))\n                    else\n                        hide\n                    end\n                end\n            else\n                if <(id) = [4]> then\n                    switch costume to (coins3 v)\n                    set size to (100) %\n                    forever\n                        show\n                        set x to ((170) - ((28) * ((length of (coins)) - (1))))\n                    end\n                else\n                    if <(id) = [5]> then\n                        forever\n                            show\n                            switch costume to ((37) + (letter (1) of (coins)))\n                            set x to ((214) - ((28) * ((length of (coins)) - (1))))\n                        end\n                    else\n                        if <(id) = [6]> then\n                            forever\n                                if <[1] < (length of (coins))> then\n                                    show\n                                    switch costume to ((37) + (letter (2) of (coins)))\n                                    set x to ((214) - ((28) * ((length of (coins)) - (2))))\n                                else\n                                    hide\n                                end\n                            end\n                        else\n                            if <(id) = [7]> then\n                                forever\n                                    if <[2] < (length of (coins))> then\n                                        show\n                                        switch costume to ((37) + (letter (3) of (coins)))\n                                        set x to ((214) - ((28) * ((length of (coins)) - (3))))\n                                    else\n                                        hide\n                                    end\n                                end\n                            else\n                                if <(id) = [9]> then\n                                    forever\n                                        show\n                                        set size to (100) %\n                                        switch costume to (stars v)\n                                    end\n                                else\n                                    if <(id) = [10]> then\n                                        forever\n                                            show\n                                            switch costume to ((37) + (letter (1) of (stars)))\n                                        end\n                                    else\n                                        if <(id) = [11]> then\n                                            forever\n                                                if <[1] < (length of (stars))> then\n                                                    show\n                                                    switch costume to ((37) + (letter (2) of (stars)))\n                                                else\n                                                    hide\n                                                end\n                                            end\n                                        else\n                                            if <(id) = [12]> then\n                                                forever\n                                                    if <[2] < (length of (stars))> then\n                                                        show\n                                                        switch costume to ((37) + (letter (3) of (stars)))\n                                                    else\n                                                        hide\n                                                    end\n                                                end\n                                            else\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [game v]\neval stars\nset [id v] to [0]\nswitch costume to (lives v)\ngo to x: (-184) y: (-140)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\nswitch costume to (0 v)\nset y to (-144)\nchange x by (48)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\nchange x by (28)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\nchange x by (28)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\nswitch costume to (coins v)\ngo to x: (170) y: (-140)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\nset y to (-144)\nchange x by (44)\nswitch costume to (0 v)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\ngo to x: (180) y: (120)\nswitch costume to (powerempty v)\ncreate clone of (_myself_ v)\nset [id v] to [9]\nswitch costume to (lives v)\ngo to x: (-184) y: (140)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\nswitch costume to (0 v)\nset y to (138)\nchange x by (44)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\nchange x by (28)\ncreate clone of (_myself_ v)\nchange [id v] by (1)\nchange x by (28)\ncreate clone of (_myself_ v)\nset [hide lives? v] to [0]\nset [hidden timer v] to [100]\nforever\n    if <(Paused?) = [1]> then\n        set [hide lives? v] to [0]\n        set [hidden timer v] to [100]\n    else\n        if <[0] < (hidden timer)> then\n            change [hidden timer v] by (-1)\n        else\n            set [hide lives? v] to [1]\n            set [hidden timer v] to [0]\n        end\n    end\nend\n\nwhen I receive [coin v]\nif <<[4] < (id)> and <(id) < [8]>> then\n    set [# v] to [0]\n    repeat (6)\n        change [# v] by (30)\n        set [brightness v] effect to (([sin v] of (#) ) * (50))\n        set y to ((([sin v] of (#) ) * (6)) - (144))\n    end\nend\n\nwhen I receive [1up v]\nif <<(id) < [4]> and <not <(id) = [0]>>> then\n    set [hide lives? v] to [0]\n    set [hidden timer v] to [100]\n    wait (0.7) seconds\n    set [# v] to [0]\n    repeat (6)\n        change [# v] by (30)\n        set [brightness v] effect to (([sin v] of (#) ) * (50))\n        set y to ((([sin v] of (#) ) * (6)) - (144))\n    end\nend\n\nwhen I receive [death v]\ndelete this clone\n\nwhen flag clicked\nif <key (1 v) pressed?> then\n    set [variant v] to [1]\nelse\n    set [variant v] to [0]\nend\n\nwhen I start as a clone\nset [x v] to (x position)\nset [#2 v] to [0]\nif <<(id) < [4]> or <[8] < (id)>> then\n    clear graphic effects\n    forever\n        set x to ((x) + ((([cos v] of ((4.5) * (#2)) ) - (1)) * (90)))\n        if <(hide lives?) = [1]> then\n            if <(#2) < [20]> then\n                change [#2 v] by (1)\n                change [ghost v] effect by (10)\n            else\n                set [#2 v] to [20]\n            end\n        else\n            if <[0] < (#2)> then\n                change [#2 v] by (-1)\n                change [ghost v] effect by (-10)\n            else\n                set [#2 v] to [0]\n            end\n        end\n    end\nend\n\nset [#2 v] to [0]\n\nwhen I start as a clone\nif <(id) = [8]> then\n    set [x v] to (x position)\n    set [#2 v] to [0]\n    show\n    clear graphic effects\n    forever\n        switch costume to (full v)\n        set x to ((x) + (((1) - ([cos v] of ((9) * (#2)) )) * (90)))\n        if <(health) = [3]> then\n            switch costume to (full2 v)\n        else\n            if <(health) = [2]> then\n                switch costume to (med v)\n            else\n                switch costume to (low v)\n            end\n        end\n        if <<(hide lives?) = [1]> and <(health) = [3]>> then\n            if <(#2) < [20]> then\n                change [#2 v] by (1)\n                change [ghost v] effect by (10)\n            else\n                set [#2 v] to [20]\n            end\n        else\n            if <[0] < (#2)> then\n                change [#2 v] by (-1)\n                change [ghost v] effect by (-10)\n            else\n                set [#2 v] to [0]\n            end\n        end\n    end\nend\n\nif <(health) = [1]> then\n\nwhen I receive [win v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\ndefine eval stars\nset [stars v] to [0]\nset [# v] to [0]\nrepeat (length of [stars v])\n    change [# v] by (1)\n    change [stars v] by (item (#) of [stars v])\nend\n\nwhen I receive [zoomout v]\ndelete this clone\n\nwhen I receive [return to map v]\nstop [other scripts in sprite v]\n\n@world map\n\nwhen I receive [world map v]\nset volume to (100) %\nforever\n    \nend\n\nwhen I receive [game v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\ndefine movement <left> <right> <up> <down>\nif <(<right> - <left>) = [0]> then\n    if <([abs v] of (<up> - <down>) ) = [1]> then\n        set [l/r? v] to (<right> - <left>)\n    end\nelse\n    set [l/r? v] to (<right> - <left>)\nend\nif <(<up> - <down>) = [0]> then\n    if <([abs v] of (<right> - <left>) ) = [1]> then\n        set [u/d v] to (<up> - <down>)\n    end\nelse\n    set [u/d v] to (<up> - <down>)\nend\nif <(inair?) = [0]> then\n    change [charxvel v] by (<right> - <left>)\n    change [charyvel v] by (<up> - <down>)\n    if <((<right> + <left>) + (<up> + <down>)) = [0]> then\n        set [charxvel v] to ((charXvel) * (0.8))\n        set [charyvel v] to ((charYvel) * (0.8))\n    else\n        set [charxvel v] to ((charXvel) * (0.85))\n        set [charyvel v] to ((charYvel) * (0.85))\n    end\nend\nset [charx' v] to (charX)\nset [chary' v] to (charY)\nchange [charx v] by (charXvel)\nchange [chary v] by (charYvel)\n\nwhen I receive [zoomout v]\nhide\nclear graphic effects\nswitch costume to (empty v)\nset size to (140) %\nswitch costume to (mapbg v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nset [id v] to [0]\ncreate clone of (_myself_ v)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nset [inair? v] to [2]\nset [cam2x v] to [0]\nset [cam2y v] to [0]\nrepeat until <not <(inair?) = [2]>>\n    erase all\n    if <(start?) = [0]> then\n        set [cam2x v] to ((((cam2x) * (2)) + ((mouse x) * (0.2))) / (3))\n        set [cam2y v] to ((((((cam2y) - (40)) * (2)) + ((mouse y) * (0.2))) / (3)) + (40))\n    end\n    go to x: ((cam2x) / (2)) y: (((cam2y) - (40)) / (2))\n    stamp\nend\n\nwhen I start as a clone\nset [level set? v] to [0]\nset rotation style [don't rotate v]\nif <(id) = [0]> then\n    switch costume to (galaxy info plate v)\n    forever\n        go to x: (0) y: (12)\n        set size to (100) %\n        if <(level) = [1]> then\n            if <(item (1) of [stars v]) = [1]> then\n                switch costume to (galaxy info plate star v)\n            else\n                switch costume to (galaxy info plate v)\n            end\n        end\n        show\n    end\nelse\n    if <(id) = [1]> then\n        switch costume to (empty v)\n        forever\n            go to x: (0) y: (12)\n            set size to (100) %\n            show\n            if <(level) = [1]> then\n                switch costume to (tutorial plate v)\n            end\n        end\n    else\n        if <(id) = [2]> then\n            set [# v] to [0]\n            set [clicked? v] to [0]\n            forever\n                draw streak [2] [180] [180] [100] [1]\n                change [# v] by (0.2)\n                set [x v] to (([sin v] of (#) ) * (180))\n                set [y v] to (([cos v] of (#) ) * (100))\n                go to x: ((x) - (cam2x)) y: ((y) - (cam2y))\n                switch costume to (full v)\n                set size to ((((2) + (mouse?)) / (3)) * (120)) %\n                switch costume to (planet v)\n                if <(level set?) = [0]> then\n                    set [mouse? v] to ((((<touching (mouse-pointer v)?> * ((1) - (clicked?))) + ((3) * (clicked?))) + (mouse?)) / (2))\n                    if <touching (mouse-pointer v)?> then\n                        set [level v] to [1]\n                        if <mouse down?> then\n                            set [clicked? v] to [1]\n                            set [level set? v] to [1]\n                        end\n                    end\n                end\n                if <(clicked?) = [1]> then\n                    set [cam2x v] to ((((cam2x) * (9)) + (x)) / (10))\n                    set [cam2y v] to ((((cam2y) * (9)) + (y)) / (10))\n                end\n            end\n        else\n            if <(id) = [3]> then\n                set [# v] to [40]\n                set [clicked? v] to [0]\n                forever\n                    draw streak [2] [180] [110] [80] [0.8]\n                    change [# v] by (0.3)\n                    set [x v] to (([sin v] of (#) ) * (110))\n                    set [y v] to (([cos v] of (#) ) * (80))\n                    go to x: ((x) - ((cam2x) * (0.8))) y: ((y) - ((cam2y) * (0.8)))\n                    switch costume to (full v)\n                    set size to ((((2) + (mouse?)) / (3)) * (100)) %\n                    switch costume to (extraplan v)\n                    if <(item (1) of [stars v]) = [1]> then\n                        if <(level set?) = [0]> then\n                            set [mouse? v] to (((<touching (mouse-pointer v)?> * ((1) - (clicked?))) + (mouse?)) / (2))\n                            if <touching (mouse-pointer v)?> then\n                                set [level v] to [2]\n                                if <mouse down?> then\n                                    set [clicked? v] to [1]\n                                    set [level set? v] to [1]\n                                end\n                            end\n                        end\n                        if <(clicked?) = [1]> then\n                            set [cam2x v] to ((((cam2x) * (9)) + (x)) / (10))\n                            set [cam2y v] to ((((cam2y) * (9)) + (y)) / (10))\n                        end\n                    else\n                        set [mouse? v] to (((<touching (mouse-pointer v)?> * ((1) - (clicked?))) + (mouse?)) / (2))\n                        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                            set [mouse? v] to ((mouse?) * (0.5))\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nshow\n\nwhen I start as a clone\nset [start? v] to [0]\nwait until <(clicked?) = [1]>\nset [start? v] to [1]\nwait (0.5) seconds\nbroadcast (fadeout v)\n\ndefine draw streak (res) (distance) (width) (height) (m)\nset pen size to (3)\nset pen color to (#3d8eff)\nset pen (transparency v) to (40)\nrepeat (2)\n    switch costume to (full v)\n    change [# v] by (((distance) * (res)) * (-1))\n    repeat (distance)\n        go to x: ((([sin v] of (#) ) * (width)) - ((cam2x) * (m))) y: ((([cos v] of (#) ) * (height)) - ((cam2y) * (m)))\n        pen down\n        change [# v] by (res)\n    end\n    pen up\n    set pen size to (1)\n    set pen color to (#79ffff)\n    set pen (transparency v) to (0)\nend\n\nwhen I receive [fadeout v]\nrepeat (25)\n    change volume by (-4)\nend\nstop all sounds\n\ndefine Get Direction (dx) (dy)\nif <(dy) = [0]> then\n    if <(dx) > [0]> then\n        set [@get direction v] to [90]\n    else\n        set [@get direction v] to [-90]\n    end\nelse\n    set [@get direction v] to ([atan v] of ((dx) / (dy)) )\n    if <(dy) < [0]> then\n        if <(dx) > [0]> then\n            change [@get direction v] by (180)\n        else\n            if <(dx) < [0]> then\n                change [@get direction v] by (-180)\n            else\n                set [@get direction v] to [180]\n            end\n        end\n    end\nend\n\nwhen I receive [zoomout v]\nset volume to (100) %\nforever\n    play sound [Super Mario Galaxy 2 Soundtrack - World 1/2 v] until done\nend\n\n@level\n\ndefine draw block (x-shift) (y-shift) (tilex) (tiley) (costume)\nset [costume v] to (costume)\nset [x v] to ((x-shift) + ((480) * (tilex)))\nset [y v] to ((y-shift) + ((360) * (tiley)))\ncreate clone of (_myself_ v)\n\ndefine create level (x-shift) (y-shift)\nif <(level) = [1]> then\n    draw block (x-shift) (y-shift) [0] [0] [4]\n    draw block (x-shift) (y-shift) [1] [0] [5]\n    draw block (x-shift) (y-shift) [2] [0] [6]\n    draw block (x-shift) (y-shift) [1] [1] [7]\n    draw block (x-shift) (y-shift) [2] [1] [8]\n    draw block (x-shift) (y-shift) [3] [1] [9]\n    draw block (x-shift) (y-shift) [4] [1] [10]\nelse\n    draw block (x-shift) (y-shift) [0] [0] [17]\n    draw block (x-shift) (y-shift) [1] [0] [18]\n    draw block (x-shift) (y-shift) [3] [2] [19]\n    draw block (x-shift) (y-shift) [4] [2] [20]\n    draw block (x-shift) (y-shift) [5] [2] [21]\n    draw block (x-shift) (y-shift) [7] [1] [22]\n    draw block (x-shift) (y-shift) [8] [1] [23]\nend\n\nwhen I receive [game v]\nerase all\nif <(level) = [1]> then\n    create level [190] [80]\nelse\n    if <(level) = [2]> then\n        create level [100] [-40]\n    end\nend\nforever\n    hide\n    if <(level) = [1]> then\n        erase all\n        render bg [3] [0.2]\n    else\n        if <(level) = [2]> then\n            erase all\n            render bg [14] [0.1]\n            render bg [15] [0.2]\n        end\n    end\nend\n\nrender bg [13] []\n\nrender bg [13] []\n\nwhen I start as a clone\nforever\n    hide\n    if <([abs v] of ((x) - (camX)) ) < [480]> then\n        if <([abs v] of ((y) - (camY)) ) < [360]> then\n            show\n            switch costume to (empty v)\n            set size to (100) %\n            switch costume to (full v)\n            go to x: ((x) - (camX)) y: ((y) - (camY))\n        end\n    end\n    switch costume to (costume)\nend\n\ndefine render bg (#) (offset)\npoint in direction (90)\nswitch costume to (empty v)\nset size to (100) %\nswitch costume to (full v)\ngo to x: (([floor v] of ((camX) * ((offset) * (-1))) ) mod (480)) y: (0)\nswitch costume to (#)\nstamp\nswitch costume to (full v)\ngo to x: ((([floor v] of ((camX) * ((offset) * (-1))) ) mod (480)) - (480)) y: (0)\nswitch costume to (#)\nstamp\n\nwhen I receive [death v]\nif <[0] < (lives)> then\n    wait (3) seconds\n    delete this clone\nend\n\nwhen I receive [win v]\nwait (8) seconds\ndelete this clone\n\nwhen I receive [zoomout v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@mario\n\ndefine Get Direction (dx) (dy)\nif <(dy) = [0]> then\n    if <(dx) > [0]> then\n        set [@get direction v] to [90]\n    else\n        set [@get direction v] to [-90]\n    end\nelse\n    set [@get direction v] to ([atan v] of ((dx) / (dy)) )\n    if <(dy) < [0]> then\n        if <(dx) > [0]> then\n            change [@get direction v] by (180)\n        else\n            if <(dx) < [0]> then\n                change [@get direction v] by (-180)\n            else\n                set [@get direction v] to [180]\n            end\n        end\n    end\nend\n\ndefine select costume\nset rotation style [left-right v]\npoint in direction ((l/r?) * (90))\nset [prevstate v] to (state)\nif <(squashed?) = [1]> then\n    set [state v] to [squashed]\nelse\n    if <(inair?) = [1]> then\n        if <<(launch star?) = [0]> or <(launch star?) = [2]>> then\n            if <([abs v] of (onwall?) ) = [1]> then\n                set [state v] to [wallslide]\n            else\n                if <(jumpt) = [0]> then\n                    set [state v] to [jump]\n                else\n                    if <(jumpt) = [2]> then\n                        set [state v] to [longjump]\n                    else\n                        if <(jumpt) = [1]> then\n                            set [state v] to [highjump]\n                        else\n                            if <(jumpt) = [5]> then\n                                set [state v] to [spinair]\n                            else\n                                set [state v] to [fall]\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            set [state v] to [launch]\n        end\n    else\n        if <key (s v) pressed?> then\n            set [state v] to [crouch]\n        else\n            if <([abs v] of (charXvel) ) < [1]> then\n                set [state v] to [stand]\n            else\n                set [state v] to [run]\n            end\n        end\n    end\nend\nif <not <(state) = (prevstate)>> then\n    set [# v] to [0]\n    if <(prevstate) = [launch]> then\n        start sound [B70kawa_4 v]\n    end\nend\nif <(state) = [squashed]> then\n    switch costume to (0108 v)\nelse\n    if <(state) = [crouch]> then\n        switch costume to (0034 v)\n    else\n        if <(state) = [stand]> then\n            change [# v] by (0.5)\n            switch costume to ((63) + (([floor v] of (#) ) mod (29)))\n        else\n            if <(state) = [run]> then\n                change [# v] by (([abs v] of (charXvel) ) / (6))\n                if <(#) < [16]> then\n                    if <([abs v] of (charXvel) ) < [3]> then\n                        switch costume to ((3) + (([floor v] of (#) ) mod (16)))\n                    else\n                        switch costume to ((18) + (([floor v] of (#) ) mod (16)))\n                    end\n                else\n                    switch costume to ((18) + (([floor v] of (#) ) mod (16)))\n                end\n            else\n                if <(state) = [wallslide]> then\n                    point in direction ((onwall?) * (-90))\n                    switch costume to (0059 v)\n                else\n                    if <(state) = [jump]> then\n                        switch costume to (0033 v)\n                    else\n                        if <(state) = [longjump]> then\n                            if <[20] < (#)> then\n                                switch costume to (0058 v)\n                            else\n                                switch costume to ((48) + (((#) * (2)) / (3)))\n                                change [# v] by (1)\n                            end\n                        else\n                            if <(state) = [highjump]> then\n                                if <(#) < [8]> then\n                                    switch costume to ((38) + (((#) * (2)) / (3)))\n                                else\n                                    if <[12] < (#)> then\n                                        if <(#) < [18]> then\n                                            switch costume to ((37) + ((((#) - (4)) * (2)) / (3)))\n                                            change [# v] by (-0.5)\n                                        else\n                                            switch costume to (0043 v)\n                                        end\n                                    end\n                                end\n                                change [# v] by (1)\n                            else\n                                if <(state) = [launch]> then\n                                    Get Direction (charXvel) (charYvel)\n                                    point in direction (@Get Direction)\n                                    set rotation style [all around v]\n                                    change [# v] by (1)\n                                    if <(#) < [12]> then\n                                        switch costume to ((145) + ((#) mod (6)))\n                                    else\n                                        switch costume to ((129) + (((#) / (1.5)) mod (16)))\n                                    end\n                                else\n                                    if <(state) = [spinair]> then\n                                        if <(#) < [17]> then\n                                            switch costume to ((93) + (#))\n                                        else\n                                            switch costume to (0107 v)\n                                        end\n                                        change [# v] by (1)\n                                    else\n                                        if <(state) = [spingnd]> then\n                                            if <(#) < [17]> then\n                                                switch costume to ((112) + (#))\n                                            else\n                                                set [state v] to [stand]\n                                            end\n                                            change [# v] by (1)\n                                        else\n                                            switch costume to (0043 v)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [game v]\nset [prevstate v] to [jump]\nset [state v] to [jump]\nset volume to (30) %\nforever\n    if <(Paused?) = [0]> then\n        switch costume to (full v)\n        go to x: ((charX) - (camX)) y: ((((charY) - (camY)) + (18)) + ((gravity) * (-12)))\n        switch costume to (prevcostume)\n        select costume\n        set [prevcostume v] to (costume [number v])\n    end\nend\n\nwhen I receive [death v]\nwait (3) seconds\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nhide\n\nwhen I receive [game v]\nshow\ngo to [front v] layer\ngo [backward v] (5) layers\nwait (0.2) seconds\ngo to [front v] layer\ngo [backward v] (5) layers\n\nswitch costume to ((costume [number v]) + ((gravity) * (-46)))\nswitch costume to ((costume [number v]) + ((gravity) * (46)))\n\n\n    switch costume to (0028 v)\nelse\n    if <[8] < (#)> then\n        if <[11] < (#)> then\n            switch costume to ((20) + ((((#) - (2)) * (2)) / (3)))\n        end\n        change [# v] by (0.5)\n    end\nend\n\nwhen I receive [zoomout v]\nhide\nstop [other scripts in sprite v]\n\nif <([abs v] of (charXvel) ) < [4]> then\n    change [# v] by ((5) / ([abs v] of (charXvel) ))\nelse\n    change [# v] by (([abs v] of (charXvel) ) / (4))\nend\nswitch costume to ((18) + (([floor v] of (#) ) mod (16)))\n\nif <not <(state) = [spingnd]>> then\n    if <key (space v) pressed?> then\n        set [state v] to [spingnd]\n    end\nend\n\n@level manager\n\ndefine object | id (id) | position (-x) (-y) (+x) (+y) | extras (move) (walljump)\ndelete all of [collider v]\nif <(id) = [0]> then\n    add (id) to [collider v]\n    expand value (-x)\n    add (#) to [collider v]\n    expand value (-y)\n    add (#) to [collider v]\n    expand value (+x)\n    add (#) to [collider v]\nelse\n    if <(id) = [1]> then\n        add (id) to [collider v]\n        expand value (-x)\n        add (#) to [collider v]\n        expand value (-y)\n        add (#) to [collider v]\n        expand value (+x)\n        add (#) to [collider v]\n        expand value (+y)\n        add (#) to [collider v]\n        set [# v] to ([abs v] of (move) )\n        if <(move) < [0]> then\n            set [# v] to (join [-] (#))\n        else\n            set [# v] to (join [0] (#))\n        end\n        add (#) to [collider v]\n        add (walljump) to [collider v]\n    else\n        if <(id) = [2]> then\n            add (id) to [collider v]\n            expand value (-x)\n            add (#) to [collider v]\n            expand value (-y)\n            add (#) to [collider v]\n            expand value (+x)\n            add (#) to [collider v]\n        else\n            if <(id) = [3]> then\n                add (id) to [collider v]\n                expand value (-x)\n                add (#) to [collider v]\n                expand value (-y)\n                add (#) to [collider v]\n                expand value (+x)\n                add (#) to [collider v]\n                add (+y) to [collider v]\n            else\n                if <(id) = [4]> then\n                    add (id) to [collider v]\n                    expand value (-x)\n                    add (#) to [collider v]\n                    expand value (-y)\n                    add (#) to [collider v]\n                    expand value (+x)\n                    add (#) to [collider v]\n                    expand value (+y)\n                    add (#) to [collider v]\n                end\n            end\n        end\n    end\nend\nadd (collider) to [level collisions v]\n\ndefine expand value (x)\nset [# v] to ([abs v] of (x) )\nrepeat (4)\n    if <(length of (#)) < [4]> then\n        set [# v] to (join [0] (#))\n    end\nend\nif <(x) < [0]> then\n    set [# v] to (join [-] (#))\nelse\n    set [# v] to (join [0] (#))\nend\n\nwhen I receive [game v]\nif <(level) = [2]> then\n    delete all of [level collisions v]\n    object | id [3] | position [-50] [0] [-30] [2] | extras [] []\n    object | id [0] | position [-10] [78] [0] [] | extras [] []\n    object | id [0] | position [52] [69] [4] [] | extras [] []\n    object | id [0] | position [64] [76] [8] [] | extras [] []\n    object | id [0] | position [58] [72] [12] [] | extras [] []\n    object | id [1] | position [-10] [-12] [-7] [0] | extras [1] [1]\n    object | id [1] | position [75] [-18] [78] [0] | extras [-1] [1]\n    object | id [0] | position [134] [154] [78] [] | extras [] []\n    object | id [1] | position [151] [70] [154] [78] | extras [-1] [1]\n    object | id [1] | position [134] [70] [137] [78] | extras [1] [1]\n    object | id [0] | position [162] [172] [80] [] | extras [] []\n    object | id [0] | position [172] [180] [84] [] | extras [] []\n    object | id [0] | position [180] [200] [72] [] | extras [] []\n    object | id [0] | position [200] [220] [64] [] | extras [] []\n    object | id [0] | position [220] [230] [66] [] | extras [] []\n    object | id [1] | position [162] [64] [165] [80] | extras [1] [1]\n    object | id [1] | position [172] [80] [175] [84] | extras [1] [1]\n    object | id [1] | position [177] [72] [180] [84] | extras [-1] [1]\n    object | id [1] | position [197] [64] [200] [72] | extras [-1] [1]\n    object | id [1] | position [220] [63] [223] [66] | extras [1] [0]\n    object | id [1] | position [227] [60] [230] [66] | extras [-1] [1]\n    object | id [0] | position [326] [342] [38] [] | extras [] []\n    object | id [0] | position [342] [354] [34] [] | extras [] []\n    object | id [0] | position [354] [366] [36] [] | extras [] []\n    object | id [0] | position [366] [378] [32] [] | extras [] []\n    object | id [0] | position [378] [386] [34] [] | extras [] []\n    object | id [0] | position [386] [398] [38] [] | extras [] []\n    object | id [1] | position [326] [22] [329] [38] | extras [1] [1]\n    object | id [1] | position [339] [22] [342] [38] | extras [-1] [1]\n    object | id [1] | position [354] [24] [357] [36] | extras [1] [0]\n    object | id [1] | position [363] [34] [366] [36] | extras [-1] [1]\n    object | id [1] | position [378] [26] [381] [34] | extras [1] [0]\n    object | id [1] | position [386] [28] [389] [38] | extras [1] [1]\n    object | id [1] | position [395] [28] [398] [38] | extras [-1] [1]\nend\n\nwhen I receive [game v]\nif <(level) = [1]> then\n    delete all of [level collisions v]\n    object | id [3] | position [-20] [0] [-30] [2] | extras [] []\n    object | id [0] | position [-5] [5] [0] [] | extras [] []\n    object | id [0] | position [2] [28] [-2] [] | extras [] []\n    object | id [0] | position [25] [33] [2] [] | extras [] []\n    object | id [0] | position [33] [75] [0] [] | extras [] []\n    object | id [0] | position [73] [85] [2] [] | extras [] []\n    object | id [0] | position [85] [99] [6] [] | extras [] []\n    object | id [0] | position [95] [103] [10] [] | extras [] []\n    object | id [0] | position [91] [99] [14] [] | extras [] []\n    object | id [0] | position [79] [95] [16] [] | extras [] []\n    object | id [0] | position [103] [111] [18] [] | extras [] []\n    object | id [0] | position [107] [113] [22] [] | extras [] []\n    object | id [0] | position [89] [109] [24] [] | extras [] []\n    object | id [0] | position [53] [93] [28] [] | extras [] []\n    object | id [0] | position [75] [89] [44] [] | extras [] []\n    object | id [0] | position [85] [105] [48] [] | extras [] []\n    object | id [0] | position [103] [115] [46] [] | extras [] []\n    object | id [0] | position [113] [213] [44] [] | extras [] []\n    object | id [0] | position [125] [143] [46] [] | extras [] []\n    object | id [0] | position [153] [171] [46] [] | extras [] []\n    object | id [0] | position [181] [199] [46] [] | extras [] []\n    object | id [0] | position [209] [227] [46] [] | extras [] []\n    object | id [0] | position [221] [235] [50] [] | extras [] []\n    object | id [0] | position [215] [229] [54] [] | extras [] []\n    object | id [0] | position [223] [233] [58] [] | extras [] []\n    object | id [0] | position [45] [55] [54] [] | extras [] []\n    object | id [2] | position [-5] [33] [-6] [] | extras [] []\n    object | id [2] | position [85] [99] [-8] [] | extras [] []\n    object | id [2] | position [45] [55] [22] [] | extras [] []\n    object | id [2] | position [75] [89] [38] [] | extras [] []\n    object | id [2] | position [88] [105] [40] [] | extras [] []\n    object | id [2] | position [210] [227] [36] [] | extras [] []\n    object | id [1] | position [-5] [-6] [-3] [0] | extras [1] [1]\n    object | id [1] | position [3] [-6] [5] [0] | extras [-1] [1]\n    object | id [1] | position [25] [-4] [27] [2] | extras [1] [1]\n    object | id [1] | position [31] [-6] [33] [2] | extras [-1] [1]\n    object | id [1] | position [73] [-6] [75] [2] | extras [1] [1]\n    object | id [1] | position [85] [-6] [87] [6] | extras [1] [1]\n    object | id [1] | position [85] [-8] [99] [6] | extras [-1] [1]\n    object | id [1] | position [53] [22] [55] [54] | extras [-1] [1]\n    object | id [1] | position [45] [22] [47] [54] | extras [1] [1]\n    object | id [1] | position [75] [38] [77] [44] | extras [1] [1]\n    object | id [1] | position [87] [38] [89] [44] | extras [-1] [1]\n    object | id [1] | position [85] [43] [90] [48] | extras [1] [1]\n    object | id [1] | position [103] [43] [105] [48] | extras [-1] [1]\n    object | id [1] | position [113] [36] [115] [46] | extras [-1] [1]\n    object | id [1] | position [101] [36] [103] [42] | extras [1] [1]\n    object | id [1] | position [125] [42] [127] [46] | extras [1] [1]\n    object | id [1] | position [141] [42] [143] [46] | extras [-1] [1]\n    object | id [1] | position [153] [42] [155] [46] | extras [1] [1]\n    object | id [1] | position [169] [42] [171] [46] | extras [-1] [1]\n    object | id [1] | position [181] [42] [183] [46] | extras [1] [1]\n    object | id [1] | position [197] [42] [199] [46] | extras [-1] [1]\n    object | id [1] | position [209] [42] [211] [46] | extras [1] [1]\n    object | id [1] | position [225] [36] [227] [46] | extras [-1] [1]\nend\n\nwhen flag clicked\ndelete all of [stars v]\nadd [0] to [stars v]\n\nwhen I receive [win v]\nif <(level) = [1]> then\n    replace item (1) of [stars v] with [1]\nend\n\nset [launch star? v] to [0]\nset [charx v] to [3340]\nset [chary v] to [380]\n\nwhen flag clicked\nforever\n    set [mousex v] to (round (((mouse x) + (camX)) / (10)))\n    set [mousey v] to (round (((mouse y) + (camY)) / (10)))\nend\n\nwhen I receive [game v]\nif <(level) = [0]> then\n    delete all of [level collisions v]\n    object | id [0] | position [-200] [200] [0] [] | extras [] []\nend\n\nwhen I receive [game v]\nif <(level) = [3]> then\n    delete all of [level collisions v]\n    object | id [0] | position [-20] [40] [10] [] | extras [] []\n    object | id [2] | position [48] [70] [10] [] | extras [] []\n    object | id [0] | position [30] [80] [0] [] | extras [] []\n    object | id [0] | position [-20] [10] [0] [] | extras [] []\n    object | id [0] | position [10] [30] [-10] [] | extras [] []\n    object | id [0] | position [30] [70] [-14] [] | extras [] []\n    object | id [1] | position [48] [10] [51] [30] | extras [1] [1]\n    object | id [1] | position [-13] [-2] [-10] [30] | extras [-1] [1]\n    object | id [1] | position [7] [-12] [10] [0] | extras [-1] [1]\n    object | id [1] | position [27] [-16] [30] [-10] | extras [-1] [1]\nend\n\nobject | id [4] | position [2] [12] [0] [10] | extras [] []\n\n@large entities\n\nwhen I start as a clone\nif <(#) = [0]> then\n    forever\n        go to [front v] layer\n        show\n        switch costume to (full v)\n        if <(((lavaY) - (135)) - (camY)) < [180]> then\n            go to x: (([floor v] of ((camX) * (-1)) ) mod (480)) y: ([floor v] of (((lavaY) - (135)) - (camY)) )\n            switch costume to (weird floor top v)\n        else\n            go to x: (([floor v] of ((camX) * (-1)) ) mod (480)) y: (([floor v] of (((lavaY) - (135)) - (camY)) ) mod (360))\n            if <([floor v] of (((lavaY) - (135)) - (camY)) ) = (([floor v] of (((lavaY) - (135)) - (camY)) ) mod (360))> then\n                switch costume to (weird floor top v)\n            else\n                switch costume to (weird floor loop v)\n            end\n        end\n    end\nelse\n    if <(#) = [1]> then\n        forever\n            go to [front v] layer\n            show\n            switch costume to (full v)\n            if <((lavaY) - (45)) < (camY)> then\n                go to x: ((([floor v] of ((camX) * (-1)) ) mod (480)) - (480)) y: ([floor v] of (((lavaY) - (135)) - (camY)) )\n                switch costume to (weird floor top v)\n            else\n                go to x: ((([floor v] of ((camX) * (-1)) ) mod (480)) - (480)) y: (([floor v] of (((lavaY) - (135)) - (camY)) ) mod (360))\n                if <([floor v] of (((lavaY) - (135)) - (camY)) ) = (([floor v] of (((lavaY) - (135)) - (camY)) ) mod (360))> then\n                    switch costume to (weird floor top v)\n                else\n                    switch costume to (weird floor loop v)\n                end\n            end\n        end\n    end\nend\n\nset [# v] to [0]\ncreate clone of (_myself_ v)\nset [# v] to [1]\ncreate clone of (_myself_ v)\nset [lavay v] to [60]\n\n@pause menu\n\nwhen I receive [game v]\nhide\nforever\n    wait until <(Paused?) = [1]>\n    set [id v] to [1]\n    create clone of (_myself_ v)\n    set [id v] to [0]\n    create clone of (_myself_ v)\n    start sound [pause v]\n    go to [front v] layer\n    show\n    set [ghost v] effect to (100)\n    switch costume to (pause tint v)\n    repeat (10)\n        change [ghost v] effect by (-7)\n    end\n    wait until <(Paused?) = [0]>\n    start sound [unpause v]\n    reset timer\n    repeat (10)\n        change [ghost v] effect by (7)\n    end\n    hide\n    clear graphic effects\nend\n\nwhen I receive [game v]\nset volume to (50) %\nwait (1) seconds\nwait until <not <key (p v) pressed?>>\nforever\n    wait until <key (p v) pressed?>\n    set [paused? v] to [1]\n    wait until <<(Paused?) = [0]> or <not <key (p v) pressed?>>>\n    wait until <<(Paused?) = [0]> or <key (p v) pressed?>>\n    set [paused? v] to [0]\n    wait until <not <key (p v) pressed?>>\nend\n\nwhen I receive [zoomout v]\ndelete this clone\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [death v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nwait until <(Paused?) = [0]>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nif <<(id) = [0]> or <(id) = [1]>> then\n    go to [front v] layer\n    go to x: (0) y: (0)\n    if <(id) = [0]> then\n        switch costume to (back v)\n    else\n        switch costume to (return to map v)\n    end\n    show\n    clear graphic effects\n    set [ghost v] effect to (100)\n    repeat (12)\n        change [ghost v] effect by (-10)\n    end\n    if <(id) = [0]> then\n        forever\n            if <touching (mouse-pointer v)?> then\n                change [# v] by (1)\n                if <mouse down?> then\n                    set [paused? v] to [0]\n                end\n            end\n        end\n    else\n        forever\n            if <touching (mouse-pointer v)?> then\n                change [# v] by (1)\n                if <mouse down?> then\n                    start sound [press v]\n                    broadcast (return to map v)\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <<(id) = [0]> or <(id) = [1]>> then\n    set [# v] to [0]\n    forever\n        set [brightness v] effect to ((#) * (4))\n        set [# v] to ((#) * (0.8))\n    end\nend\n\nwhen I start as a clone\nif <<(id) = [0]> or <(id) = [1]>> then\n    wait (0.1) seconds\n    forever\n        wait until <touching (mouse-pointer v)?>\n        start sound [hover v]\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\nwhen I receive [return to map v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [return to map v]\nwait (0.2) seconds\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop [other scripts in sprite v]\nset [paused? v] to [0]\nswitch costume to (full v)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (1) seconds\nbroadcast (zoomout v)\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nclear graphic effects\nhide\n\n@retro minigame\n\n