Jewel - A Scrolling Platformer

Instructions: Sequel out! https://scratch.mit.edu/projects/401066317\n\nThis is a sequel to "Climber" so if you'd like to play the other one then here's the link:\nhttps://scratch.mit.edu/projects/386626325.\nNote: You don't have to play it to play this game.\n\nWelcome to the mystic lands of the mountain Everest.\n\nCool new settings will be added later. (Note: you can suggest and those who have suggested might get their setting idea in this project with credit).\n-----------------------------------------------------------------\nThere are some settings in the game. Do NOT turn on clouds unless you want lots of lag. The enemy levels will cause a little bit of lag but the levels are playable. Don't walk with the submenu on, that will also slow down the games speed by a TON. This is my first scrolling platformer.\n-----------------------------------------------------------------\nI highly recommend that you play the whole game; if you have already played the other one then you should ace this one.\n-----------------------------------------------------------------\n@Capt_Boanerges loved!\n@TimMcTest (@TimMcCool) loved!\n@eunice0913 loved and faved!\n@krishtheking123 loved and faved!\n@linkiki12 loved!\n@Lazy_Otter2_0 loved and faved!\n-----------------------------------------------------------------\n> Playability:\nAll platforms including Mobile.\n-----------------------------------------------------------------\n> Overview:\nPress the green flag to find out.\n-----------------------------------------------------------------\n> Controls:\n1) Arrow keys or touch to move and jump.\n2) Powers will be explained in the game.\n3) Mobile friendly!!\n-----------------------------------------------------------------\n> Credits:\nMade 95% by @Whiteout12.\nArt 100% by @Whiteout12 except the title art "Jewel" which was from cool text.com.\nScrolling script (5%) form @TimMcCool (an awesome guy) but majorly edited by @Whiteout12.\nThanks to @Xhort for testing the game.\n-----------------------------------------------------------------\n#All #Scrolling #Games #Platformer 

