Fortnite - Platformer

Instructions: The original broke when it became Scratch 3.0. However, I wanted to play it like Scratch 2.0, so I fixed it.\n--------------------------  \n   Complete with 4 worlds and a total of 28 levels, Embark will keep you playing for a while and will amaze you with creative level design and atmosphere.\n--------------------------\nCloud Save has been added!\nLeaving the page does not reset the game progress.\n\n~~~~~~~~~~~~~~~~~~~CONTROLS~~~~~~~~~~~~~~~~~~~~~~\nRIGHT ARROW - Move Right\nLEFT ARROW - Move Left (unsurprisingly)\nUP ARROW - Jump\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@Stage\n\nwhen flag clicked\nbroadcast (Start v)\n\nwhen I receive [start v]\nforever\n    play sound [Specification v] until done\nend\n\n@Player\n\ndefine Setup\nif <(Stage) = [10]> then\n    go to x: (180) y: (-50)\nelse\n    go to x: (((((Stage) mod (2)) * (2)) - (1)) * (-200)) y: (-50)\nend\nset [player_x v] to [0]\nset [player_y v] to [0]\nset [player_jump v] to [0]\nset [ghost v] effect to (100)\nshow\n\ndefine Stage? (i) (x_speed) (y_jumping power)\nset [player_walljump? v] to [0]\nset [i v] to [0]\nrepeat until <<(i) < (i)> or <not <touching (stage v)?>>>\n    change y by (1)\n    change [i v] by (1)\nend\nif <(i) < (i)> then\n    change x by (() - (Player_x))\n    change y by (() - (i))\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <[0] < (mouse y)>>> then\n        set [player_walljump? v] to (((Player_x) / ([abs v] of (Player_x) )) * (15))\n        set [player_x v] to (((Player_x) / ([abs v] of (Player_x) )) * ((x_speed) * (-1)))\n        set [player_y v] to (y_jumping power)\n    end\nend\n\nset [player_y v] to [0]\n\ndefine Plat (x_speed) (x_friction) (y_gravity) (y_jumping power)\nchange [player_y v] by (y_gravity)\nif <[0] < (Player_walljump?)> then\n    change [player_walljump? v] by (-1)\nelse\n    if <(Player_walljump?) < [0]> then\n        change [player_walljump? v] by (1)\n    else\n        set [player_walljump? v] to [0]\n    end\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <[0] < (mouse x)>>> then\n    if <([abs v] of (Player_walljump?) ) < [1]> then\n        change [player_x v] by ((x_speed) * (1))\n    end\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < [0]>>> then\n    if <([abs v] of (Player_walljump?) ) < [1]> then\n        change [player_x v] by ((x_speed) * (-1))\n    end\nend\nif <(Player_walljump?) = [0]> then\n    set [player_x v] to ((Player_x) * (x_friction))\nend\nchange x by (Player_x)\nif <<[210] < ([abs v] of (x position) )> and <(Stage) < [10]>> then\n    set x to (((x position) / ([abs v] of (x position) )) * (210))\nend\nif <touching (stage v)?> then\n    Stage? [5] [5] [10]\nend\nchange y by (Player_y)\nif <touching (stage v)?> then\n    change y by (() - (Player_y))\n    set [player_walljump? v] to [0]\n    set [player_y v] to [0]\nend\nchange y by (-1)\nif <touching (stage v)?> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <[0] < (mouse y)>>> then\n        broadcast (jump v)\n        change [player_jump v] by (1)\n        set [player_y v] to (y_jumping power)\n    end\nend\nchange y by (1)\nif <<<(y position) < [-175]> or <touching (spike v)?>> or <key (r v) pressed?>> then\n    wait until <not <key (r v) pressed?>>\n    start sound [Oops v]\n    broadcast (delete v) and wait\n    create clone of (player_ v)\n    Setup\n    set [player? v] to [y]\n    broadcast (Player wait v)\n    broadcast (re v)\nend\nif <<[235] < (x position)> and <(Stage) = [10]>> then\n    broadcast (delete v) and wait\n    set [clear? v] to [y]\n    broadcast (clear v)\nend\n\nwhen I receive [start v]\nset [clear? v] to [n]\nset [stage v] to [1]\nSetup\nbroadcast (message1 v)\n\nwhen flag clicked\nhide\n\nwhen I receive [message1 v]\nPlat [6] [0.5] [-1] [13]\nbroadcast (message2 v)\n\nwhen I receive [ready v]\nSetup\nset [player? v] to [y]\nbroadcast (Player wait v)\n\nwhen I receive [clear v]\ngo to x: (-240) y: (-95)\npoint in direction (90)\nglide (2) secs to x: (0) y: (y position)\nwait (1) seconds\npoint in direction (-90)\nwait (1) seconds\npoint in direction (90)\nbroadcast (end v)\nwait (1) seconds\nglide (2) secs to x: (240) y: (y position)\nbroadcast (... v)\nhide\n\nwhen I receive [player wait v]\nwait (0.5) seconds\nset [player? v] to [n]\n\n@Player_\n\ndefine Setup\ngo to (player v)\nshow\n\nwhen I receive [start v]\nSetup\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nswitch costume to (x v)\nset [ghost v] effect to (50)\nset [clone_y v] to [5]\nrepeat until <touching (_edge_ v)?>\n    change y by (Clone_y)\n    turn right (4) degrees\n    change [clone_y v] by (-1)\nend\ndelete this clone\n\nwhen I receive [message2 v]\nif <(costume [name v]) = [-]> then\n    if <(Player?) = [n]> then\n        go to x: ([x position v] of [player v]) y: ([y position v] of [player v])\n    else\n        change x by ((([x position v] of [player v]) - (x position)) / (2))\n        change y by ((([y position v] of [player v]) - (y position)) / (2))\n    end\nend\n\nwhen I receive [clear v]\nforever\n    go to (player v)\nend\n\nwhen I receive [... v]\nhide\n\n@Player_eyes\n\ndefine Setup\ngo to (player v)\ngo to [front v] layer\nshow\nset [eyes_x v] to [0]\nset [eyes_y v] to [0]\n\nwhen I receive [start v]\nSetup\n\nwhen flag clicked\nhide\n\nwhen I receive [message2 v]\nchange [eyes_x v] by (((Player_x) - (eyes_x)) / (5))\nchange [eyes_y v] by (((Player_y) - (eyes_y)) / (5))\nif <(Player?) = [n]> then\n    go to x: (([x position v] of [player v]) + ((eyes_x) * (1.2))) y: (([y position v] of [player v]) + ((eyes_y) * (1.2)))\nelse\n    change x by (((([x position v] of [player v]) + (eyes_x)) - (x position)) / (2))\n    change y by (((([y position v] of [player v]) + (eyes_y)) - (y position)) / (2))\nend\nif <(Clear?) = [n]> then\n    broadcast (message1 v)\nend\n\nwhen I receive [clear v]\nforever\n    go to (player v)\n    change x by ((([direction v] of [player v]) / (90)) * (5))\nend\n\nwhen I receive [... v]\nhide\n\n@Stage\n\nwhen I receive [start v]\ngo to [front v] layer\nswitch costume to (stage1 v)\nshow\n\nwhen I receive [re v]\ngo to x: (0) y: (0)\nswitch costume to ((10) + (Stage))\ncreate clone of (_myself_ v)\nswitch costume to (Stage)\n\nwhen I receive [delete v]\ndelete this clone\n\nwhen I start as a clone\nif <(Stage) = [6]> then\n    wait until <<([x position v] of [player v]) < [35]> and <(Player_y) = [0]>>\n    repeat until <([x position v] of [player v]) < [-30]>\n        set x to (([x position v] of [player v]) - (35))\n    end\n    repeat until <(y position) < [-37.5]>\n        set x to (([x position v] of [player v]) - (35))\n        change y by (((-38) - (y position)) / (5))\n    end\nelse\n    if <(Stage) = [7]> then\n        set [mine v] to (days since 2000)\n        wait until <[2] < (((days since 2000) - (Mine)) * (86400))>\n        repeat until <<[0] < ([x position v] of [player v])> and <[100] < (y position)>>\n            change y by (((150) - (y position)) / (5))\n        end\n        \n            change y by (((0) - (y position)) / (3))\n        end\n    else\n        if <(Stage) = [8]> then\n            wait until <[0] < (Player_jump)>\n            repeat until <([x position v] of [player v]) < [-125]>\n                change y by (((-80) - (y position)) / (5))\n            end\n            \n                change y by (((0) - (y position)) / (3))\n            end\n        else\n            if <(Stage) = [9]> then\n                wait until <[0] < ([x position v] of [player v])>\n                repeat until <[120] < ([x position v] of [player v])>\n                    change y by (((-80) - (y position)) / (5))\n                end\n                \n                    change y by (((0) - (y position)) / (3))\n                end\n            end\n        end\n    end\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Spike\n\nwhen I receive [go v]\nshow\n\nwhen I receive [re v]\ngo to x: (0) y: (0)\nshow\nswitch costume to ((10) + (Stage))\ncreate clone of (_myself_ v)\nswitch costume to (Stage)\nif <(Stage) = [2]> then\n    wait until <([x position v] of [player v]) < [0]>\n    repeat until <([x position v] of [player v]) < [-70]>\n        change x by (((-70) - (x position)) / (8))\n    end\n    \n        change x by (((0) - (x position)) / (5))\n    end\nelse\n    if <(Stage) = [4]> then\n        repeat until <([x position v] of [player v]) < [-100]>\n            change y by (((((Player_jump) mod (2)) * (-38)) - (y position)) / (5))\n        end\n        \n            change y by (((0) - (y position)) / (5))\n        end\n    else\n        if <(Stage) = [5]> then\n            wait until <[-25] < ([x position v] of [player v])>\n            set [mine v] to [15]\n            repeat (31)\n                change y by (Mine)\n                change [mine v] by (-1)\n            end\n        else\n            if <(Stage) = [6]> then\n                go to x: (0) y: (-38)\n                hide\n                wait until <([x position v] of [player v]) < [-30]>\n                show\n                \n                    change y by (((0) - (y position)) / (5))\n                end\n            else\n                if <(Stage) = [7]> then\n                    set [mine v] to (days since 2000)\n                    wait until <[2] < (((days since 2000) - (Mine)) * (86400))>\n                    repeat until <<[0] < ([x position v] of [player v])> and <[100] < (y position)>>\n                        change y by (((150) - (y position)) / (5))\n                    end\n                    \n                        change y by (((0) - (y position)) / (3))\n                    end\n                else\n                    if <(Stage) = [9]> then\n                        \n                            go to x: (pick random (-1) to (1)) y: (pick random (-1) to (1))\n                        end\n                    else\n                        if <(Stage) = [10]> then\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (stage1 v)\n\nwhen I receive [delete v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nif <(Stage) = [3]> then\n    wait until <[0] < (Player_jump)>\n    repeat until <[100] < ([x position v] of [player v])>\n        change y by (((38) - (y position)) / (5))\n    end\n    \n        change y by (((0) - (y position)) / (3))\n    end\nelse\n    if <(Stage) = [4]> then\n        repeat until <([x position v] of [player v]) < [-100]>\n            change y by (((((Player_jump) mod (2)) * (38)) - (y position)) / (5))\n        end\n        \n            change y by (((0) - (y position)) / (3))\n        end\n    else\n        if <(Stage) = [6]> then\n            go to x: (0) y: (0)\n            hide\n            wait until <[0] < (Player_jump)>\n            show\n            set [mine v] to [15]\n            repeat (31)\n                change y by ((Mine) * (-1.9))\n                change [mine v] by (-1)\n            end\n        else\n            if <(Stage) = [7]> then\n                go to x: (0) y: (-38)\n                hide\n                set [mine v] to (days since 2000)\n                wait until <[3] < (((days since 2000) - (Mine)) * (86400))>\n                show\n                repeat until <[0] < ([x position v] of [player v])>\n                    change y by (((0) - (y position)) / (5))\n                end\n                \n                    change y by (((-38) - (y position)) / (3))\n                end\n            else\n                if <(Stage) = [9]> then\n                    go to x: (0) y: (-38)\n                    hide\n                    wait until <[-130] < ([x position v] of [player v])>\n                    show\n                    repeat until <[100] < ([x position v] of [player v])>\n                        change y by (((0) - (y position)) / (5))\n                    end\n                    \n                        change y by (((-38) - (y position)) / (3))\n                    end\n                end\n            end\n        end\n    end\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\n@TN\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\nforever\n    go to [front v] layer\nend\n\n@C25\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (200) y: (-140)\nset [ghost v] effect to (50)\nset size to (0) %\nshow\nforever\n    change size by (((40) - (size)) / (5))\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (25)\n        repeat until <not <touching (mouse-pointer v)?>>\n            change size by (((50) - (size)) / (5))\n        end\n        set [ghost v] effect to (50)\n    end\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n@exposition\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (50)\nswitch costume to (stage1 v)\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nset [player_x v] to [0]\nrepeat until <[0.1] < (Player_x)>\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\ng\nrepeat until <[1] < (Player_y)>\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\ng\nbroadcast (ready v) and wait\nbroadcast (go v)\nrepeat until <[0] < ([x position v] of [player v])>\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\ng\nwait until <[180] < ([x position v] of [player v])>\nrepeat until <([x position v] of [player v]) < [120]>\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\ng\nhide\n\ndefine g\nrepeat (10)\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\nrepeat (5)\n    change y by (-3)\n    change [ghost v] effect by (20)\nend\nnext costume\n\n@Wall\n\nwhen flag clicked\ngo to x: (-240) y: (0)\nhide\n\nwhen I receive [go v]\nshow\nrepeat (9)\n    repeat until <<[170] < ([abs v] of ([x position v] of [player v]) )> and <(([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) = ((((Stage) mod (2)) * (2)) - (1))>>\n        change x by (((((((Stage) mod (2)) * (2)) - (1)) * (-230)) - (x position)) / (5))\n    end\n    change [stage v] by (1)\n    set [player_jump v] to [0]\n    broadcast (delete v) and wait\n    broadcast (re v)\n    repeat until <(x position) < (((((Stage) mod (2)) * (2)) - (1)) * (240))>\n        change x by (((((((Stage) mod (2)) * (2)) - (1)) * (260)) - (x position)) / (5))\n    end\n    set x to (((((Stage) mod (2)) * (2)) - (1)) * (-260))\nend\nhide\n\nset [stage v] to [1]\n\n@end\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nswitch costume to (1 v)\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nrepeat until <[239] < ([x position v] of [player v])>\n    set [ghost v] effect to ((([x position v] of [player v]) * ((-100) / (240))) + (100))\n    go to [front v] layer\nend\nclear graphic effects\nwait (3) seconds\nrepeat (50)\n    change [brightness v] effect by (-2)\nend\nstop [all v]\n\n