Zone- A Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [Music v] until done\nend\n\nwhen flag clicked\nset [boss lives v] to [5]\nhide variable [boss lives v]\nforever\n    if <(LVL) = [13]> then\n        show variable [boss lives v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Boss Lives) = [0]> then\n        hide variable [boss lives v]\n        hide variable [score v]\n        broadcast (Win v)\n        stop [all v]\n    end\nend\n\nwhen flag clicked\nshow variable [score v]\n\n@BossPlatforms\n\nwhen flag clicked\ngo to x: (-120) y: (-24)\nhide\n\nwhen I receive [nextlvl v]\nif <(LVL) = [13]> then\n    show\n    change y by (-300)\n    glide (2) secs to x: (-120) y: (-24)\nend\n\n@Boss\n\nwhen flag clicked\nhide\nset [power v] to [0]\nset [shoot v] to [0]\ngo to x: (146) y: (-28)\nhide\nforever\n    if <(LVL) = [13]> then\n        switch costume to (power v)\n        show\n        wait (2.3) seconds\n        switch costume to (stand v)\n        wait (1) seconds\n        say [I didn't want to do this, but you will be a challenge in the future.] for (3) seconds\n        say [So... you must be terminated!] for (2) seconds\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(LVL) = [13]> then\n        show\n        show\n        say [MWAHAHAHA!!!] for (2) seconds\n        wait (3) seconds\n        forever\n            wait (pick random (4.5) to (5.5)) seconds\n            switch costume to (shoot v)\n            set [shoot v] to [1]\n            wait (0.1) seconds\n            set [shoot v] to [0]\n            wait (0.8) seconds\n            switch costume to (stand v)\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(LVL) = [13]> then\n        show\n        show\n        wait (5) seconds\n        forever\n            wait (pick random (7) to (9)) seconds\n            switch costume to (power v)\n            set [power v] to [1]\n            wait (0.1) seconds\n            set [power v] to [0]\n            wait (0.8) seconds\n            switch costume to (stand v)\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\n@Thumbnail\n\nshow\ngo to [front v] layer\nhide variable [score v]\nhide variable [boss lives v]\n\ngo to x: (0) y: (0)\n\nwhen flag clicked\nhide\n\n@BossProjectiles\n\nwhen flag clicked\nhide\nforever\n    if <(LVL) = [13]> then\n        if <(Shoot) = [1]> then\n            create clone of (_myself_ v)\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    show\n    go to x: (68) y: (-47)\n    glide (3) secs to x: (pick random (-100) to (-210)) y: (pick random (-140) to (140))\n    forever\n        repeat until <touching (player v)?>\n            glide (3) secs to (random position v)\n            if <touching (player v)?> then\n                wait (0.1) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        wait (0.1) seconds\n        hide\n    end\nend\n\nwhen I start as a clone\nwait (pick random (9) to (12)) seconds\nhide\n\n@Power\n\nwhen flag clicked\nhide\nforever\n    if <(LVL) = [13]> then\n        if <(Power) = [1]> then\n            create clone of (_myself_ v)\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    show\n    go to x: (150) y: (100)\n    wait (1) seconds\n    glide (3) secs to x: (pick random (-100) to (-210)) y: (pick random (-140) to (140))\n    forever\n        repeat until <touching (player v)?>\n            glide (4) secs to (random position v)\n        end\n    end\nend\n\nwhen I start as a clone\nwait (pick random (5) to (8)) seconds\nhide\n\n@Player\n\nwhen flag clicked\nset size to (300) %\ngo to x: (-100) y: (-135)\nhide variable [yvelocity v]\nhide variable [xvelocity v]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xvelocity v] by (0.8)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xvelocity v] by (-0.8)\n    end\n    set [xvelocity v] to ((Xvelocity) * (0.9))\n    change x by (Xvelocity)\n    if <<touching (bossplatforms v)?> or <touching (platforms v)?>> then\n        change y by (1)\n        if <<touching (bossplatforms v)?> or <touching (platforms v)?>> then\n            change y by (1)\n            if <<touching (bossplatforms v)?> or <touching (platforms v)?>> then\n                change y by (1)\n                if <<touching (bossplatforms v)?> or <touching (platforms v)?>> then\n                    change y by (1)\n                    if <<touching (bossplatforms v)?> or <touching (platforms v)?>> then\n                        change y by (1)\n                        if <<touching (bossplatforms v)?> or <touching (platforms v)?>> then\n                            change x by ((Xvelocity) * (-1))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> then\n                                if <(Xvelocity) > [0]> then\n                                    set [xvelocity v] to [-5]\n                                else\n                                    set [xvelocity v] to [5]\n                                end\n                                set [yvelocity v] to [10]\n                            else\n                                set [xvelocity v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yvelocity v] by (-1)\n    change y by (Yvelocity)\n    if <<touching (bossplatforms v)?> or <touching (platforms v)?>> then\n        change y by ((Yvelocity) * (-1))\n        set [yvelocity v] to [0]\n    end\n    change y by (-1)\n    if <<touching (bossplatforms v)?> or <touching (platforms v)?>> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> then\n            set [yvelocity v] to [10]\n        end\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nforever\n    if <touching (hazards v)?> then\n        change x by (2)\n        change y by (-4)\n        go to x: (-190) y: (-150)\n    end\nend\n\nwhen I receive [nextlvl v]\ngo to x: (-190) y: (-135)\n\nwhen flag clicked\nforever\n    if <touching (bossprojectiles v)?> then\n        wait (0.1) seconds\n        go to x: (-190) y: (-150)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (boss v)?> then\n        go to x: (-190) y: (-150)\n        change [boss lives v] by (-1)\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (power v)?> then\n        go to x: (-190) y: (-150)\n    end\nend\n\n@GameOver\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [gameover v]\nhide variable [score v]\nswitch costume to (gameover v)\nshow\n\nwhen I receive [win v]\nhide variable [score v]\nswitch costume to (victory v)\nshow\n\n@Zone\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nmove (-500) steps\nshow\nrepeat until <touching (nextlvl v)?>\n    move (2) steps\n    if <<[12] < (Score)> and <(LVL) = [1]>> then\n        hide\n        stop [this script v]\n    end\n    if <[12] < (Score)> then\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nshow\nset [score v] to [0]\nforever\n    wait (1) seconds\n    change [score v] by (1)\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[12] < (Score)> then\n        if <(LVL) = [2]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[23] < (Score)> then\n        if <(LVL) = [3]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nhide\n\nwhen I receive [nextlvl v]\nforever\n    if <[34] < (Score)> then\n        if <(LVL) = [4]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[45] < (Score)> then\n        if <(LVL) = [5]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[56] < (Score)> then\n        if <(LVL) = [6]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[67] < (Score)> then\n        if <(LVL) = [7]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[78] < (Score)> then\n        if <(LVL) = [8]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[89] < (Score)> then\n        if <(LVL) = [9]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[100] < (Score)> then\n        if <(LVL) = [10]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[111] < (Score)> then\n        if <(LVL) = [11]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[123] < (Score)> then\n        if <(LVL) = [12]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen I receive [nextlvl v]\nforever\n    if <[250] < (Score)> then\n        if <(LVL) = [13]> then\n            go to x: (-460) y: (0)\n            show\n            repeat until <touching (nextlvl v)?>\n                move (1.1) steps\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (GameOver v)\n        stop [all v]\n    end\nend\n\nwhen I receive [gameover v]\nhide\n\nwhen I receive [win v]\nhide\n\nwhen flag clicked\nshow\n\n@Hazards\n\nwhen I receive [nextlvl v]\nwait (0.1) seconds\nif <(LVL) = [3]> then\n    go to x: (40) y: (-170)\n    switch costume to (lvl3 v)\n    show\n    if <(LVL) = [3]> then\n        go to x: (40) y: (-170)\n        switch costume to (lvl3 v)\n        show\n    end\nend\nif <(LVL) = [4]> then\n    go to x: (117) y: (-169)\n    switch costume to (lvl4 v)\n    show\nend\nif <(LVL) = [5]> then\n    go to x: (-53) y: (-170)\n    switch costume to (lvl5 v)\n    show\nend\nif <(LVL) = [6]> then\n    go to x: (-18) y: (-133)\n    switch costume to (lvl6 v)\n    show\nend\nif <(LVL) = [7]> then\n    go to x: (12) y: (-173)\n    switch costume to (lvl7 v)\n    show\n    if <(LVL) = [7]> then\n        go to x: (12) y: (-173)\n        switch costume to (lvl7 v)\n        show\n    end\nend\nif <(LVL) = [8]> then\n    go to x: (-21) y: (-52)\n    switch costume to (lvl8 v)\n    show\n    if <(LVL) = [8]> then\n        go to x: (-21) y: (-51)\n        switch costume to (lvl8 v)\n        show\n    end\nend\nif <(LVL) = [9]> then\n    go to x: (29) y: (-24)\n    switch costume to (lvl9 v)\n    show\nend\nif <(LVL) = [10]> then\n    go to x: (29) y: (-39)\n    switch costume to (lvl10 v)\n    show\nend\nif <(LVL) = [11]> then\n    go to x: (27) y: (-26)\n    switch costume to (lvl11 v)\n    show\nend\nif <(LVL) = [12]> then\n    go to x: (27) y: (-26)\n    switch costume to (lvl12 v)\n    show\nend\nif <(LVL) = [13]> then\n    go to x: (27) y: (-26)\n    switch costume to (lvl13boss v)\n    show\n    if <(LVL) = [13]> then\n        go to x: (27) y: (-26)\n        switch costume to (lvl13boss v)\n        show\n    end\nend\n\nwhen flag clicked\nhide\n\n@Platforms\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (lvl1 v)\n\nwhen I receive [nextlvl v]\nnext costume\n\n@Words\n\nwhen flag clicked\nswitch costume to (lvl1 v)\ngo to x: (100) y: (160)\nshow\n\nwhen I receive [nextlvl v]\nwait (0.1) seconds\nif <(costume [number v]) = [2]> then\n    go to x: (20) y: (160)\n    stop [this script v]\nend\n\nwhen I receive [nextlvl v]\ngo to x: (100) y: (160)\nnext costume\n\nwhen I receive [nextlvl v]\nwait (0.1) seconds\nif <(costume [number v]) = [12]> then\n    go to x: (20) y: (160)\n    stop [this script v]\nend\n\nwhen I receive [nextlvl v]\nwait (0.1) seconds\nif <(LVL) = [13]> then\n    hide\nend\n\n@NextLVL\n\nwhen flag clicked\nshow\nset [lvl v] to [1]\ngo to x: (238) y: (10)\nforever\n    if <touching (player v)?> then\n        broadcast (NextLVL v)\n        change [lvl v] by (1)\n        wait (0.5) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(LVL) = [13]> then\n        hide\n        stop [other scripts in sprite v]\n    end\nend\n\n