@Stage\n\n@Thumbnail\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nset size to (100) %\nset [ghost v] effect to (100)\nwait (10) seconds\nforever\n    play sound [Vicetone - United We Dance v] until done\nend\n\n@Intro (OC)\n\nwhen flag clicked\nswitch backdrop to (1 v)\nhide\nset size to (100) %\nset [ghost v] effect to (100)\nset [intro ability v] to [0]\nrepeat (2)\n    wait (0.2) seconds\n    create clone of (_myself_ v)\n    change [intro ability v] by (1)\nend\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nswitch costume to (oc still v)\ngo to x: (0) y: (0)\nwait (0.8) seconds\ngo to [front v] layer\nrepeat (6)\n    wait (0.2) seconds\n    switch costume to (oc wave 2 v)\n    wait (0.2) seconds\n    switch costume to (oc wave 1 v)\nend\nwait (0.2) seconds\nswitch costume to (oc still v)\nwait (0.4) seconds\nswitch costume to (oc draw clock 1 v)\nwait (0.3) seconds\nswitch costume to (oc draw clock 2 v)\ncreate clone of (_myself_ v)\nset [intro ability v] to [3]\nwait (2) seconds\nhide\n\nwhen I start as a clone\nif <(Intro Ability) = [1]> then\n    wait (0.5) seconds\n    set [ghost v] effect to (0)\n    go to [front v] layer\n    repeat (200)\n        show\n        switch costume to (logo v)\n        change [color v] effect by (5)\n        change y by (1)\n    end\n    hide\n    delete this clone\nend\nif <(Intro Ability) = [2]> then\n    set [ghost v] effect to (0)\n    go to [front v] layer\n    show\n    switch costume to (background v)\n    wait (7.5) seconds\n    hide\n    delete this clone\nend\nif <(Intro Ability) = [3]> then\n    set [ghost v] effect to (0)\n    wait (0.8) seconds\n    go to x: (-50) y: (0)\n    go to [front v] layer\n    show\n    set size to (10) %\n    switch costume to (clock 1 v)\n    repeat (50)\n        change x by (1)\n        change size by (10)\n    end\n    switch costume to (clock 1/2 v)\n    wait (0.01) seconds\n    switch costume to (clock 2 v)\n    wait (0.3) seconds\n    repeat (03)\n        change [ghost v] effect by (10)\n    end\n    switch backdrop to (2 v)\n    broadcast (Menu v)\n    hide\n    delete this clone\nend\n\nwhen flag clicked\nplay sound [Intro v] until done\n\n@Menus\n\nwhen flag clicked\nhide\n\nwhen I receive [menu v]\nset [menu clones v] to [0]\nrepeat (3)\n    change [menu clones v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(Menu Clones) = [1]> then\n    switch costume to (title v)\n    go to x: (0) y: (100)\n    go to [front v] layer\n    show\n    repeat until <(Menu Clones) = [0]>\n        repeat (10)\n            change size by (2)\n        end\n        wait (0.1) seconds\n        repeat (10)\n            change size by (-2)\n        end\n    end\n    hide\n    delete this clone\nend\nif <(Menu Clones) = [2]> then\n    switch costume to (1a v)\n    go to x: (0) y: (-25)\n    go to [front v] layer\n    show\n    repeat until <(Menu Clones) = [0]>\n        if <touching (mouse-pointer v)?> then\n            switch costume to (1b v)\n            if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                if <(Menu Buttons Able?) = [0]> then\n                    wait (0.3) seconds\n                    set [menu clones v] to [0]\n                    set [loader v] to [1]\n                    broadcast (Start Game v)\n                    switch backdrop to (3 v)\n                end\n            end\n        else\n            switch costume to (1a v)\n        end\n    end\n    hide\n    delete this clone\nend\nif <(Menu Clones) = [3]> then\n    switch costume to (2a v)\n    go to x: (0) y: (-120)\n    go to [front v] layer\n    show\n    repeat until <(Menu Clones) = [0]>\n        if <touching (mouse-pointer v)?> then\n            switch costume to (2b v)\n            if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                if <(Menu Buttons Able?) = [0]> then\n                    set [menu buttons able? v] to [1]\n                    broadcast (Options v)\n                end\n            end\n        else\n            switch costume to (2a v)\n        end\n    end\n    hide\n    delete this clone\nend\n\nwhen I receive [load screen v]\ngo to [front v] layer\nforever\n    if <(Loader) = [1]> then\n        go to x: (0) y: (0)\n        switch costume to (respawning v)\n        show\n        set [ghost v] effect to (100)\n        go to [front v] layer\n        repeat (20)\n            change [ghost v] effect by (-20)\n        end\n        wait (1.3) seconds\n        repeat (20)\n            change [ghost v] effect by (20)\n        end\n        hide\n        set [loader v] to [0]\n    end\nend\n\n@Options\n\nwhen flag clicked\nset [menu buttons able? v] to [0]\nhide\nforever\n    if <(Music Control) = [0]> then\n        stop all sounds\n    end\nend\n\nwhen I receive [options v]\nset [options clones v] to [0]\ngo to [front v] layer\ngo to x: (0) y: (0)\nswitch costume to (menu options v)\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat (3)\n    change [options clones v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(Options Clones) = [1]> then\n    switch costume to (exit 1 v)\n    go to x: (157) y: (-134)\n    go to [front v] layer\n    show\n    repeat until <(Options Clones) = [0]>\n        if <touching (mouse-pointer v)?> then\n            switch costume to (exit 2 v)\n            if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                wait (0.2) seconds\n                set [options clones v] to [0]\n                broadcast (Close Options v)\n                wait (0.2) seconds\n                set [menu buttons able? v] to [0]\n            end\n        else\n            switch costume to (exit 1 v)\n        end\n    end\n    hide\n    delete this clone\nend\nif <(Options Clones) = [2]> then\n    set [music control v] to [1]\n    switch costume to (on 1 v)\n    go to x: (-88) y: (3)\n    go to [front v] layer\n    show\n    repeat until <(Options Clones) = [0]>\n        if <(Music Control) = [0]> then\n            if <touching (mouse-pointer v)?> then\n                switch costume to (off 2 v)\n                if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                    wait (0.2) seconds\n                    set [music control v] to [1]\n                end\n            else\n                switch costume to (off 1 v)\n            end\n        else\n            if <(Music Control) = [1]> then\n                if <touching (mouse-pointer v)?> then\n                    switch costume to (on 2 v)\n                    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                        wait (0.2) seconds\n                        set [music control v] to [0]\n                    end\n                else\n                    switch costume to (on 1 v)\n                end\n            end\n        end\n    end\n    hide\n    delete this clone\nend\nif <(Options Clones) = [3]> then\n    set [cloud control v] to [0]\n    switch costume to (off 1 v)\n    go to x: (-73) y: (-43)\n    go to [front v] layer\n    show\n    repeat until <(Options Clones) = [0]>\n        if <(Cloud Control) = [0]> then\n            if <touching (mouse-pointer v)?> then\n                switch costume to (off 2 v)\n                if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                    wait (0.2) seconds\n                    set [cloud control v] to [1]\n                end\n            else\n                switch costume to (off 1 v)\n            end\n        else\n            if <(Cloud Control) = [1]> then\n                if <touching (mouse-pointer v)?> then\n                    switch costume to (on 2 v)\n                    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                        wait (0.2) seconds\n                        set [cloud control v] to [0]\n                    end\n                else\n                    switch costume to (on 1 v)\n                end\n            end\n        end\n    end\n    hide\n    delete this clone\nend\n\nwhen I receive [close options v]\nhide\n\n@Submenu\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\ngo to [front v] layer\nwait (5) seconds\nforever\n    if <not <<(Dialogue) = [1]> or <(EXIT) = [die]>>> then\n        if <(mouse y) < [-125]> then\n            set [submenu clones? v] to [0]\n            switch costume to (menu v)\n            show\n            glide (0.3) secs to x: (0) y: (0)\n            if <(LEVEL) > [6]> then\n                repeat (3)\n                    change [submenu clones? v] by (1)\n                    create clone of (_myself_ v)\n                end\n            else\n                repeat (1)\n                    change [submenu clones? v] by (1)\n                    create clone of (_myself_ v)\n                end\n            end\n            repeat until <(Submenu Clones?) = [0]>\n                if <not <<(Dialogue) = [1]> or <(EXIT) = [die]>>> then\n                    wait until <(mouse y) > [-100]>\n                    set [submenu clones? v] to [0]\n                else\n                    glide (0.3) secs to x: (0) y: (-100)\n                    hide\n                end\n            end\n            switch costume to (menu v)\n            glide (0.3) secs to x: (0) y: (-100)\n            hide\n        end\n    else\n        switch costume to (menu v)\n        glide (0.3) secs to x: (0) y: (-100)\n        hide\n    end\nend\n\nwhen I start as a clone\nif <not <<(Dialogue) = [1]> or <(EXIT) = [die]>>> then\n    if <(Submenu Clones?) = [1]> then\n        switch costume to (1a v)\n        go to [front v] layer\n        show\n        go to x: (-98) y: (-144)\n        repeat until <(Submenu Clones?) = [0]>\n            if <touching (mouse-pointer v)?> then\n                switch costume to (1b v)\n                if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                    set [exit v] to [die]\n                end\n            else\n                switch costume to (1a v)\n            end\n        end\n        hide\n        delete this clone\n    end\n    if <(Submenu Clones?) = [2]> then\n        switch costume to (2a v)\n        go to [front v] layer\n        show\n        go to x: (199) y: (-144)\n        repeat until <(Submenu Clones?) = [0]>\n            if <touching (mouse-pointer v)?> then\n                switch costume to (2b v)\n                if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                    if <not <(LEVEL) = [9]>> then\n                        wait (0.3) seconds\n                        change [level v] by (1)\n                        set [exit v] to [die]\n                        broadcast (Setup v)\n                    end\n                end\n            else\n                switch costume to (2a v)\n            end\n        end\n        hide\n        delete this clone\n    end\n    if <(Submenu Clones?) = [3]> then\n        switch costume to (3a v)\n        go to [front v] layer\n        show\n        go to x: (146) y: (-144)\n        repeat until <(Submenu Clones?) = [0]>\n            if <touching (mouse-pointer v)?> then\n                switch costume to (3b v)\n                if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                    broadcast (Shield v)\n                end\n            else\n                switch costume to (3a v)\n            end\n        end\n        hide\n        delete this clone\n    end\nelse\n    go to [back v] layer\n    hide\n    delete this clone\nend\n\n@Dialogue\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\ngo to [front v] layer\nwait (0.1) seconds\nwait (3) seconds\nswitch costume to (1a v)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [dialogue v] to [1]\nbroadcast (Change Dialogue v) and wait\nbroadcast (Change Dialogue v) and wait\nwait until <<mouse down?> and <touching (mouse-pointer v)?>>\nset [dialogue v] to [0]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [change dialogue v]\nwait until <<mouse down?> and <touching (mouse-pointer v)?>>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nnext costume\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [dialogue 1 v]\ngo to [front v] layer\nwait (0.1) seconds\nwait (3) seconds\nswitch costume to (2a v)\nset [ghost v] effect to (100)\nshow\nset [dialogue v] to [1]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (Change Dialogue v) and wait\nwait until <<mouse down?> and <touching (mouse-pointer v)?>>\nset [dialogue v] to [0]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [dialogue 2 v]\ngo to [front v] layer\nwait (0.1) seconds\nwait (3) seconds\nswitch costume to (3a v)\nset [ghost v] effect to (100)\nshow\nset [dialogue v] to [1]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (Change Dialogue v) and wait\nbroadcast (Change Dialogue v) and wait\nwait until <<mouse down?> and <touching (mouse-pointer v)?>>\nset [dialogue v] to [0]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Dots\n\nwhen flag clicked\nhide\n\nwhen I receive [menu v]\nwait (0.2) seconds\nrepeat until <(Menu Clones) = [0]>\n    wait (0.3) seconds\n    create clone of (_myself_ v)\nend\nhide\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nswitch costume to (1 v)\ngo to x: (pick random (-200) to (200)) y: (160)\nset [ghost v] effect to (0)\nrepeat until <<touching (_edge_ v)?> and <(y position) < [-150]>>\n    change y by (-4)\n    if <(Menu Clones) = [0]> then\n        hide\n        delete this clone\n    end\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\n@Clouds\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nset [ghost v] effect to (50)\nforever\n    if <not <(Cloud Control) = [0]>> then\n        wait (2.5) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\ngo to [back v] layer\nswitch costume to (pick random (1) to (3))\nshow\ngo to x: (200) y: (pick random (0) to (150))\nrepeat until <<touching (_edge_ v)?> and <(x position) < [-150]>>\n    change x by (-2)\n    if <(Cloud Control) = [0]> then\n        hide\n        delete this clone\n    end\nend\nhide\ndelete this clone\n\n@Player\n\nwhen I receive [green flag v]\nset [level v] to [1]\nhide\ngo to [front v] layer\nset size to (25) %\npoint in direction (90)\n\nwhen I receive [play game v]\nbroadcast (Animate v)\ngo to [back v] layer\nshow\nhide variable [mouse v]\nset [ghost v] effect to (0)\nswitch costume to (1 v)\nforever\n    broadcast (Reset v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(EXIT) = [win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\ndefine Game On\nset size to (25) %\npoint in direction (90)\nset [ghost v] effect to (0)\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nshow\n\ndefine Tick\nif <not <(Dialogue) = [1]>> then\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(mouse x) < [0]> and <(mouse y) > [-100]>>>> then\n        Change Player x by [-8]\n        point in direction (-90)\n        set rotation style [left-right v]\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(mouse x) > [0]> and <(mouse y) > [-100]>>>> then\n        Change Player x by [8]\n        point in direction (90)\n        set rotation style [left-right v]\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [50]>>> then\n        if <(in air) < [4]> then\n            if <(Faster Speed) = [1]> then\n                set [sy v] to [17]\n            else\n                set [sy v] to [15]\n            end\n        end\n    end\n    if <touching (launch pad v)?> then\n        if <(Faster Speed) = [1]> then\n            set [sy v] to [30]\n        else\n            set [sy v] to [27]\n        end\n    end\n    change [sy v] by (-2)\n    Change Player y by (sy)\n    Position\n    Test - Die\n    change [scroll x v] by (round (((x) - (SCROLL X)) / (5)))\n    if <(SCROLL X) < [0]> then\n        set [scroll x v] to [0]\n    end\n    change [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\n    if <(SCROLL Y) < [0]> then\n        set [scroll y v] to [0]\n    end\n    Position\n    if <(y) < [-180]> then\n        broadcast (Load Screen v)\n        set [exit v] to [die]\n        stop [this script v]\n    end\nelse\n    show\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platform v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (platform v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game - Die\nset [loader v] to [1]\nstop [other scripts in sprite v]\nbroadcast (Animate v)\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Restart v)\nset [exit v] to []\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nstop [this script v]\n\ndefine Test - Die\nif <touching (spikes v)?> then\n    set [exit v] to [die]\nend\nif <touching (portal v)?> then\n    broadcast (Load Screen v)\n    set [exit v] to [die]\n    change [level v] by (1)\n    broadcast (Setup v)\n    wait (0.3) seconds\n    if <(LEVEL) = [4]> then\n        broadcast (Dialogue 1 v)\n    end\n    if <(LEVEL) = [7]> then\n        set [faster speed v] to [1]\n        broadcast (Dialogue 2 v)\n    end\nend\nif <touching (water v)?> then\n    if <not <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>>> then\n        change [sy v] by (2)\n    end\nend\nif <touching (enemy v)?> then\n    broadcast (Load Screen v)\n    set [exit v] to [die]\nend\nif <touching (bullet v)?> then\n    broadcast (Load Screen v)\n    set [exit v] to [die]\nend\n\ndefine Game - Win\nhide\n\nwhen I receive [start game v]\nbroadcast (Load Screen v)\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen flag clicked\nset [faster speed v] to [0]\nset [level v] to [1]\nhide\n\nwhen I receive [die v]\ngo to x: (0) y: (-62)\n\nwhen I receive [restart v]\nGame On\n\nwhen I receive [start game v]\nbroadcast (Setup v) and wait\n\nwhen I receive [animate v]\nforever\n    switch costume to (1 v)\n    wait (3) seconds\n    repeat (3)\n        next costume\n    end\nend\n\nwhen [n v] key pressed\nif <<(username) = [Whiteout12]> or <(username) = [Xhort]>> then\n    if <(LEVEL) > [0]> then\n        if <not <(LEVEL) = [9]>> then\n            wait (0.3) seconds\n            broadcast (Load Screen v)\n            set [exit v] to [die]\n            change [level v] by (1)\n            broadcast (Setup v)\n            wait (0.3) seconds\n            if <(LEVEL) = [4]> then\n                broadcast (Dialogue 1 v)\n            end\n            if <(LEVEL) = [7]> then\n                broadcast (Dialogue 2 v)\n            end\n        end\n    end\nend\n\n@Platform\n\nwhen flag clicked\nhide\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nwait (0.2) seconds\nset [platforms: y v] to [0]\nset [x v] to [0]\nif <(LEVEL) > [0]> then\n    hide\n    delete this clone\nend\nif <(LEVEL) = [9]> then\n    switch costume to (lv 9 v)\n    Position. x: [0] y: [0]\nend\nif <(LEVEL) = [8]> then\n    switch backdrop to (5 v)\n    switch costume to (lv 8 v)\n    Position. x: [0] y: [0]\n    Position. x: [500] y: [-150]\n    Position. x: [1000] y: [0]\n    Position. x: [1500] y: [0]\nend\nif <(LEVEL) = [7]> then\n    switch backdrop to (4 v)\n    switch costume to (lv 7 v)\n    Position. x: [0] y: [0]\n    Position. x: [500] y: [0]\n    Position. x: [1000] y: [0]\n    Position. x: [1500] y: [0]\nend\nif <(LEVEL) = [6]> then\n    switch costume to (lv 6 v)\n    Position. x: [0] y: [0]\n    Position. x: [500] y: [0]\n    Position. x: [1000] y: [100]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (lv 5 v)\n    Position. x: [0] y: [0]\n    Position. x: [500] y: [0]\n    Position. x: [1000] y: [100]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (lv 4 v)\n    Position. x: [0] y: [0]\n    Position. x: [575] y: [50]\n    Position. x: [1100] y: [150]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (lv 3 v)\n    Position. x: [0] y: [0]\n    Position. x: [500] y: [0]\n    Position. x: [1200] y: [50]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (lv 2 v)\n    Position. x: [0] y: [0]\n    Position. x: [500] y: [10]\n    Position. x: [1100] y: [0]\nend\nif <(LEVEL) = [1]> then\n    switch costume to (lv 1 v)\n    Position. x: [0] y: [0]\n    Position. x: [450] y: [0]\n    Position. x: [1000] y: [0]\nend\n\ndefine Position. x: (x position) y: (y position)\nset [platforms: y v] to (y position)\nset [x v] to (x position)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\n\n@Spikes\n\nwhen I receive [setup v]\nwait (0.2) seconds\nset [platforms: y v] to [0]\nset [x v] to [0]\nif <(LEVEL) > [0]> then\n    hide\n    delete this clone\nend\nif <(LEVEL) = [9]> then\n    switch costume to (lv 9 v)\nend\nif <(LEVEL) = [8]> then\n    switch costume to (lv 8 v)\n    Position. x: [0] y: [0]\n    Position. x: [500] y: [-150]\n    Position. x: [1000] y: [0]\nend\nif <(LEVEL) = [7]> then\n    switch costume to (lv 7 v)\n    Position. x: [1000] y: [0]\n    Position. x: [1500] y: [0]\nend\nif <(LEVEL) = [6]> then\n    switch costume to (lv 6 v)\n    Position. x: [500] y: [0]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (lv 5 v)\n    Position. x: [500] y: [0]\n    Position. x: [1000] y: [100]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (lv 4 v)\n    Position. x: [0] y: [0]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (lv 3 v)\n    Position. x: [0] y: [0]\n    Position. x: [500] y: [0]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (lv 2 v)\n    Position. x: [0] y: [0]\n    Position. x: [500] y: [10]\n    Position. x: [1100] y: [0]\nend\nif <(LEVEL) = [1]> then\n    switch costume to (lv 1 v)\n    Position. x: [1000] y: [0]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen flag clicked\nhide\n\ndefine Position. x: (x position) y: (y position)\nset [platforms: y v] to (y position)\nset [x v] to (x position)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\n\n@Portal\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nwait (0.2) seconds\nset size to (100) %\nset [platforms: y v] to [0]\nset [x v] to [0]\nswitch costume to (0 v)\nwait (1) seconds\nif <(LEVEL) > [0]> then\n    hide\nend\nif <(LEVEL) = [9]> then\n    set [x v] to [2000]\n    hide\nend\nif <(LEVEL) = [8]> then\n    switch costume to (2 v)\n    set [x v] to [1650]\n    set [platforms: y v] to [100]\nend\nif <(LEVEL) = [7]> then\n    switch costume to (1 v)\n    set [x v] to [1800]\n    set [platforms: y v] to [0]\nend\nif <(LEVEL) = [6]> then\n    switch costume to (jewel v)\n    set [x v] to [1300]\n    set [platforms: y v] to [0]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (1 v)\n    set [x v] to [1300]\n    set [platforms: y v] to [150]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (1 v)\n    set [x v] to [1400]\n    set [platforms: y v] to [100]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (1 v)\n    set [x v] to [1350]\n    set [platforms: y v] to [50]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (1 v)\n    set [x v] to [1400]\n    set [platforms: y v] to [150]\nend\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    set [x v] to [1325]\n    set [platforms: y v] to [100]\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    repeat (20)\n        change [platforms: y v] by (1)\n    end\n    repeat (20)\n        change [platforms: y v] by (-1)\n    end\nend\n\n@Launch Pad\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (lv 2 v)\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [setup v]\nwait (0.2) seconds\nset [platforms: y v] to [0]\nset [x v] to [0]\nif <(LEVEL) > [0]> then\n    hide\n    delete this clone\nend\nif <(LEVEL) = [9]> then\n    switch costume to (lv 9 v)\nend\nif <(LEVEL) = [8]> then\n    switch costume to (lv 8 v)\n    Position. x: [1000] y: [0]\nend\nif <(LEVEL) = [7]> then\n    switch costume to (lv 7 v)\n    Position. x: [1500] y: [0]\nend\nif <(LEVEL) = [6]> then\n    switch costume to (lv 6 v)\n    Position. x: [500] y: [0]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (lv 5 v)\n    Position. x: [1000] y: [100]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (lv 4 v)\n    Position. x: [0] y: [0]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (lv 3 v)\n    Position. x: [0] y: [0]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (lv 2 v)\n    Position. x: [1098] y: [2]\nend\n\ndefine Position. x: (x position) y: (y position)\nset [platforms: y v] to (y position)\nset [x v] to (x position)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nwait until <(EXIT) = [die]>\nhide\ndelete this clone\n\n@Water\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (lv 4 v)\nhide\n\nwhen I receive [setup v]\nwait (0.2) seconds\nset [platforms: y v] to [0]\nset [x v] to [0]\nif <(LEVEL) > [0]> then\n    hide\n    delete this clone\nend\nif <(LEVEL) = [9]> then\n    switch costume to (lv 9 v)\nend\nif <(LEVEL) = [8]> then\n    switch costume to (lv 8 v)\n    Position. x: [500] y: [-150]\nend\nif <(LEVEL) = [7]> then\n    switch costume to (lv 7 v)\nend\nif <(LEVEL) = [6]> then\n    switch costume to (lv 6 v)\n    Position. x: [500] y: [0]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (lv 4 v)\nend\nif <(LEVEL) = [4]> then\n    switch costume to (lv 4 v)\n    Position. x: [575] y: [50]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\ndefine Position. x: (x position) y: (y position)\nset [platforms: y v] to (y position)\nset [x v] to (x position)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\n\n@Enemy\n\nwhen I receive [setup v]\nset [enemy type? v] to [0]\nswitch costume to (nothing? v)\nwait (0.2) seconds\nset [platforms: y v] to [0]\nset [x v] to [0]\npoint in direction (90)\nif <(LEVEL) > [0]> then\n    switch costume to (enemy v)\n    hide\n    delete this clone\nend\nif <(LEVEL) = [9]> then\n    switch costume to (nothing? v)\nend\nif <(LEVEL) = [8]> then\n    switch costume to (nothing? v)\n    Position. x: [1500] y: [0]\n    wait (0.2) seconds\n    switch costume to (nothing? v)\n    change [enemy type? v] by (1)\n    broadcast (Shoot! v)\n    Position. x: [1500] y: [0]\nend\nif <(LEVEL) = [7]> then\n    switch costume to (nothing? v)\n    Position. x: [400] y: [-65]\n    switch costume to (nothing? v)\n    Position. x: [615] y: [-65]\n    wait (0.2) seconds\n    switch costume to (nothing? v)\n    change [enemy type? v] by (1)\n    broadcast (Shoot! v)\n    Position. x: [400] y: [-65]\n    Position. x: [615] y: [-65]\n    switch costume to (nothing? v)\nend\nif <(LEVEL) = [6]> then\n    switch costume to (nothing? v)\n    Position. x: [1000] y: [200]\n    wait (0.2) seconds\n    switch costume to (nothing? v)\n    change [enemy type? v] by (1)\n    broadcast (Shoot! v)\n    Position. x: [1000] y: [200]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (nothing? v)\n    Position. x: [150] y: [-25]\n    wait (0.2) seconds\n    switch costume to (nothing? v)\n    change [enemy type? v] by (1)\n    broadcast (Shoot! v)\n    Position. x: [150] y: [-25]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (nothing? v)\n    Position. x: [1200] y: [125]\nend\n\ndefine Position. x: (x position) y: (y position)\nset [platforms: y v] to (y position)\nset [x v] to (x position)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Enemy Type?) = [0]> then\n    show\nend\nif <(Enemy Type?) = [1]> then\n    switch costume to (gun v)\n    go to [back v] layer\n    show\n    repeat until <(Enemy Type?) = [0]>\n        point towards (player v)\n    end\n    hide\n    delete this clone\nend\n\nwhen I receive [tick v]\nif <(LEVEL) > [3]> then\n    position ((x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\nelse\n    switch costume to (nothing? v)\n    hide\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (nothing? v)\nhide\n\n@Bullet\n\nwhen flag clicked\nhide\n\nwhen I receive [shoot! v]\nrepeat until <(Enemy Type?) = [0]>\n    create clone of (_myself_ v)\n    wait (4) seconds\nend\nhide\n\nwhen I start as a clone\ngo to (enemy v)\npoint towards (player v)\ngo to [back v] layer\nshow\nrepeat until <<touching (_edge_ v)?> or <<touching (player v)?> or <touching (platform v)?>>>\n    move (5) steps\n    if <<(Enemy Type?) = [0]> or <touching (shield v)?>> then\n        hide\n        delete this clone\n    end\nend\nhide\ndelete this clone\n\n@Shield\n\nwhen flag clicked\nhide\n\nwhen I receive [shield v]\ngo to (player v)\ngo to [back v] layer\nshow\nset size to (100) %\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nset [ghost v] effect to (0)\n\n