3D platformer!

Instructions: arrow keys to move, love, fave, and even follow if you enjoyed!\n(latest person to beat all the levels is... @cs3952501 \n)

@Stage\n\nwhen flag clicked\nset [pixelate v] effect to (20)\nset [night mode v] to [0]\nforever\n    if <(night mode) = [1]> then\n        switch backdrop to (backdrop1 v)\n    else\n        switch backdrop to (backdrop3 v)\n    end\n    if <(shop) = [1]> then\n        show variable [money v]\n    else\n        hide variable [money v]\n    end\nend\n\n@debug\n\nwhen flag clicked\nforever\n    if <(item (6) of [unlocked levels v]) = [1]> then\n        change [☁ how many people have beat the game v] by (1)\n        stop [this script v]\n    end\nend\n\n@player \n\nwhen flag clicked\nset [pixelate v] effect to (30)\nswitch costume to (costume1 v)\nset [number of skins v] to (costume [number v])\nset [ghost v] effect to (0)\nset size to (48) %\npoint in direction (90)\nset [level v] to [1]\nshow\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nset [scroll x v] to [1250]\nset [scroll y v] to [-200]\nforever\n    if <(menu) = [1]> then\n        if <(shop) = [1]> then\n            go to x: (0) y: (0)\n            show\n            if <key (right arrow v) pressed?> then\n                change [skin v] by (1)\n                wait until <not <key (right arrow v) pressed?>>\n            end\n            if <key (left arrow v) pressed?> then\n                change [skin v] by (-1)\n                wait until <not <key (left arrow v) pressed?>>\n            end\n        else\n            hide\n            point in direction (90)\n        end\n    else\n        show\n        ground [15] [3] [-1] [.7]\n    end\nend\n\ndefine ground (jump hight) (speed) (gravity) (friction)\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>>> then\n    change [x v] by (speed)\nend\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>>> then\n    change [x v] by ((speed) * (-1))\nend\nset [x v] to ((X) * (friction))\nchange x by (X)\nif <touching (level hitbox real v)?> then\n    set [slope v] to [0]\n    repeat until <<(slope) = [8]> or <not <touching (level hitbox real v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level hitbox real v)?> then\n        change y by ((slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X) ) )\n            if <touching (level hitbox real v)?> then\n                change x by ((([abs v] of (X) ) / (X)) * (-1))\n            end\n        end\n        set [x v] to [0]\n    end\nend\nchange y by (Y)\nif <touching (level hitbox real v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y) ) )\n        change y by ((([abs v] of (Y) ) / (Y)) * (-1))\n    end\n    if <<(([abs v] of (Y) ) / (Y)) = [-1]> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>>> then\n        set [y v] to (jump hight)\n    else\n        set [y v] to [0]\n    end\nelse\n    change [y v] by (gravity)\nend\nchange [scroll y v] by ((y position) * (-1))\nchange [scroll x v] by ((x position) * (-1))\ngo to x: (0) y: (0)\nif <touching (porthole v)?> then\n    broadcast (i did it! v)\nend\nif <(scroll y) > [1000]> then\n    broadcast (message1 v)\nend\n\nwhen I receive [message1 v]\npoint in direction (90)\nset [ghost v] effect to (0)\nset size to (48) %\npoint in direction (90)\nshow\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nset [scroll x v] to [1250]\nset [selected skin v] to [1]\nset [x v] to [0]\nset [y v] to [0]\nset [scroll y v] to [-200]\n\nwhen flag clicked\nforever\n    set [2.5 d scroll y v] to ((scroll y) - (30))\nend\n\nwhen I receive [i did it! v]\npoint in direction (90)\nset [ghost v] effect to (0)\nset size to (48) %\nshow\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nset [scroll x v] to [1250]\nset [x v] to [0]\nset [y v] to [0]\nset [scroll y v] to [-200]\nset [menu v] to [1]\nreplace item ((level) + (1)) of [unlocked levels v] with [1]\nchange [money v] by (5)\n\nwhen I receive [start level v]\npoint in direction (90)\n\nwhen flag clicked\nset [skin v] to [1]\nforever\n    if <(shop) = [1]> then\n        switch costume to (skin)\n    else\n        if <(selected skin) = [1]> then\n            switch costume to (blockman right v)\n            if <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> then\n                if <key (right arrow v) pressed?> then\n                    point in direction (90)\n                else\n                    point in direction (-90)\n                end\n            end\n        else\n            switch costume to (selected skin)\n        end\n    end\nend\n\nwhen flag clicked\nswitch costume to (blockman right v)\nforever\n    if <(skin) = ((number of skins) + (1))> then\n        set [skin v] to [1]\n    end\n    if <(skin) = [0]> then\n        set [skin v] to (number of skins)\n    end\nend\n\n@level hitbox\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nswitch costume to (size hack v)\nset size to (600) %\nswitch costume to (costume4 v)\nset [number of costumes v] to ((costume [number v]) - (1))\nforever\n    if <not <(menu) = [1]>> then\n        show\n        go to x: (scroll x) y: (scroll y)\n        switch costume to ((level) + (1))\n    else\n        hide\n    end\nend\n\nreplace item (6) of [unlocked levels v] with [1]\n\n@level hitbox real\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nswitch costume to (size hack v)\nset size to (600) %\nforever\n    if <not <(menu) = [1]>> then\n        show\n        go to x: (scroll x) y: ((scroll y) - (5))\n        switch costume to ((level) + (1))\n    else\n        hide\n    end\nend\n\n@level 2.5d\n\nwhen flag clicked\nforever\n    if <not <(menu) = [1]>> then\n        setup 2.5D\n        wait until <(menu) = [1]>\n        delete this clone\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    if <not <(menu) = [1]>> then\n        switch costume to ((level) + (1))\n        set x to (([x position v] of [level hitbox v]) * ((size) / ([size v] of [level hitbox v])))\n        set y to (([y position v] of [level hitbox v]) * (((size) + (3)) / ([size v] of [level hitbox v])))\n    else\n        delete this clone\n    end\nend\n\ndefine setup 2.5D\nhide\ngo to x: (0) y: (0)\nset [brightness v] effect to (50)\nswitch costume to (size hack v)\nset size to (600) %\nset [ghost v] effect to (0)\nrepeat (50)\n    create clone of (_myself_ v)\n    change [brightness v] effect by (-.5)\n    change size by (35)\nend\n\n@porthole\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nset [level v] to [1]\nset size to (1275) %\nforever\n    go to x: (scroll x) y: (scroll y)\n    switch costume to ((level) + (1))\nend\n\n@buttons for menu\n\nwhen flag clicked\nset [pixelate v] effect to (10)\nset [menu v] to [1]\nforever\n    if <<(menu) = [1]> and <not <(shop) = [1]>>> then\n        set [button v] to [1]\n        set [unlocked levels v] to [1]\n        switch costume to (level 1 v)\n        hide\n        go to x: (-175) y: (50)\n        repeat (number of costumes)\n            create clone of (_myself_ v)\n            change x by (175)\n            if <touching (_edge_ v)?> then\n                set x to (-175)\n                change y by (-100)\n            end\n            next costume\n            wait (0) seconds\n            change [unlocked levels v] by (1)\n        end\n        wait until <<(menu) = [0]> or <(shop) = [1]>>\n    else\n        delete this clone\n    end\nend\n\ndefine reset for menu\nset [button v] to [1]\nset [unlocked levels v] to [1]\nswitch costume to (level 1 v)\nhide\ngo to x: (-175) y: (50)\nrepeat (number of costumes)\n    create clone of (_myself_ v)\n    change x by (175)\n    if <touching (_edge_ v)?> then\n        set x to (-175)\n        change y by (-100)\n    end\n    next costume\n    wait (0) seconds\n    change [unlocked levels v] by (1)\nend\nwait until <<(menu) = [0]> or <(shop) = [1]>>\n\nwhen I start as a clone\nshow\nif <(item (unlocked levels) of [unlocked levels v]) = [1]> then\n    switch costume to (unlocked levels)\nelse\n    switch costume to (locked v)\nend\nrepeat until <<(menu) = [0]> or <(shop) = [1]>>\n    if <<<touching (mouse-pointer v)?> and <mouse down?>> and <not < (costume [name v]) contains [locked]?>>> then\n        broadcast (start level v)\n        set [menu v] to [0]\n        set [level v] to (costume [number v])\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen flag clicked\nswitch costume to (locked v)\nset [number of costumes v] to ((costume [number v]) - (1))\n\n@menu\n\nwhen flag clicked\nset [pixelate v] effect to (15)\ngo to [back v] layer\ngo to x: (0) y: (0)\nforever\n    if <(menu) = [1]> then\n        show\n        if <(shop) = [1]> then\n            switch costume to (shop v)\n        else\n            switch costume to (levels v)\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ndelete all of [unlocked levels v]\nadd [1] to [unlocked levels v]\nrepeat (9)\n    add [0] to [unlocked levels v]\nend\n\n@level maker (not for posting with)\n\nwhen flag clicked\nhide\n\nshow\n\n@shop/back to menu button\n\nwhen flag clicked\nset [pixelate v] effect to (10)\nset [money v] to [0]\nset [shop v] to [0]\ngo to x: (0) y: (0)\nforever\n    if <<(menu) = [1]> and <not <(shop) = [1]>>> then\n        switch costume to (costume1 v)\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            set [shop v] to [1]\n            set [menu v] to [1]\n            set [scroll x v] to [1250]\n            set [x v] to [0]\n            set [y v] to [0]\n            set [scroll y v] to [-200]\n            wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n        end\n    else\n        switch costume to (costume2 v)\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            set [shop v] to [0]\n            set [menu v] to [1]\n            set [scroll x v] to [1250]\n            set [x v] to [0]\n            set [y v] to [0]\n            set [scroll y v] to [-200]\n            wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n        end\n    end\nend\n\nwhen I receive [done intro v]\nforever\n    wait (5) seconds\n    change [money v] by (1)\nend\n\n@unlock\n\nwhen flag clicked\nset [pixelate v] effect to (10)\ngo to x: (-7) y: (-38)\ndelete all of [unlocked skins v]\nadd [1] to [unlocked skins v]\nrepeat (50)\n    add [0] to [unlocked skins v]\nend\nset [selected skin v] to [1]\nforever\n    if <(shop) = [1]> then\n        show\n        if <(item (skin) of [unlocked skins v]) = [0]> then\n            switch costume to (buy v)\n        end\n        if <<<<touching (mouse-pointer v)?> and <mouse down?>> and <(money) > (((skin) * (3)) - (1))>> and <(costume [number v]) = [1]>> then\n            change [money v] by (join [-] ((skin) * (3)))\n            replace item (skin) of [unlocked skins v] with [1]\n            set [selected skin v] to (skin)\n        end\n        if <(item (skin) of [unlocked skins v]) = [1]> then\n            switch costume to (select v)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                switch costume to (selected v)\n                set [selected skin v] to (skin)\n            end\n        end\n        if <(selected skin) = (skin)> then\n            switch costume to (selected v)\n        end\n    else\n        hide\n    end\nend\n\n@intro\n\nwhen flag clicked\nset [ghost v] effect to (0)\ngo to [front v] layer\nshow\ngo to x: (0) y: (0)\n\nwhen I receive [done intro v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n@intro name\n\nwhen flag clicked\nset [pixelate v] effect to (15)\nhide\nrepeat (10)\n    go to [front v] layer\n    go [forward v] (1) layers\nend\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nset size to (50) %\nrepeat (100)\n    change size by (.5)\nend\nrepeat (100)\n    change size by (.5)\n    change [ghost v] effect by (1)\nend\nwait (1) seconds\nbroadcast (done intro v)\n\n@thumbnail\n\nwhen flag clicked\nshow variable [night mode v]\nshow\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nswitch costume to (real thumbnail v)\nforever\n    go to [front v] layer\nend\n\n@money\n\nwhen flag clicked\nset [pixelate v] effect to (15)\nrepeat (10)\n    go to [front v] layer\nend\nset size to (80) %\ngo to x: (15) y: (-39)\nforever\n    if <<(shop) = [1]> and <(item (skin) of [unlocked skins v]) = [0]>> then\n        show\n        switch costume to (skin)\n    else\n        hide\n    end\nend\n\n