The Official Longest Platformer 2

Instructions: The sequel to original platformer is here. Welcome to the Official Longest Platformer 2; the longest platformer on Scratch!\nContinue the story of the unnamed character as he tries to stop the evil circle's plans of domination. Will you be able to save the day, or will you not make it to the end?\nFeaturing;\n200 Challenging levels, which can be played in single or multiplayer\nImproved and easy-to-use level editor\nEnhanced visuals and upgraded gameplay performance\nNew sandbox mode to play freely with and a new time trial mode\nUnique storytelling and a simplistic art style\nand much more!

@Stage\n\nwhen flag clicked\nset [volume v] to [80]\nforever\n    set volume to (Volume) %\nend\n\nwhen flag clicked\nforever\n    play sound [Supersonic v] until done\n    play sound [The Pressure v] until done\n    play sound [Bubble Beam v] until done\nend\n\n@world 1\n\nwhen I receive [start game v]\nwait until <(backdrop [name v]) = [world 1]>\nset [lvl data v] to [1]\nshow\nswitch costume to (costume2 v)\nset size to (200) %\nswitch costume to (lvl 1.1-4 v)\ngo to x: (240) y: (-180)\nerase all\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\n\nwhen I receive [next lvl v]\nif <(backdrop [name v]) = [world 1]> then\n    if <(lvl data) = [4]> then\n        set [lvl data v] to [1]\n        next costume\n    else\n        change [lvl data v] by (1)\n    end\n    if <(lvl data) = [1]> then\n        go to x: (240) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [2]> then\n        go to x: (-241) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [3]> then\n        go to x: (240) y: (180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [4]> then\n        go to x: (-241) y: (180)\n        wait (1) seconds\n    end\nend\n\nwhen backdrop switches to [menu v]\nerase all\nswitch costume to (costume2 v)\nhide\n\nwhen I receive [next lvl v]\nwait (0.05) seconds\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\nif <<(costume [number v]) = [1]> and <(backdrop [name v]) = [world 1]>> then\n    set size to (100) %\n    hide\n    erase all\n    switch backdrop to (loading v)\n    set [respawn v] to [1]\n    wait (0.1) seconds\n    set [respawn v] to [0]\n    broadcast (world 2 v)\n    erase all\n    wait (5) seconds\nend\n\nwhen flag clicked\nswitch costume to (costume2 v)\nhide\nerase all\n\n@player 1\n\nwhen I receive [start game v]\nset [x motion v] to [0]\nset [y motion v] to [0]\nset [respawn v] to [0]\nset [speed v] to [1]\ngo to x: (-220) y: (-140)\nshow\ngo to [front v] layer\nset size to (100) %\nswitch costume to (costume1 v)\nrepeat until <<(backdrop [name v]) = [menu]> or <<(backdrop [name v]) = [cutscene ending]> or <(backdrop [name v]) = [time trial results]>>>\n    if <key (right arrow v) pressed?> then\n        change [x motion v] by ((speed) * (1))\n    end\n    if <key (left arrow v) pressed?> then\n        change [x motion v] by ((speed) * (-1))\n    end\n    set [x motion v] to ((0.9) * (x motion))\n    change x by (x motion)\n    if <<touching color (#00ff55)?> or <touching color (#7f7f7f)?>> then\n        change y by (5)\n        if <<touching color (#00ff55)?> or <touching color (#7f7f7f)?>> then\n            change y by (-5)\n            change x by ((0) - (x motion))\n            set [x motion v] to [0]\n        end\n    end\n    change [y motion v] by (-1)\n    change y by (y motion)\n    if <<touching color (#00ff55)?> or <touching color (#7f7f7f)?>> then\n        change y by ((0) - (y motion))\n        set [y motion v] to [0]\n        if <key (up arrow v) pressed?> then\n            set [y motion v] to [12]\n        end\n    end\n    if <touching color (#003fff)?> then\n        switch costume to (costume2 v)\n        broadcast (next lvl v)\n        set [respawn v] to [1]\n        go to x: (-220) y: (-140)\n        wait (0.1) seconds\n        set [respawn v] to [0]\n        switch costume to (costume1 v)\n    end\n    if <touching color (#cc0000)?> then\n        set [respawn v] to [1]\n    end\n    if <key (r v) pressed?> then\n        go to x: (-220) y: (-140)\n        set size to (100) %\n        wait (0.1) seconds\n    end\n    if <(respawn) = [1]> then\n        go to x: (-220) y: (-140)\n        set size to (100) %\n        wait (0.1) seconds\n        set [respawn v] to [0]\n    end\n    if <touching color (#ff9400)?> then\n        set size to (60) %\n    end\n    if <touching color (#7f00ff)?> then\n        set size to (100) %\n    end\n    if <(pause game) = [1]> then\n        wait until <(pause game) = [0]>\n    end\n    if <touching color (#006666)?> then\n        set [speed v] to [3]\n    else\n        set [speed v] to [1]\n    end\nend\nset [x motion v] to [0]\nset [y motion v] to [0]\nset [respawn v] to [0]\nset [speed v] to [1]\nswitch costume to (costume2 v)\nhide\n\nwhen flag clicked\nswitch costume to (costume2 v)\nhide\n\n@player 2\n\nwhen I receive [start game 2 v]\nset [x motion v] to [0]\nset [y motion v] to [0]\nset [speed 2 v] to [1]\ngo to x: (-206) y: (-140)\nshow\ngo to [front v] layer\nset size to (100) %\nswitch costume to (costume1 v)\nrepeat until <<(backdrop [name v]) = [menu]> or <<(backdrop [name v]) = [cutscene ending]> or <(backdrop [name v]) = [time trial results]>>>\n    if <key (d v) pressed?> then\n        change [x motion v] by ((speed 2) * (1))\n    end\n    if <key (a v) pressed?> then\n        change [x motion v] by ((speed 2) * (-1))\n    end\n    set [x motion v] to ((0.9) * (x motion))\n    change x by (x motion)\n    if <<touching color (#00ff55)?> or <touching color (#7f7f7f)?>> then\n        change y by (5)\n        if <<touching color (#00ff55)?> or <touching color (#7f7f7f)?>> then\n            change y by (-5)\n            change x by ((0) - (x motion))\n            set [x motion v] to [0]\n        end\n    end\n    change [y motion v] by (-1)\n    change y by (y motion)\n    if <<touching color (#00ff55)?> or <touching color (#7f7f7f)?>> then\n        change y by ((0) - (y motion))\n        set [y motion v] to [0]\n        if <key (w v) pressed?> then\n            set [y motion v] to [12]\n        end\n    end\n    if <touching color (#003fff)?> then\n        switch costume to (costume2 v)\n        broadcast (next lvl v)\n        set [respawn v] to [1]\n        go to x: (-206) y: (-140)\n        wait (0.1) seconds\n        set [respawn v] to [0]\n        switch costume to (costume1 v)\n    end\n    if <touching color (#cc0000)?> then\n        set [respawn v] to [1]\n    end\n    if <key (r v) pressed?> then\n        go to x: (-206) y: (-140)\n        set size to (100) %\n        wait (0.1) seconds\n    end\n    if <(respawn) = [1]> then\n        go to x: (-206) y: (-140)\n        set size to (100) %\n    end\n    if <touching color (#ff9400)?> then\n        set size to (60) %\n    end\n    if <touching color (#7f00ff)?> then\n        set size to (100) %\n    end\n    if <(pause game) = [1]> then\n        wait until <(pause game) = [0]>\n    end\n    if <touching color (#006666)?> then\n        set [speed 2 v] to [3]\n    else\n        set [speed 2 v] to [1]\n    end\nend\nset [x motion v] to [0]\nset [y motion v] to [0]\nset [speed 2 v] to [1]\nswitch costume to (costume2 v)\nhide\n\nwhen flag clicked\nswitch costume to (costume2 v)\nhide\n\n@options\n\nwhen backdrop switches to [cutscene v]\nhide\nset [ghost v] effect to (100)\nswitch costume to (costume4 v)\nset size to (190) %\nswitch costume to (story start v)\ngo to x: (237) y: (-176)\nshow\nrepeat (5)\n    change [ghost v] effect by (-20)\n    wait (0.05) seconds\nend\nwait (4) seconds\nglide (0.5) secs to x: (-238) y: (-176)\nwait (5) seconds\nrepeat (5)\n    change [ghost v] effect by (20)\n    wait (0.05) seconds\nend\ngo to x: (237) y: (176)\nrepeat (5)\n    change [ghost v] effect by (-20)\n    wait (0.05) seconds\nend\nwait (1.5) seconds\nglide (0.5) secs to x: (-239) y: (176)\nwait (4) seconds\nrepeat (5)\n    change [ghost v] effect by (20)\n    wait (0.05) seconds\nend\nset size to (100) %\ngo to x: (0) y: (0)\nrepeat (5)\n    change [ghost v] effect by (-20)\n    wait (0.05) seconds\nend\nwait (4) seconds\nrepeat (5)\n    change [ghost v] effect by (20)\n    wait (0.05) seconds\nend\nswitch backdrop to (loading v)\nswitch costume to (costume4 v)\nset [ghost v] effect to (0)\nhide\nif <(# of players) = [1]> then\n    broadcast (start game v)\nend\nif <(# of players) = [2]> then\n    broadcast (start game v)\n    broadcast (start game 2 v)\nend\nswitch costume to (loading icon v)\ngo to x: (63) y: (189)\nshow\nglide (0.2) secs to x: (63) y: (-126)\nwait (4.8) seconds\nhide\nswitch costume to (costume4 v)\nswitch backdrop to (world 1 v)\nset [respawn v] to [1]\nwait (0.1) seconds\nset [respawn v] to [0]\n\nwhen flag clicked\nset [volume v] to [80]\nswitch costume to (costume4 v)\nhide variable [volume v]\nset [pause game v] to [0]\ndelete this clone\n\nwhen I receive [start game v]\nhide variable [volume v]\nset [pause game v] to [0]\nrepeat until <<(backdrop [name v]) = [menu]> or <<(backdrop [name v]) = [level editor]> or <<(backdrop [name v]) = [cutscene ending]> or <(backdrop [name v]) = [sandbox]>>>>\n    if <<key (p v) pressed?> and <not <(backdrop [name v]) = [loading]>>> then\n        show\n        set [pause game v] to [1]\n        go to [front v] layer\n        go to x: (0) y: (0)\n        switch costume to (pause menu v)\n        wait (0.1) seconds\n        show variable [volume v]\n        switch costume to (return to menu v)\n        create clone of (_myself_ v)\n        switch costume to (pause menu v)\n        create clone of (_myself_ v)\n        wait (0.5) seconds\n        wait until <<key (p v) pressed?> or <(backdrop [name v]) = [menu]>>\n        switch costume to (costume4 v)\n        hide\n        hide variable [volume v]\n        set [pause game v] to [0]\n        wait (0.5) seconds\n        delete this clone\n    end\nend\n\nwhen backdrop switches to [cutscene ending v]\nhide\nset [ghost v] effect to (100)\nswitch costume to (costume4 v)\nset size to (190) %\nswitch costume to (story end v)\ngo to x: (237) y: (-176)\nshow\nrepeat (5)\n    change [ghost v] effect by (-20)\n    wait (0.05) seconds\nend\nwait (4) seconds\nglide (0.5) secs to x: (-238) y: (-176)\nwait (5) seconds\nrepeat (5)\n    change [ghost v] effect by (20)\n    wait (0.05) seconds\nend\ngo to x: (237) y: (176)\nrepeat (5)\n    change [ghost v] effect by (-20)\n    wait (0.05) seconds\nend\nwait (1.5) seconds\nglide (0.5) secs to x: (-239) y: (176)\nwait (4) seconds\nrepeat (5)\n    change [ghost v] effect by (20)\n    wait (0.05) seconds\nend\nset size to (100) %\ngo to x: (0) y: (0)\nrepeat (5)\n    change [ghost v] effect by (-20)\n    wait (0.05) seconds\nend\nwait (4) seconds\nrepeat (5)\n    change [ghost v] effect by (20)\n    wait (0.05) seconds\nend\nswitch backdrop to (menu v)\nswitch costume to (costume4 v)\nset [ghost v] effect to (0)\nhide\n\nwhen I receive [world 3 v]\ngo to x: (145) y: (-99)\nswitch costume to (loading icon v)\nshow\nwait (1) seconds\nglide (0.2) secs to x: (184) y: (-43)\nwait (3.8) seconds\nswitch costume to (costume4 v)\nhide\nswitch backdrop to (world 3 v)\nset [respawn v] to [1]\nwait (0.1) seconds\nset [respawn v] to [0]\n\nwhen I receive [world 2 v]\ngo to x: (63) y: (-126)\nswitch costume to (loading icon v)\nshow\nwait (1) seconds\nglide (0.2) secs to x: (145) y: (-99)\nwait (3.8) seconds\nswitch costume to (costume4 v)\nhide\nswitch backdrop to (world 2 v)\nset [respawn v] to [1]\nwait (0.1) seconds\nset [respawn v] to [0]\n\nwhen I receive [world 4 v]\ngo to x: (184) y: (-43)\nswitch costume to (loading icon v)\nshow\nwait (1) seconds\nglide (0.2) secs to x: (219) y: (37)\nwait (3.8) seconds\nswitch costume to (costume4 v)\nhide\nswitch backdrop to (world 4 v)\nset [respawn v] to [1]\nwait (0.1) seconds\nset [respawn v] to [0]\n\nwhen I receive [world 5 v]\ngo to x: (219) y: (37)\nswitch costume to (loading icon v)\nshow\nwait (1) seconds\nglide (0.2) secs to x: (211) y: (121)\nwait (3.8) seconds\nswitch costume to (costume4 v)\nhide\nswitch backdrop to (world 5 v)\nset [respawn v] to [1]\nwait (0.1) seconds\nset [respawn v] to [0]\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    go to x: (0) y: (-26)\n    if <(graphics) = [2]> then\n        switch costume to (high graphics v)\n    end\n    if <(graphics) = [1]> then\n        switch costume to (low graphics v)\n    end\n    go to [front v] layer\n    wait (0.5) seconds\n    repeat until <<key (p v) pressed?> or <(backdrop [name v]) = [menu]>>\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            if <(graphics) = [2]> then\n                set [graphics v] to [1]\n                create clone of (_myself_ v)\n                switch costume to (low graphics v)\n                wait (0.2) seconds\n            else\n                if <(graphics) = [1]> then\n                    set [graphics v] to [2]\n                    create clone of (_myself_ v)\n                    switch costume to (high graphics v)\n                    wait (0.2) seconds\n                end\n            end\n        end\n    end\n    delete this clone\nend\nif <<(costume [number v]) = [2]> or <(costume [number v]) = [3]>> then\n    repeat until <key (p v) pressed?>\n        go to x: (135) y: (-24)\n        switch costume to (notice v)\n        if <<<touching color (#b2b2b2)?> and <touching color (#ffffff)?>> or <(backdrop [name v]) = [menu]>> then\n            delete this clone\n        end\n    end\n    delete this clone\nend\nif <(costume [number v]) = [6]> then\n    wait (0.2) seconds\n    go to [front v] layer\n    go to x: (0) y: (0)\n    wait (0.3) seconds\n    wait until <<<touching (mouse-pointer v)?> and <mouse down?>> or <key (p v) pressed?>>\n    if <key (p v) pressed?> then\n        switch costume to (costume4 v)\n        delete this clone\n    end\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        switch costume to (costume4 v)\n        switch backdrop to (menu v)\n        delete this clone\n    end\nend\n\n@menu buttons\n\nwhen flag clicked\nswitch costume to (costume1 v)\ndelete this clone\n\nwhen I start as a clone\nif <(costume [number v]) = [4]> then\n    show\n    go to x: (-160) y: (-115)\n    repeat until <not <(backdrop [name v]) = [mode/player select]>>\n        set size to (90) %\n        if <touching (mouse-pointer v)?> then\n            set size to (95) %\n        end\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            set [# of players v] to [1]\n        end\n        if <(# of players) = [1]> then\n            switch costume to (1 player2 v)\n        else\n            switch costume to (1 player v)\n        end\n    end\n    hide\n    switch costume to (costume1 v)\n    delete this clone\nend\nif <(costume [number v]) = [5]> then\n    show\n    go to x: (-28) y: (-115)\n    repeat until <not <(backdrop [name v]) = [mode/player select]>>\n        set size to (90) %\n        if <touching (mouse-pointer v)?> then\n            set size to (95) %\n        end\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            set [# of players v] to [2]\n        end\n        if <(# of players) = [2]> then\n            switch costume to (2 players2 v)\n        else\n            switch costume to (2 players v)\n        end\n    end\n    hide\n    switch costume to (costume1 v)\n    delete this clone\nend\nif <(costume [number v]) = [9]> then\n    go to x: (-90) y: (5)\n    show\n    wait (0.5) seconds\n    repeat until <not <(backdrop [name v]) = [graphics selection]>>\n        set size to (90) %\n        if <touching (mouse-pointer v)?> then\n            set size to (95) %\n        end\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            set [graphics v] to [2]\n            switch costume to (costume1 v)\n            switch backdrop to (cutscene v)\n            hide\n            delete this clone\n        end\n    end\n    switch costume to (costume1 v)\n    switch backdrop to (cutscene v)\n    hide\n    delete this clone\nend\nif <(costume [number v]) = [8]> then\n    go to x: (146) y: (5)\n    show\n    wait (0.5) seconds\n    repeat until <not <(backdrop [name v]) = [graphics selection]>>\n        set size to (90) %\n        if <touching (mouse-pointer v)?> then\n            set size to (95) %\n        end\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            set [graphics v] to [1]\n            switch costume to (costume1 v)\n            switch backdrop to (cutscene v)\n            hide\n            delete this clone\n        end\n    end\n    switch costume to (costume1 v)\n    switch backdrop to (cutscene v)\n    hide\n    delete this clone\nend\nif <(costume [number v]) = [10]> then\n    show\n    go to x: (194) y: (-135)\n    point in direction (90)\n    repeat until <not <(backdrop [name v]) = [mode/player select]>>\n        point in direction (90)\n        if <touching (mouse-pointer v)?> then\n            turn right (15) degrees\n        end\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            switch backdrop to (options/credits v)\n            set size to (70) %\n            point in direction (90)\n            go to x: (205) y: (-145)\n        end\n    end\n    if <(backdrop [name v]) = [options/credits]> then\n        wait (0.5) seconds\n        show variable [volume v]\n        repeat until <not <(backdrop [name v]) = [options/credits]>>\n            point in direction (90)\n            if <touching (mouse-pointer v)?> then\n                turn right (15) degrees\n            end\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                hide variable [volume v]\n                switch costume to (costume1 v)\n                switch backdrop to (menu v)\n                delete this clone\n            end\n        end\n    else\n        switch costume to (costume1 v)\n        delete this clone\n    end\nend\nif <(costume [number v]) = [11]> then\n    show\n    go to x: (-40) y: (63)\n    point in direction (90)\n    repeat until <not <(backdrop [name v]) = [mode/player select]>>\n        set size to (90) %\n        if <touching (mouse-pointer v)?> then\n            set size to (95) %\n        end\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            hide\n            switch costume to (costume1 v)\n            set size to (90) %\n            switch backdrop to (level editor v)\n        end\n    end\n    hide\n    switch costume to (costume1 v)\n    delete this clone\nend\nif <(costume [number v]) = [12]> then\n    show\n    go to x: (80) y: (123)\n    point in direction (90)\n    repeat until <not <(backdrop [name v]) = [mode/player select]>>\n        set size to (90) %\n        if <touching (mouse-pointer v)?> then\n            set size to (95) %\n        end\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            hide\n            switch costume to (costume1 v)\n            set size to (90) %\n            switch backdrop to (sandbox v)\n        end\n    end\n    hide\n    switch costume to (costume1 v)\n    delete this clone\nend\nif <(costume [number v]) = [13]> then\n    show\n    go to x: (80) y: (80)\n    point in direction (90)\n    repeat until <not <(backdrop [name v]) = [mode/player select]>>\n        set size to (90) %\n        if <touching (mouse-pointer v)?> then\n            set size to (95) %\n        end\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            hide\n            switch costume to (costume1 v)\n            set size to (90) %\n            switch backdrop to (time trial intro v)\n        end\n    end\n    hide\n    switch costume to (costume1 v)\n    delete this clone\nend\n\nwhen backdrop switches to [menu v]\nhide variable [# of players v]\nswitch costume to (play v)\ngo to x: (0) y: (0)\nset size to (90) %\nshow\nwait (0.3) seconds\nrepeat until <<touching (mouse-pointer v)?> and <mouse down?>>\n    repeat until <<(size) = [95]> or <<touching (mouse-pointer v)?> and <mouse down?>>>\n        change size by (0.5)\n        wait (0.05) seconds\n    end\n    repeat until <<(size) = [90]> or <<touching (mouse-pointer v)?> and <mouse down?>>>\n        change size by (-0.5)\n        wait (0.05) seconds\n    end\nend\nhide\nset size to (90) %\nswitch backdrop to (mode/player select v)\nswitch costume to (1 player v)\ncreate clone of (_myself_ v)\nswitch costume to (2 players v)\ncreate clone of (_myself_ v)\nswitch costume to (options/credis v)\ncreate clone of (_myself_ v)\nswitch costume to (level editor v)\ncreate clone of (_myself_ v)\nswitch costume to (sandbox v)\ncreate clone of (_myself_ v)\nswitch costume to (time trial v)\ncreate clone of (_myself_ v)\nswitch costume to (story select v)\ngo to x: (-160) y: (63)\nset [# of players v] to [1]\nshow\nwait (0.5) seconds\nrepeat until <not <(backdrop [name v]) = [mode/player select]>>\n    set size to (90) %\n    if <touching (mouse-pointer v)?> then\n        set size to (95) %\n    end\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        hide\n        set size to (90) %\n        switch costume to (costume1 v)\n        switch backdrop to (graphics selection v)\n        switch costume to (high graphics v)\n        create clone of (_myself_ v)\n        switch costume to (low graphics v)\n        create clone of (_myself_ v)\n        switch costume to (costume1 v)\n        hide\n    end\nend\nswitch costume to (costume1 v)\nhide\n\n@world 2\n\nwhen I receive [next lvl v]\nif <(backdrop [name v]) = [world 2]> then\n    if <(lvl data) = [4]> then\n        set [lvl data v] to [1]\n        next costume\n    else\n        change [lvl data v] by (1)\n    end\n    if <(lvl data) = [1]> then\n        go to x: (240) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [2]> then\n        go to x: (-241) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [3]> then\n        go to x: (240) y: (180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [4]> then\n        go to x: (-241) y: (180)\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume2 v)\nhide\nerase all\n\nwhen backdrop switches to [menu v]\nerase all\nswitch costume to (costume2 v)\nhide\n\nwhen I receive [next lvl v]\nwait (0.05) seconds\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\nif <<(costume [number v]) = [1]> and <(backdrop [name v]) = [world 2]>> then\n    set size to (100) %\n    hide\n    erase all\n    switch backdrop to (loading v)\n    set [respawn v] to [1]\n    wait (0.1) seconds\n    set [respawn v] to [0]\n    broadcast (world 3 v)\n    erase all\n    wait (5) seconds\nend\n\nwhen I receive [world 2 v]\nwait until <(backdrop [name v]) = [world 2]>\nset [lvl data v] to [1]\nshow\nswitch costume to (costume2 v)\nset size to (200) %\nswitch costume to (lvl 2.1-4 v)\ngo to x: (240) y: (-180)\nerase all\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\n\n@world 3\n\nwhen I receive [next lvl v]\nif <(backdrop [name v]) = [world 3]> then\n    if <(lvl data) = [4]> then\n        set [lvl data v] to [1]\n        next costume\n    else\n        change [lvl data v] by (1)\n    end\n    if <(lvl data) = [1]> then\n        go to x: (240) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [2]> then\n        go to x: (-241) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [3]> then\n        go to x: (240) y: (180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [4]> then\n        go to x: (-241) y: (180)\n        wait (1) seconds\n    end\nend\n\nwhen backdrop switches to [menu v]\nerase all\nswitch costume to (costume2 v)\nhide\n\nwhen I receive [next lvl v]\nwait (0.05) seconds\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\nif <<(costume [number v]) = [1]> and <(backdrop [name v]) = [world 3]>> then\n    set size to (100) %\n    hide\n    erase all\n    switch backdrop to (loading v)\n    set [respawn v] to [1]\n    wait (0.1) seconds\n    set [respawn v] to [0]\n    broadcast (world 4 v)\n    erase all\n    wait (5) seconds\nend\n\nwhen I receive [world 3 v]\nwait until <(backdrop [name v]) = [world 3]>\nset [lvl data v] to [1]\nshow\nswitch costume to (costume2 v)\nset size to (200) %\nswitch costume to (lvl 3.1-4 v)\ngo to x: (240) y: (-180)\nerase all\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\n\nwhen flag clicked\nswitch costume to (costume2 v)\nhide\nerase all\n\n@world 4\n\nwhen I receive [next lvl v]\nif <(backdrop [name v]) = [world 4]> then\n    if <(lvl data) = [4]> then\n        set [lvl data v] to [1]\n        next costume\n    else\n        change [lvl data v] by (1)\n    end\n    if <(lvl data) = [1]> then\n        go to x: (240) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [2]> then\n        go to x: (-241) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [3]> then\n        go to x: (240) y: (180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [4]> then\n        go to x: (-241) y: (180)\n        wait (1) seconds\n    end\nend\n\nwhen backdrop switches to [menu v]\nerase all\nswitch costume to (costume2 v)\nhide\n\nwhen I receive [next lvl v]\nwait (0.05) seconds\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\nif <<(costume [number v]) = [1]> and <(backdrop [name v]) = [world 4]>> then\n    set size to (100) %\n    hide\n    erase all\n    switch backdrop to (loading v)\n    set [respawn v] to [1]\n    wait (0.1) seconds\n    set [respawn v] to [0]\n    broadcast (world 5 v)\n    erase all\n    wait (5) seconds\nend\n\nwhen I receive [world 4 v]\nwait until <(backdrop [name v]) = [world 4]>\nset [lvl data v] to [1]\nshow\nswitch costume to (costume2 v)\nset size to (200) %\nswitch costume to (lvl 4.1-4 v)\ngo to x: (240) y: (-180)\nerase all\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\n\nwhen flag clicked\nswitch costume to (costume2 v)\nhide\nerase all\n\n@level editor\n\nwhen backdrop switches to [level editor v]\npen up\nerase all\nswitch costume to (lvl v)\ncreate clone of (_myself_ v)\nswitch costume to (back to menu v)\ncreate clone of (_myself_ v)\nswitch costume to (help v)\ncreate clone of (_myself_ v)\nswitch costume to (ground v)\nif <(# of players) = [1]> then\n    broadcast (start game v)\nend\nif <(# of players) = [2]> then\n    broadcast (start game v)\n    broadcast (start game 2 v)\nend\nwait (0.5) seconds\nshow\nrepeat until <not <(backdrop [name v]) = [level editor]>>\n    go to (mouse-pointer v)\n    if <mouse down?> then\n        stamp\n    end\n    if <key (1 v) pressed?> then\n        switch costume to (ground v)\n    end\n    if <key (2 v) pressed?> then\n        switch costume to (lava v)\n    end\n    if <key (3 v) pressed?> then\n        switch costume to (shrink block v)\n    end\n    if <key (4 v) pressed?> then\n        switch costume to (grow block v)\n    end\n    if <key (5 v) pressed?> then\n        switch costume to (speed block v)\n    end\n    if <key (6 v) pressed?> then\n        switch costume to (eraser v)\n    end\nend\nswitch costume to (costume1 v)\nhide\npen up\nerase all\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    wait (0.2) seconds\n    go to [front v] layer\n    show\n    go to x: (-218) y: (168)\n    repeat until <<touching (mouse-pointer v)?> and <mouse down?>>\n        set size to (90) %\n        if <touching (mouse-pointer v)?> then\n            set size to (95) %\n        end\n    end\n    switch backdrop to (menu v)\n    switch costume to (costume1 v)\n    hide\n    delete this clone\nend\nif <(costume [number v]) = [4]> then\n    show\n    repeat until <<key (space v) pressed?> or <not <(backdrop [name v]) = [level editor]>>>\n        go to (mouse-pointer v)\n    end\n    switch costume to (costume1 v)\n    hide\n    delete this clone\nend\nif <(costume [number v]) = [10]> then\n    show\n    go to x: (0) y: (0)\n    go to [front v] layer\n    wait until <not <(backdrop [name v]) = [level editor]>>\n    switch costume to (costume1 v)\n    hide\n    delete this clone\nend\n\nwhen flag clicked\nerase all\npen up\nswitch costume to (costume1 v)\nhide\ndelete this clone\n\n@world 5\n\nwhen I receive [next lvl v]\nif <(backdrop [name v]) = [world 5]> then\n    if <(lvl data) = [4]> then\n        set [lvl data v] to [1]\n        next costume\n    else\n        change [lvl data v] by (1)\n    end\n    if <(lvl data) = [1]> then\n        go to x: (240) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [2]> then\n        go to x: (-241) y: (-180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [3]> then\n        go to x: (240) y: (180)\n        wait (1) seconds\n    end\n    if <(lvl data) = [4]> then\n        go to x: (-241) y: (180)\n        wait (1) seconds\n    end\nend\n\nwhen backdrop switches to [menu v]\nerase all\nswitch costume to (costume2 v)\nhide\n\nwhen I receive [next lvl v]\nwait (0.05) seconds\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\nif <<(costume [number v]) = [1]> and <(backdrop [name v]) = [world 5]>> then\n    set size to (100) %\n    hide\n    erase all\n    switch backdrop to (cutscene ending v)\n    broadcast (ending v)\n    erase all\nend\n\nwhen I receive [world 5 v]\nwait until <(backdrop [name v]) = [world 5]>\nset [lvl data v] to [1]\nshow\nswitch costume to (costume2 v)\nset size to (200) %\nswitch costume to (lvl 5.1-4 v)\ngo to x: (240) y: (-180)\nerase all\nif <(graphics) = [1]> then\n    hide\n    stamp\nelse\n    show\n    erase all\nend\n\nwhen flag clicked\nswitch costume to (costume2 v)\nhide\nerase all\n\n@logo/tutorial\n\nwhen I start as a clone\nif <(costume [number v]) = [6]> then\n    go to x: (396) y: (0)\n    switch costume to (logo half 1 v)\n    hide\n    wait (0.8) seconds\n    show\n    glide (0.5) secs to x: (0) y: (0)\n    wait (1.4) seconds\n    delete this clone\nend\nif <(costume [number v]) = [7]> then\n    go to x: (-381) y: (0)\n    switch costume to (logo half 2 v)\n    hide\n    wait (0.8) seconds\n    show\n    glide (0.5) secs to x: (0) y: (0)\n    wait (1.4) seconds\n    delete this clone\nend\n\nwhen flag clicked\nswitch backdrop to (intro v)\nswitch costume to (logo half 1 v)\ncreate clone of (_myself_ v)\nswitch costume to (logo half 2 v)\ncreate clone of (_myself_ v)\nswitch costume to (logo v)\ngo to x: (0) y: (0)\nhide\nwait (2.7) seconds\nshow\nwait (1.5) seconds\nswitch costume to (costume1 v)\nwait (1.4) seconds\nswitch backdrop to (menu v)\n\nwhen I receive [start game v]\nwait until <(backdrop [name v]) = [world 1]>\nswitch costume to (tutorial 1 v)\ngo to x: (43) y: (-24)\nshow\nrepeat until <<(backdrop [name v]) = [menu]> or <(costume [number v]) = [5]>>\n    if <<touching (mouse-pointer v)?> and <<mouse down?> and <not <touching (options v)?>>>> then\n        next costume\n        wait (0.2) seconds\n    end\nend\nswitch costume to (costume1 v)\nhide\n\n@sandbox\n\nwhen flag clicked\nerase all\nswitch costume to (costume3 v)\nhide\n\nwhen backdrop switches to [sandbox v]\nswitch costume to (sandbox lvl v)\nset size to (100) %\ngo to x: (0) y: (0)\nshow\nstamp\nhide\nswitch costume to (back to menu v)\nif <(# of players) = [1]> then\n    broadcast (start game v)\nend\nif <(# of players) = [2]> then\n    broadcast (start game v)\n    broadcast (start game 2 v)\nend\nwait (0.5) seconds\nshow\ngo to x: (-217) y: (168)\nrepeat until <<touching (mouse-pointer v)?> and <mouse down?>>\n    set size to (90) %\n    if <touching (mouse-pointer v)?> then\n        set size to (95) %\n    end\nend\nerase all\nswitch costume to (costume3 v)\nswitch backdrop to (menu v)\nhide\n\n@time trial\n\nwhen backdrop switches to [time trial intro v]\nswitch costume to (continue v)\nset size to (100) %\ngo to x: (-35) y: (-144)\nshow\nrepeat until <<touching (mouse-pointer v)?> and <mouse down?>>\n    set size to (100) %\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n    end\nend\ngo to x: (0) y: (0)\nswitch costume to (countdown 3 v)\nwait (1) seconds\nswitch backdrop to (time trial v)\nswitch costume to (countdown 2 v)\nwait (1) seconds\nswitch costume to (countdown 1 v)\nwait (1) seconds\ngo to x: (0) y: (0)\nset size to (100) %\nswitch costume to (lvl1 v)\nstamp\nhide\nset [graphics v] to [1]\nif <(# of players) = [1]> then\n    broadcast (start game v)\nend\nif <(# of players) = [2]> then\n    broadcast (start game v)\n    broadcast (start game 2 v)\nend\nrepeat until <<(costume [number v]) = [1]> or <(backdrop [name v]) = [menu]>>\n    wait (0.1) seconds\n    change [time trial time v] by (0.1)\n    if <(pause game) = [1]> then\n        wait until <(pause game) = [0]>\n    end\nend\nif <<(costume [number v]) = [1]> and <not <(backdrop [name v]) = [menu]>>> then\n    switch backdrop to (time trial results v)\n    erase all\n    show\n    go to x: (0) y: (37)\n    switch costume to (gold medal v)\n    create clone of (_myself_ v)\n    switch costume to (continue v)\n    go to x: (-22) y: (-144)\n    show variable [time trial time v]\n    repeat until <<touching (mouse-pointer v)?> and <mouse down?>>\n        set size to (100) %\n        if <touching (mouse-pointer v)?> then\n            set size to (110) %\n        end\n    end\n    switch backdrop to (menu v)\nend\nset [time trial time v] to [0]\nhide variable [time trial time v]\nswitch costume to (costume3 v)\nhide\n\nwhen flag clicked\nhide variable [time trial time v]\nset [time trial time v] to [0]\nerase all\nswitch costume to (costume3 v)\nhide\ndelete this clone\n\nwhen I start as a clone\nif <(time trial time) < [50.1]> then\n    switch costume to (gold medal v)\nend\nif <<(time trial time) < [60.1]> and <(time trial time) > [50]>> then\n    switch costume to (silver medal v)\nend\nif <<(time trial time) < [70.1]> and <(time trial time) > [60]>> then\n    switch costume to (bronze medal v)\nend\nif <(time trial time) > [70]> then\n    delete this clone\nend\nwait until <not <(backdrop [name v]) = [time trial results]>>\ndelete this clone\n\nwhen I receive [next lvl v]\nif <<(backdrop [name v]) = [time trial]> and <not <(costume [number v]) = [1]>>> then\n    next costume\n    if <(graphics) = [1]> then\n        stamp\n        hide\n    else\n        show\n        erase all\n    end\nend\n\n