Breaking the Void - a Chaos Unleashed platformer

Instructions: If you haven't played Part 1, click on the link below.\nhttps://scratch.mit.edu/projects/386651749/\nPart 3 is also now out :D\nhttps://scratch.mit.edu/projects/398514677/\n\nSo, finally, part 2 is here. Wonder how many rage quits there would be...\n\nThe controls are pretty much the same, but with a couple more twists;\n\nMove - WASD or Arrow Keys\nAttack - Refer to the game\nSkip level - Press 'p'\nToggle narration - Press 't'\nToggle mute - Press 'm'\nRestart level - Press 'r'\nView achievements - Press 'e'\nHelp - Press 'h'\n\nAny questions ask in the comments below :)

@Stage\n\nwhen flag clicked\nset [exterminator b v] to [0]\nset [exterminator a v] to [0]\nswitch backdrop to (backdrop1 v)\nset [mute v] to [-1]\nset [volume v] to [100]\n\nwhen I receive [next v]\nset [exterminator a v] to [0]\n\nwhen I receive [pre-death v]\nif <not <(Level) = [25]>> then\n    change [exterminator b v] by (Exterminator a)\n    set [exterminator a v] to [0]\nend\n\nwhen I receive [message1 v]\nplay sound [Green Day - 21 GunsEASY Piano Tutorial v] until done\nforever\n    play sound [Iris - Goo Goo Dolls - Piano Cover \(with sheet music\) v] until done\n    if <(Level) = [25]> then\n        stop [this script v]\n    end\n    play sound [Nickelback This Is How You Remind Me Piano Tutorial Synthesia v] until done\n    if <(Level) = [25]> then\n        stop [this script v]\n    end\n    play sound [Debbie Gibson - Foolish Beat \(DJ MichaelAngelo Live Piano Version\) v] until done\n    if <(Level) = [25]> then\n        stop [this script v]\n    end\nend\n\nwhen I receive [message1 v]\nrepeat until <(End) = [1]>\n    if <(Mute) = [1]> then\n        set volume to (0) %\n    else\n        set volume to (Volume) %\n    end\nend\n\nwhen I receive [begin v]\nwait (3) seconds\nrepeat (50)\n    change [volume v] by (-2)\nend\nstop all sounds\nwait (1.5) seconds\nrepeat (100)\n    change [volume v] by (1)\nend\n\nwhen I receive [next v]\nif <(Level) = [24]> then\n    repeat (50)\n        change [volume v] by (-2)\n    end\n    wait (1) seconds\n    stop all sounds\n    repeat (100)\n        change [volume v] by (1)\n    end\n    broadcast (bring me to life v)\n    wait until <(End) = [1]>\n    repeat (100)\n        change [volume v] by (-1)\n    end\n    stop all sounds\n    forever\n        stop [other scripts in sprite v]\n        play sound [Green Day - 21 GunsEASY Piano Tutorial v] until done\n    end\nend\n\nwhen I receive [message1 v]\nrepeat until <(End) = [1]>\n    if <(Text) = [1]> then\n        set [volume v] to [50]\n        wait until <(Text) = [0]>\n        set [volume v] to [100]\n    end\nend\n\nwhen I receive [bring me to life v]\nrepeat until <(End) = [1]>\n    play sound [EVANESCENCE - BRING ME TO LIFE - Piano Tutorial v] until done\nend\n\n@Backdrop\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\nset [ghost v] effect to (0)\n\nwhen I receive [next v]\nchange [ghost v] effect by (1)\n\nwhen I receive [begin v]\nshow\ngo to [back v] layer\n\n@Story Slide\n\nwhen flag clicked\nset size to (100) %\nhide\n\nwhen I receive [intro end v]\nforever\n    if <key (s v) pressed?> then\n        broadcast (Begin v)\n        stop [other scripts in sprite v]\n        repeat (50)\n            change [ghost v] effect by (2)\n        end\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [intro end v]\ngo to [front v] layer\nwait (2) seconds\nshow\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\nrepeat (5)\n    repeat (50)\n        change [ghost v] effect by (-2)\n    end\n    wait (3) seconds\n    if <(costume [number v]) = [5]> then\n        broadcast (Begin v)\n    end\n    repeat (50)\n        change [ghost v] effect by (2)\n    end\n    next costume\nend\nhide\n\nwhen I receive [end v]\nset size to (100) %\nshow\nswitch costume to (costume6 v)\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (5) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\nwait (6) seconds\nset [ghost v] effect to (100)\nswitch costume to (costume7 v)\nset size to (65) %\nshow\nrepeat (100)\n    change [ghost v] effect by (-2)\n    change size by (0.1)\nend\nrepeat (6)\n    next costume\n    change size by (0.1)\n    go to [front v] layer\nend\nbroadcast (Endend v)\nrepeat (50)\n    go to [front v] layer\n    change size by (0.1)\nend\nrepeat (50)\n    change size by (0.1)\n    change [ghost v] effect by (2)\nend\n\nwhen I receive [boss v]\nif <(Level) = [25]> then\n    switch costume to (costume6 v)\n    set [ghost v] effect to (100)\n    wait until <(Life) < [2]>\n    wait (0.2) seconds\n    show\n    repeat (50)\n        change [ghost v] effect by (-2)\n    end\n    wait (0.5) seconds\n    repeat (50)\n        change [ghost v] effect by (2)\n    end\n    hide\nend\n\nwhen I receive [almost end v]\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (0.5) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n@Player\n\nwhen flag clicked\nhide\nset [allow move v] to [0]\nset [spike harm v] to [1]\n\nwhen I receive [begin v]\nset [allow move v] to [0]\nset [allow portal v] to [1]\nset [auto-right v] to [0]\nset [x2 v] to [0]\nset [y2 v] to [0]\ngo to x: (-192) y: (-100)\nset rotation style [left-right v]\npoint in direction (90)\nshow\nforever\n    if <<<<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <(Allow Move) = [1]>> and <(Text) = [0]>> or <(Auto-Right) = [1]>> then\n        change [x2 v] by (1.1)\n        point in direction (90)\n    end\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <(Allow Move) = [1]>> and <(Text) = [0]>> then\n        change [x2 v] by (-1.1)\n        point in direction (-90)\n    end\n    set [x2 v] to ((x2) * (0.87))\n    change x by (x2)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(Allow Move) = [1]>> and <(Text) = [0]>> then\n                                change x by ((x2) * (-1))\n                                change y by (-5)\n                                if <(x2) > [0]> then\n                                    set [x2 v] to [-7]\n                                else\n                                    set [x2 v] to [7]\n                                end\n                                set [y2 v] to [10]\n                            else\n                                set [x2 v] to ((x2) * (-1.3))\n                                change x by (x2)\n                                set [x2 v] to [0]\n                                change x by ((x2) / (5))\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y2 v] by (-1)\n    change y by (y2)\n    if <touching (ground v)?> then\n        change y by ((y2) * (-1))\n        set [y2 v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(Allow Move) = [1]>> and <(Text) = [0]>> then\n            set [y2 v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (ground v)?> then\n        change x by ((x2) * (-1))\n        change y by (-5)\n    end\n    if <touching (ground v)?> then\n        change y by ((y2) * (-1))\n        set [y2 v] to [0]\n    end\n    if <<touching (portal v)?> and <(Allow Portal) = [1]>> then\n        if <(Level) = [25]> then\n            broadcast (End v)\n            set [allow move v] to [0]\n            wait (2) seconds\n        end\n        broadcast (Next v)\n    end\n    if <<(Die Again) = [1]> and <<<touching (intro_blind v)?> and <(Intro y) > [1.5]>> or <<touching (projectile v)?> or <<<touching (spikes v)?> and <(Spike Harm) = [1]>> or <<touching (fireball v)?> or <<<(Boss Harm) = [1]> and <touching (boss v)?>> or <[-185] > (y position)>>>>>>> then\n        broadcast (Pre-Death v)\n        set [die again v] to [0]\n        change [death v] by (1)\n        wait until <(Die Again) = [1]>\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(Allow Move) = [1]>> and <(Text) = [0]>> then\n        switch costume to (jumping v)\n    else\n        if <<<(Text) = [0]> and <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> and <(Allow Move) = [1]>>> or <(Auto-Right) = [1]>> then\n            if <(costume [name v]) = [Standing 10]> then\n                switch costume to (standing 1 v)\n            else\n                next costume\n            end\n            wait (0.01) seconds\n        else\n            switch costume to (standing 1 v)\n        end\n    end\nend\n\nwhen I receive [begin v]\nforever\n    set [player x v] to (x position)\n    set [player y v] to (y position)\nend\n\nwhen I receive [next v]\nif <(Level) = [25]> then\n    hide\n    set [y2 v] to [0]\n    set [x2 v] to [0]\n    set [arm side v] to [-5]\n    point in direction (90)\n    wait (2) seconds\n    go to x: (-250) y: (-100)\n    show\n    set [auto-right v] to [1]\n    wait (0.5) seconds\n    set [auto-right v] to [0]\nelse\n    go to x: (-192) y: (-100)\n    set [y2 v] to [0]\n    set [x2 v] to [0]\n    set [arm side v] to [-5]\n    point in direction (90)\nend\n\nwhen I receive [death v]\nset [brightness v] effect to (0)\nif <(Spike Harm) = [0]> then\n    set [ghost v] effect to (50)\nelse\n    set [ghost v] effect to (0)\nend\ngo to x: (-192) y: (-100)\nset [y2 v] to [0]\nset [x2 v] to [0]\nset [allow move v] to [1]\nset [arm side v] to [-5]\npoint in direction (90)\n\nwhen [r v] key pressed\nbroadcast (Pre-Death v)\n\nwhen I receive [begin v]\nset [completion v] to [0]\nforever\n    if <key (p v) pressed?> then\n        if <<(Text) = [0]> and <(Allow Portal) = [1]>> then\n            set [completion v] to [1]\n            go to (portal v)\n            wait (5) seconds\n        end\n    end\n    if <(Level) = [26]> then\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Mute) = [-1]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [pre-death v]\nif <(End) = [0]> then\n    set [die again v] to [0]\n    set [allow move v] to [0]\n    set [x2 v] to [0]\n    set [y2 v] to [0]\n    if <(Mute) = [-1]> then\n        start sound [Hit Enemy v]\n    end\n    repeat (5)\n        change [brightness v] effect by (-10)\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    broadcast (Death v)\n    set [die again v] to [1]\nend\n\nwhen I receive [crash v]\nrepeat (5)\n    change x by (1)\nend\nrepeat (5)\n    change x by (-2)\n    change y by (-2)\nend\nrepeat (5)\n    change x by (1)\n    change y by (4)\nend\nrepeat (5)\n    change y by (-2)\nend\n\nwhen I receive [use key 3 v]\nset [spike harm v] to [0]\nrepeat (10)\n    change [ghost v] effect by (5)\nend\nwait (7) seconds\nrepeat (10)\n    change [ghost v] effect by (-5)\nend\nset [spike harm v] to [1]\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nwait (1) seconds\nhide\n\nwhen I receive [almost end v]\nwait (2) seconds\ngo to x: (203) y: (110)\npoint in direction (-90)\n\n@Arm\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\npoint in direction (90)\nset [arm side v] to [-5]\nset [allow weapon v] to [2]\nset [weapon v] to [0]\nshow\nforever\n    go to x: ((Player x) + (Arm Side)) y: ((player y) - (1))\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <(Allow Move) = [1]>> then\n        set [arm side v] to [5]\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <(Allow Move) = [1]>> then\n        set [arm side v] to [-5]\n    end\n    change x by (x2)\n    change y by (y2)\nend\n\nwhen I receive [begin v]\nforever\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <(Allow Move) = [1]>> then\n            repeat (2)\n                turn left (10) degrees\n                wait (0.01) seconds\n            end\n            repeat (4)\n                turn left (-10) degrees\n                wait (0.01) seconds\n            end\n            repeat (2)\n                turn left (10) degrees\n                wait (0.01) seconds\n            end\n            if <not <(Weapon) = [2]>> then\n                point in direction (90)\n            end\n        end\n        if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <(Allow Move) = [1]>> or <(Auto-Right) = [1]>> then\n            repeat (2)\n                turn left (-10) degrees\n                wait (0.01) seconds\n            end\n            repeat (4)\n                turn left (10) degrees\n                wait (0.01) seconds\n            end\n            repeat (2)\n                turn left (-10) degrees\n                wait (0.01) seconds\n            end\n            if <not <(Weapon) = [2]>> then\n                point in direction (90)\n            end\n        end\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <(Weapon) = [0]> then\n        switch costume to (costume1 v)\n    else\n        if <(Weapon) = [1]> then\n            if <(Sword Damage) = [0]> then\n                if <(Arm Side) = [5]> then\n                    switch costume to (sword 2 v)\n                else\n                    switch costume to (sword 1 v)\n                end\n            else\n                if <(Arm Side) = [5]> then\n                    switch costume to (sword 4 v)\n                else\n                    switch costume to (sword 3 v)\n                end\n            end\n        else\n            if <<(Weapon) = [2]> and <not <key (space v) pressed?>>> then\n                switch costume to (bow 1 v)\n            else\n                if <<(Weapon) = [3]> and <not <key (space v) pressed?>>> then\n                    if <not <(Key 1) = [1]>> then\n                        if <(Arm Side) = [5]> then\n                            switch costume to (red key2 v)\n                        else\n                            switch costume to (red key v)\n                        end\n                    end\n                else\n                    if <<(Weapon) = [4]> and <not <key (space v) pressed?>>> then\n                        if <not <(Key 2) = [1]>> then\n                            if <(Arm Side) = [5]> then\n                                switch costume to (green key2 v)\n                            else\n                                switch costume to (green key v)\n                            end\n                        end\n                    else\n                        if <<(Weapon) = [5]> and <not <key (space v) pressed?>>> then\n                            if <not <(Key 3) = [1]>> then\n                                if <(Arm Side) = [5]> then\n                                    switch costume to (black key 2 v)\n                                else\n                                    switch costume to (black key v)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [pre-death v]\nrepeat (5)\n    change [brightness v] effect by (-10)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [begin v]\nforever\n    if <(Allow Move) = [1]> then\n        if <key (0 v) pressed?> then\n            set [weapon v] to [0]\n            point in direction (90)\n        end\n        if <key (1 v) pressed?> then\n            set [weapon v] to [1]\n            point in direction (90)\n        end\n        if <key (2 v) pressed?> then\n            set [weapon v] to [2]\n            point in direction (90)\n        end\n        if <(Allow Weapon) > [2]> then\n            if <key (z v) pressed?> then\n                set [weapon v] to [3]\n                point in direction (90)\n            end\n            if <(Allow Weapon) > [3]> then\n                if <key (x v) pressed?> then\n                    set [weapon v] to [4]\n                    point in direction (90)\n                end\n                if <(Allow Weapon) > [4]> then\n                    if <key (c v) pressed?> then\n                        set [weapon v] to [5]\n                        point in direction (90)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [next v]\nset [arm side v] to [5]\npoint in direction (90)\n\nwhen I receive [player wave v]\nwait (1) seconds\nrepeat (10)\n    turn right (36) degrees\nend\n\nwhen I receive [player small wave v]\nwait (1) seconds\nrepeat (10)\n    turn right (5) degrees\nend\nrepeat (10)\n    turn right (-5) degrees\nend\n\nwhen I receive [death v]\nif <(Spike Harm) = [0]> then\n    set [ghost v] effect to (50)\nelse\n    set [ghost v] effect to (0)\nend\nset [brightness v] effect to (0)\n\nwhen flag clicked\nforever\n    if <(Mute) = [-1]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen [space v] key pressed\nforever\n    if <<key (space v) pressed?> and <(Allow Move) = [1]>> then\n        if <<(Weapon) = [1]> or <(Weapon) = [0]>> then\n            if <(Arm Side) = [5]> then\n                if <(Weapon) = [1]> then\n                    set [sword damage v] to [1]\n                    start sound [Sword Swing v]\n                end\n                repeat (10)\n                    turn left (36) degrees\n                end\n                set [sword damage v] to [0]\n            else\n                if <(Weapon) = [1]> then\n                    set [sword damage v] to [1]\n                    start sound [Sword Swing v]\n                end\n                repeat (10)\n                    turn left (-36) degrees\n                end\n                set [sword damage v] to [0]\n            end\n            point in direction (90)\n            wait (0.4) seconds\n        end\n    end\n    if <<(Text) = [0]> and <<<key (space v) pressed?> and <(Weapon) = [2]>> and <(Arrow Allow) = [1]>>> then\n        set [arm direction v] to ((direction) + (90))\n        set [allow move v] to [0]\n        broadcast (Arrow v)\n        switch costume to (bow 2 v)\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            turn left (5) degrees\n        end\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            turn left (-5) degrees\n        end\n        if <not <<key (space v) pressed?> and <(Weapon) = [2]>>> then\n            point in direction (90)\n        end\n    else\n        if <<(Arrow Allow) = [1]> and <<(Text) = [0]> and <<(Weapon) = [3]> and <key (space v) pressed?>>>> then\n    end\nend\n\nwhen [space v] key pressed\nif <<(Text) = [0]> and <<<key (space v) pressed?> and <(Weapon) = [3]>> and <(Key 1) = [0]>>> then\n    set [key 1 v] to [1]\n    set [allow move v] to [0]\n    if <(Arm Side) = [5]> then\n        switch costume to (red key4 v)\n        repeat (20)\n            turn right (7) degrees\n            if <not <key (space v) pressed?>> then\n                stop all sounds\n                point in direction (90)\n                set [key 1 v] to [0]\n                stop [this script v]\n            end\n        end\n        point in direction (-130)\n    else\n        switch costume to (red key3 v)\n        repeat (20)\n            turn right (-7) degrees\n            if <not <key (space v) pressed?>> then\n                stop all sounds\n                point in direction (90)\n                set [key 1 v] to [0]\n                stop [this script v]\n            end\n        end\n        point in direction (-50)\n    end\n    reset timer\n    start sound [Laser beam charge sound effect v]\n    repeat until <(timer) > [3]>\n        change [brightness v] effect by (0.9)\n        if <not <key (space v) pressed?>> then\n            stop all sounds\n            point in direction (90)\n            set [brightness v] effect to (0)\n            set [key 1 v] to [0]\n            stop [this script v]\n        end\n    end\n    broadcast (KeyReady v)\n    repeat until <not <key (space v) pressed?>>\n        set [allow move v] to [0]\n    end\n    if <(Arm Side) = [5]> then\n        switch costume to (red key4 v)\n        repeat (5)\n            turn right (-21) degrees\n        end\n    else\n        switch costume to (red key3 v)\n        repeat (5)\n            turn right (21) degrees\n        end\n    end\n    broadcast (Use Key v)\n    wait (2) seconds\n    point in direction (90)\n    set [brightness v] effect to (90)\n    repeat (10)\n        change [brightness v] effect by (-14)\n    end\n    set [key 1 v] to [2]\n    wait (10) seconds\n    set [key 1 v] to [1]\n    repeat (10)\n        change [brightness v] effect by (5)\n    end\n    set [key 1 v] to [0]\nend\n\nwhen I receive [begin v]\nforever\n    if <(Weapon) = [3]> then\n        if <(Key 1) = [2]> then\n            set [brightness v] effect to (-50)\n        end\n        if <(Key 1) = [0]> then\n            set [brightness v] effect to (0)\n        end\n    else\n        if <(Weapon) = [4]> then\n            if <(Key 2) = [2]> then\n                set [brightness v] effect to (-50)\n            end\n            if <(Key 2) = [0]> then\n                set [brightness v] effect to (0)\n            end\n        else\n            if <(Weapon) = [5]> then\n                if <(Key 3) = [2]> then\n                    set [brightness v] effect to (-50)\n                end\n                if <(Key 3) = [0]> then\n                    set [brightness v] effect to (0)\n                end\n            else\n                set [brightness v] effect to (0)\n            end\n        end\n    end\nend\n\nwhen I receive [crash v]\nrepeat (5)\n    change x by (1)\nend\nrepeat (5)\n    change x by (-2)\n    change y by (-2)\nend\nrepeat (5)\n    change x by (1)\n    change y by (4)\nend\nrepeat (5)\n    change y by (-2)\nend\n\nwhen [space v] key pressed\nif <<(Text) = [0]> and <<<key (space v) pressed?> and <(Weapon) = [4]>> and <(Key 2) = [0]>>> then\n    set [key 2 v] to [1]\n    set [allow move v] to [0]\n    if <(Arm Side) = [5]> then\n        switch costume to (green key4 v)\n        repeat (20)\n            turn right (7) degrees\n            change [brightness v] effect by (4)\n        end\n        point in direction (-130)\n    else\n        switch costume to (green key3 v)\n        repeat (20)\n            turn right (-7) degrees\n            change [brightness v] effect by (4)\n        end\n        point in direction (-50)\n    end\n    broadcast (Use Key 2 v)\n    wait (1) seconds\n    if <(Arm Side) = [5]> then\n        switch costume to (green key4 v)\n        repeat (20)\n            turn right (-7) degrees\n        end\n    else\n        switch costume to (green key3 v)\n        repeat (20)\n            turn right (7) degrees\n        end\n    end\n    point in direction (90)\n    repeat (10)\n        change [brightness v] effect by (-8)\n    end\n    set [key 2 v] to [2]\n    wait (15) seconds\n    set [key 2 v] to [1]\n    repeat (10)\n        change [brightness v] effect by (4)\n    end\n    set [key 2 v] to [0]\nend\n\nwhen [space v] key pressed\nif <<(Text) = [0]> and <<<key (space v) pressed?> and <(Weapon) = [5]>> and <(Key 3) = [0]>>> then\n    set [key 3 v] to [1]\n    set [allow move v] to [0]\n    if <(Arm Side) = [5]> then\n        switch costume to (black key 4 v)\n        repeat (20)\n            turn right (7) degrees\n            change [brightness v] effect by (4)\n        end\n        point in direction (-130)\n    else\n        switch costume to (black key 3 v)\n        repeat (20)\n            turn right (-7) degrees\n            change [brightness v] effect by (4)\n        end\n        point in direction (-50)\n    end\n    broadcast (Use Key 3 v)\n    set [key 3 v] to [2]\n    repeat (10)\n        change [ghost v] effect by (5)\n    end\n    wait (1) seconds\n    if <(Arm Side) = [5]> then\n        switch costume to (black key 4 v)\n        repeat (20)\n            turn right (-7) degrees\n        end\n    else\n        switch costume to (black key 3 v)\n        repeat (20)\n            turn right (7) degrees\n        end\n    end\n    point in direction (90)\n    repeat (10)\n        change [brightness v] effect by (-8)\n    end\n    wait (5) seconds\n    repeat (10)\n        change [ghost v] effect by (-5)\n    end\n    wait (10) seconds\n    set [key 3 v] to [1]\n    repeat (10)\n        change [brightness v] effect by (4)\n    end\n    set [key 3 v] to [0]\nend\n\nwhen I receive [boss v]\nif <<(Level) = [24]> or <(Level) = [25]>> then\n    wait until <(End) = [1]>\n    point in direction (90)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nwait (1) seconds\nhide\n\nwhen I receive [almost end v]\nwait (2) seconds\npoint in direction (90)\nswitch costume to (sword 2 v)\nset [arm side v] to [5]\n\n@text\n\nwhen flag clicked\nset [time v] to [-1]\nhide\n\nwhen I receive [begin v]\nset language to (en v)::tts\nset voice to (tenor v)::tts\nset [text v] to [1]\nwait (2) seconds\nspeak [I now returned to the city where it all begun]::tts\nset [text v] to [0]\nset [allow move v] to [1]\nrepeat until <(End) = [1]>\n    if <(Text) = [0]> then\n        change [time v] by (1)\n    end\n    wait (1) seconds\nend\n\nwhen I receive [next v]\nif <(Mute) = [-1]> then\n    if <(Toggle Text) = [-1]> then\n        if <not <(Level) = [15]>> then\n            set [text v] to [1]\n        end\n        if <(Level) = [1]> then\n            speak [I have to find he 3 Portal Keys to close the Void]::tts\n        else\n            if <(Level) = [2]> then\n                speak [As you may have noticed, there's no more text]::tts\n                speak [I know how much you guys hate it]::tts\n            else\n                if <(Level) = [3]> then\n                    speak [Press 'h' to recap the controls]::tts\n                else\n                    if <(Level) = [4]> then\n                        speak [You could check out the achievements by pressing e]::tts\n                    else\n                        if <(Level) = [5]> then\n                            speak [Just in case, press 'p' to skip]::tts\n                        else\n                            if <(Level) = [6]> then\n                                speak [You could press m to mute or press tee to shut me up]::tts\n                            else\n                                if <(Level) = [7]> then\n                                    speak [Also, please stop complaining about the sliding, most levels are impossible without it]::tts\n                                else\n                                    if <(Level) = [8]> then\n                                        speak [What on earth is that???]::tts\n                                    else\n                                        if <(Level) = [9]> then\n                                            speak [The First Key got to be here somewhere]::tts\n                                        else\n                                            if <(Level) = [10]> then\n                                                speak [The Keys are not just simply keys, they are also powerful weapons. Hold space for 3 seconds to charge the Key, then release it to fire]::tts\n                                            else\n                                                if <(Level) = [11]> then\n                                                    speak [Press z to switch to the Red Key. If you missed that, press h to read the controls]::tts\n                                                else\n                                                    if <(Level) = [12]> then\n                                                        speak [Hold up, this is too easy, something's not right]::tts\n                                                        broadcast (Boss v)\n                                                        wait (2) seconds\n                                                        speak [Of course there's a catch]::tts\n                                                        set voice to (giant v)::tts\n                                                        speak [Those who seeks to pass]::tts\n                                                        set voice to (tenor v)::tts\n                                                        speak [Oh no, here we go again]::tts\n                                                        set voice to (giant v)::tts\n                                                        speak [Will have to face me first]::tts\n                                                        set voice to (tenor v)::tts\n                                                        speak [What are we waiting for, let's go!]::tts\n                                                    else\n                                                        if <(Level) = [13]> then\n                                                            speak [Phew, that was intense. At least we got the second key. Press space to use it]::tts\n                                                        else\n                                                            if <(Level) = [14]> then\n                                                                speak [Press x to switch to the Green Key]::tts\n                                                            else\n                                                                if <(Level) = [15]> then\n                                                                    wait (1) seconds\n                                                                    set [text v] to [1]\n                                                                    speak [Did that guy just disappeared?]::tts\n                                                                else\n                                                                    if <(Level) = [16]> then\n                                                                        speak [it looks like they only appear when they are near you, that's kinda terrifying]::tts\n                                                                    else\n                                                                        if <(Level) = [18]> then\n                                                                            broadcast (Boss v)\n                                                                            speak [Another one? Okay, whatever, just go on with your speech]::tts\n                                                                            wait (1) seconds\n                                                                            speak [Um...excuse me?]::tts\n                                                                            wait (1) seconds\n                                                                            speak [No evil monologue? that's great. And terrifying]::tts\n                                                                        else\n                                                                            if <(Level) = [19]> then\n                                                                                speak [Finally, we got all 3 portal keys, all we need to do now is bring it to the void.]::tts\n                                                                                speak [To use the black key, press space to walk through spikes]::tts\n                                                                                speak [Press c to switch the the black key]::tts\n                                                                            else\n                                                                                if <(Level) = [20]> then\n                                                                                    speak [Now we just got to get to the void and close it]::tts\n                                                                                else\n                                                                                    if <(Level) = [23]> then\n                                                                                        speak [We're almost there!]::tts\n                                                                                    else\n                                                                                        if <(Level) = [24]> then\n                                                                                            speak [Finally! we done it, the void. It all ends here]::tts\n                                                                                            broadcast (Boss v)\n                                                                                            wait (1) seconds\n                                                                                            speak [I spoke too soon]::tts\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        set [text v] to [0]\n    end\nend\n\nwhen I receive [begin v]\nset [toggle text v] to [-1]\nset [mute v] to [-1]\nforever\n    if <key (t v) pressed?> then\n        set [toggle text v] to ((Toggle Text) * (-1))\n        if <(Toggle Text) = [1]> then\n            set [ghost v] effect to (100)\n        else\n            set [ghost v] effect to (0)\n        end\n        wait (0.1) seconds\n    end\n    if <key (m v) pressed?> then\n        set [mute v] to ((Mute) * (-1))\n        if <(Mute) = [1]> then\n            set [ghost v] effect to (100)\n        else\n            set [ghost v] effect to (0)\n        end\n        wait (0.1) seconds\n    end\n    if <<<(Toggle Text) = [1]> or <(Mute) = [1]>> and <<(Achievements) = [-1]> and <(Help) = [-1]>>> then\n        set [text v] to [0]\n        show\n        clear graphic effects\n    end\n    if <<<(Toggle Text) = [-1]> and <(Mute) = [-1]>> and <(Text) = [0]>> then\n        hide\n    end\n    if <(End) = [1]> then\n        stop [this script v]\n    end\nend\n\nwhen I receive [next v]\nset [pixelate v] effect to (100)\nswitch costume to (nada2 v)\nif <(Text) = [1]> then\n    show\n    repeat (15)\n        change [pixelate v] effect by (-6.66)\n    end\nend\nwait until <(Text) = [0]>\nrepeat (15)\n    change [pixelate v] effect by (6.66)\nend\nhide\n\nwhen I receive [begin v]\nwait (2) seconds\nset [pixelate v] effect to (100)\nswitch costume to (nada2 v)\nif <(Text) = [1]> then\n    show\n    repeat (10)\n        change [pixelate v] effect by (-10)\n    end\nend\nwait until <(Text) = [0]>\nrepeat (10)\n    change [pixelate v] effect by (10)\nend\nhide\nwait until <(Key 1) = [2]>\nif <(Mute) = [-1]> then\n    if <(Toggle Text) = [-1]> then\n        set [text v] to [1]\n        speak [The Key will be disabled for a short amount of time now.]::tts\n        set [text v] to [0]\n    end\nend\n\nwhen I receive [next v]\nif <<(Mute) = [1]> or <(Toggle Text) = [1]>> then\n    if <<<(Level) = [12]> or <(Level) = [18]>> or <(Level) = [24]>> then\n        wait (1) seconds\n        broadcast (Boss v)\n    end\nend\n\nwhen I receive [begin v]\nrepeat until <(End) = [1]>\n    if <(Mute) = [1]> then\n        switch costume to (nada3 v)\n    else\n        if <(Toggle Text) = [1]> then\n            switch costume to (nada v)\n        end\n    end\nend\n\n@Particles\n\nwhen flag clicked\nrepeat (10)\n    create clone of (_myself_ v)\n    wait (pick random (0.5) to (1)) seconds\nend\nhide\n\nwhen I start as a clone\nshow\ngo to x: (-200) y: (pick random (200) to (0))\nset [ghost v] effect to (0)\ngo [forward v] (pick random (5) to (-5)) layers\nrepeat (pick random (100) to (120))\n    change x by (4)\n    change y by (-1)\n    turn right (15) degrees\n    change [ghost v] effect by (1)\nend\ncreate clone of (_myself_ v)\ndelete this clone\n\n@Portal\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nshow\ngo to x: (204) y: (-109)\nforever\n    repeat (40)\n        change y by (0.1)\n        turn right (1) degrees\n        wait until <(Text) = [0]>\n    end\n    repeat (40)\n        change y by (-0.1)\n        turn right (1) degrees\n        wait until <(Text) = [0]>\n    end\nend\n\nwhen I receive [next v]\nif <(Level) = [7]> then\n    go to x: (-159) y: (140)\nelse\n    if <(Level) = [9]> then\n        go to x: (201) y: (-66)\n    else\n        if <(Level) = [10]> then\n            go to x: (-199) y: (97)\n        else\n            if <(Level) = [15]> then\n                go to x: (208) y: (20)\n            else\n                if <(Level) = [16]> then\n                    go to x: (-200) y: (123)\n                else\n                    if <(Level) = [17]> then\n                        go to x: (197) y: (137)\n                    else\n                        if <(Level) = [18]> then\n                            go to x: (-206) y: (134)\n                        else\n                            if <(Level) = [23]> then\n                                go to x: (-60) y: (-111)\n                            else\n                                if <(Level) = [21]> then\n                                    go to x: (-198) y: (122)\n                                else\n                                    if <[23] < (Level)> then\n                                        stop [other scripts in sprite v]\n                                        hide\n                                    else\n                                        go to x: (204) y: (-107)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [next v]\nif <(Level) = [9]> then\n    set [allow portal v] to [0]\nelse\n    if <(Level) = [12]> then\n        set [allow portal v] to [0]\n    else\n        if <(Level) = [18]> then\n            set [allow portal v] to [0]\n        else\n            set [allow portal v] to [1]\n        end\n    end\nend\n\nwhen I receive [death v]\nif <(Level) = [10]> then\n    set [allow portal v] to [0]\nend\n\nwhen I receive [begin v]\nforever\n    if <<(Text) = [1]> or <(Allow Portal) = [0]>> then\n        set [brightness v] effect to (-50)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [boss v]\nif <<(Level) = [13]> or <(Level) = [12]>> then\n    repeat until <(Allow Weapon) = [4]>\n        set [allow portal v] to [0]\n    end\nend\nif <<(Level) = [18]> or <(Level) = [19]>> then\n    repeat until <(Allow Weapon) = [5]>\n        set [allow portal v] to [0]\n    end\nend\nset [allow portal v] to [1]\n\nwhen I receive [crash v]\nrepeat (5)\n    change x by (1)\nend\nrepeat (5)\n    change x by (-2)\n    change y by (-2)\nend\nrepeat (5)\n    change x by (1)\n    change y by (4)\nend\nrepeat (5)\n    change y by (-2)\nend\n\n@Ground\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nhide\nset [level v] to [1]\n\nwhen I receive [next v]\nnext costume\n\nwhen I receive [begin v]\nswitch costume to (costume1 v)\nset [level v] to [1]\nshow\nforever\n    set [level v] to (costume [number v])\n    if <(Level) = [25]> then\n        switch costume to (costume25 v)\n        repeat (2)\n            create clone of (_myself_ v)\n            next costume\n        end\n        go [backward v] (1) layers\n        if <<(Toggle Text) = [-1]> or <(Mute) = [-1]>> then\n            wait (3) seconds\n        else\n            wait until <(Text) = [0]>\n        end\n        glide (3) secs to x: (0) y: (200)\n        stop [this script v]\n    end\nend\n\nwhen I receive [crash v]\nrepeat (5)\n    change x by (1)\nend\nrepeat (5)\n    change x by (-2)\n    change y by (-2)\nend\nrepeat (5)\n    change x by (1)\n    change y by (4)\nend\nrepeat (5)\n    change y by (-2)\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [26]> then\n    show\n    go to x: (0) y: (0)\n    if <<(Toggle Text) = [-1]> or <(Mute) = [-1]>> then\n        wait (3) seconds\n    else\n        wait until <(Text) = [0]>\n    end\n    repeat (40)\n        turn right (0.5) degrees\n        change y by (3)\n        change x by (1)\n    end\nend\nif <(costume [number v]) = [25]> then\n    show\n    go to x: (0) y: (0)\nend\nwait until <(Level) = [end]>\ndelete this clone\n\n@Spikes\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\nwait (3) seconds\nforever\n    if <(Level) = [25]> then\n        hide\n        wait (1) seconds\n        wait until <(Text) = [0]>\n        wait (5) seconds\n        repeat until <[2] > (Life)>\n            create clone of (_myself_ v)\n            hide\n            switch costume to (pick random (25) to (34))\n            go to x: (0) y: (-20)\n            wait (1) seconds\n            show\n            glide (0.5) secs to x: (0) y: (0)\n            wait (3) seconds\n            glide (0.5) secs to x: (0) y: (-20)\n        end\n    else\n        if <not <(Level) = [13]>> then\n            show\n            go to x: (0) y: (0)\n            point in direction (90)\n            switch costume to (Level)\n        else\n            hide\n        end\n    end\nend\n\nwhen I receive [boss attack v]\nif <<(Life) > [1]> and <(Level) = [13]>> then\n    set rotation style [left-right v]\n    go to (boss v)\n    if <(Player x) > (x position)> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    move (30) steps\n    repeat (10)\n        create clone of (_myself_ v)\n        move (20) steps\n    end\nend\n\nwhen I start as a clone\nif <(Level) = [13]> then\n    show\n    switch costume to (costume13 v)\n    if <(Mute) = [-1]> then\n        start sound [Hit Enemy v]\n    end\n    repeat (10)\n        change y by (5)\n    end\n    repeat (10)\n        change y by (-5)\n    end\n    delete this clone\nelse\n    if <(Level) = [25]> then\n        repeat until <[2] > (Life)>\n            hide\n            switch costume to (pick random (25) to (34))\n            go to x: (0) y: (-20)\n            wait (1) seconds\n            show\n            glide (0.5) secs to x: (0) y: (0)\n            wait (3) seconds\n            glide (0.5) secs to x: (0) y: (-20)\n            delete this clone\n        end\n    end\nend\n\n@Mountains\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nswitch costume to (costume1 v)\nshow\ngo to [back v] layer\ngo [forward v] (1) layers\ncreate clone of (_myself_ v)\nforever\n    go to x: (((Player x) / (10)) * (-1)) y: ((player y) / (10))\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nshow\ngo to [back v] layer\ngo [forward v] (1) layers\nforever\n    go to x: (((Player x) / (15)) * (-1)) y: ((player y) / (12))\nend\n\n@Arrows\n\nwhen I start as a clone\nif <(Level) = [13]> then\n    set [boss arrow chance v] to (pick random (1) to (3))\nelse\n    set [boss arrow chance v] to [2]\nend\nif <(Arrow Allow) = [1]> then\n    if <(Mute) = [-1]> then\n        start sound [Arrow Fly v]\n    end\n    set [arrow allow v] to [0]\n    show\n    repeat until <<touching (intro_blind v)?> or <<<(Level) = [25]> and <touching (boss v)?>> or <<<<(Level) = [13]> and <touching (boss v)?>> or <<(Level) = [19]> and <<(Boss Harm) = [1]> and <<touching (boss v)?> and <not <(Boss Arrow Chance) = [1]>>>>>> or <<<touching (enemy3 v)?> and <(Enemy 3; Harm) = [1]>> or <<touching (_edge_ v)?> or <<touching (ground v)?> or <<touching (enemy v)?> or <touching (enemy2 v)?>>>>>>>>\n        if <(Arrow Side) = [right]> then\n            move ((15) - (Angle)) steps\n            turn right (Angle) degrees\n            if <(direction) > [90]> then\n                change [angle v] by ((Angle) * ((-1) * (0.1)))\n            else\n                change [angle v] by ((Angle) * (0.1))\n            end\n        else\n            move ((15) - ((-1) * (Angle))) steps\n            turn left (Angle) degrees\n            if <(direction) > [90]> then\n                change [angle v] by ((Angle) * ((-1) * (0.1)))\n            else\n                change [angle v] by ((Angle) * (0.1))\n            end\n        end\n    end\n    if <<touching (_edge_ v)?> or <touching (ground v)?>> then\n        if <(Mute) = [-1]> then\n            start sound [Arrow Hit Ground v]\n        end\n        set [precise archer v] to [0]\n    end\n    if <<touching (intro_blind v)?> or <<<<(Boss Harm) = [1]> and <<touching (boss v)?> and <(Boss Arrow Chance) = [1]>>> and <(Level) = [13]>> or <<<touching (enemy3 v)?> and <(Enemy 3 Type) = [17]>> or <<<touching (enemy v)?> and <(Enemy 1; Type) = [17]>> or <<touching (enemy2 v)?> and <(Enemy 2; Type) = [17]>>>>>> then\n        set [arrow bounce y v] to [7]\n        if <(Mute) = [-1]> then\n            set [pitch v] effect to (10)\n            start sound [Arrow Deflected v]\n        end\n        repeat (10)\n            change y by (Arrow Bounce y)\n            change [ghost v] effect by (10)\n            change [arrow bounce y v] by (-1)\n            turn right (5) degrees\n        end\n    else\n        if <<touching (enemy v)?> or <<touching (enemy2 v)?> or <<touching (enemy3 v)?> or <<touching (boss v)?> and <not <(Boss Arrow Chance) = [1]>>>>>> then\n            if <(Mute) = [-1]> then\n                start sound [Hit Enemy v]\n            end\n            change [precise archer v] by (1)\n        end\n    end\n    set [arrow allow v] to [1]\n    delete this clone\nend\n\nwhen I receive [arrow v]\nif <(Arrow Allow) = [1]> then\n    set [angle v] to [0.5]\n    repeat until <not <key (space v) pressed?>>\n        point in direction (Arm Direction)\n    end\n    if <(direction) > [0]> then\n        set [arrow side v] to [right]\n    else\n        set [arrow side v] to [left]\n    end\n    create clone of (_myself_ v)\nend\n\nwhen I receive [begin v]\nset [arrow allow v] to [1]\nforever\n    go to (arm v)\n    if <<(Text) = [0]> and <<(Weapon) = [2]> and <key (space v) pressed?>>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nset [precise archer v] to [0]\nforever\n    if <(Mute) = [-1]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I start as a clone\nif <(Level) = [19]> then\n    repeat until <<touching (fireball v)?> or <<touching (boss v)?> or <<<touching (enemy3 v)?> and <(Enemy 3; Harm) = [1]>> or <<touching (_edge_ v)?> or <<touching (ground v)?> or <<touching (enemy v)?> or <touching (enemy2 v)?>>>>>>>\n        if <(distance to [boss v]) < [100]> then\n            broadcast (Boss Attack v)\n            stop [this script v]\n        end\n    end\nend\n\n@Projectile\n\nwhen flag clicked\nhide\n\nwhen I receive [ninja throw v]\nset [pitch v] effect to (30)\nset [ghost v] effect to (0)\nif <(Enemy 1 Harm) = [1]> then\n    go to (enemy v)\n    point towards (player v)\n    if <(Mute) = [-1]> then\n        start sound [Sword Swing v]\n    end\n    show\n    repeat until <<touching (key power v)?> or <<<touching (_edge_ v)?> or <touching (ground v)?>> or <<touching (arm v)?> and <(Sword Damage) = [1]>>>>\n        wait until <(Text) = [0]>\n        move (12) steps\n    end\n    hide\nend\n\nwhen I receive [ninja throw 2 v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [pitch v] effect to (30)\nset [ghost v] effect to (0)\nif <(Enemy 2 Harm) = [1]> then\n    go to (enemy2 v)\n    point towards (player v)\n    if <(Mute) = [-1]> then\n        start sound [Sword Swing v]\n    end\n    show\n    repeat until <<touching (key power v)?> or <<<touching (_edge_ v)?> or <touching (ground v)?>> or <<touching (arm v)?> and <(Sword Damage) = [1]>>>>\n        wait until <(Text) = [0]>\n        move (12) steps\n    end\n    hide\nend\n\nwhen I receive [next v]\nhide\ndelete this clone\n\n@Help\n\nwhen flag clicked\nhide\nset [help v] to [-1]\nswitch costume to (a. page 1 v)\n\nwhen I receive [begin v]\nset [pixelate v] effect to (100)\nset [help v] to [-1]\nforever\n    if <key (h v) pressed?> then\n        set [help v] to ((-1) * (Help))\n        broadcast (Help v)\n        wait (0.5) seconds\n    end\nend\n\nwhen I receive [help v]\nif <(Help) = [1]> then\n    go to [front v] layer\n    set [text v] to [1]\n    show\n    repeat (20)\n        change [pixelate v] effect by (-5)\n        change [ghost v] effect by (-5)\n    end\n    repeat until <(Help) = [-1]>\n        if <key (right arrow v) pressed?> then\n            repeat (20)\n                change [pixelate v] effect by (5)\n                change [ghost v] effect by (5)\n            end\n            next costume\n            repeat (20)\n                change [pixelate v] effect by (-5)\n                change [ghost v] effect by (-5)\n            end\n        else\n            if <key (left arrow v) pressed?> then\n                repeat (20)\n                    change [pixelate v] effect by (5)\n                    change [ghost v] effect by (5)\n                end\n                switch costume to ((costume [number v]) - (1))\n                repeat (20)\n                    change [pixelate v] effect by (-5)\n                    change [ghost v] effect by (-5)\n                end\n            end\n        end\n    end\nelse\n    set [text v] to [0]\n    repeat (20)\n        change [pixelate v] effect by (5)\n        change [ghost v] effect by (5)\n    end\n    hide\n    set [pixelate v] effect to (100)\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nwait (1) seconds\nhide\n\n@Enemy\n\nwhen flag clicked\nhide\n\nwhen I receive [next v]\nset [enemy 1 harm v] to [0]\nwait (0.01) seconds\nEnemy Code\n\ndefine Enemy Code\nstop [other scripts in sprite v]\nbroadcast (kill v)\nif <(Level) = [3]> then\n    Enemy [77] [-128] [5] [90] [1]\nelse\n    if <(Level) = [4]> then\n        Enemy [-40] [128] [70] [0] [2]\n    else\n        if <(Level) = [5]> then\n            Enemy [-80] [-16] [15] [90] [17]\n        else\n            if <(Level) = [6]> then\n                Enemy [62] [23] [2] [90] [17]\n            else\n                if <(Level) = [7]> then\n                    Enemy [100] [23] [40] [0] [2]\n                else\n                    if <(Level) = [8]> then\n                        Enemy [-100] [140] [40] [0] [2]\n                    else\n                        if <(Level) = [9]> then\n                            point in direction (90)\n                            Enemy [40] [-103] [3] [-90] [25]\n                        else\n                            if <(Level) = [10]> then\n                                Enemy [100] [-87] [5] [90] [25]\n                            else\n                                if <(Level) = [12]> then\n                                    Enemy [-200] [13] [5] [90] [25]\n                                else\n                                    if <(Level) = [14]> then\n                                        Enemy [150] [-17] [5] [-90] [25]\n                                    else\n                                        if <(Level) = [15]> then\n                                            Enemy [-179] [57] [2] [90] [25]\n                                        else\n                                            if <(Level) = [18]> then\n                                                Enemy [-2] [-12] [1] [90] [25]\n                                            else\n                                                if <(Level) = [21]> then\n                                                    Enemy [35] [-45] [1] [-90] [25]\n                                                else\n                                                    if <(Level) = [24]> then\n                                                        Enemy [217] [124] [3] [-90] [25]\n                                                    else\n                                                        if <(Level) = [22]> then\n                                                            Enemy [41] [24] [1] [90] [25]\n                                                        else\n                                                            hide\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Enemy (xpos) (ypos) (steps) ( direction) (w/g)\nshow\ngo to x: (xpos) y: (ypos)\nif <(Level) = [25]> then\n    if <(x position) < [-74]> then\n        set y to (-128)\n    else\n        if <<(x position) < [105]> and <[16] < (x position)>> then\n            set y to (-5)\n        else\n            hide\n            set [enemy 1 harm v] to [0]\n            stop [this script v]\n        end\n    end\nend\nset [enmy steps 1 v] to (steps)\nset [enemy 1 harm v] to [1]\npoint in direction ( direction)\nset [ghost v] effect to (0)\nset [enemy 1; type v] to (w/g)\nif <(w/g) = [2]> then\n    switch costume to (glider 1 v)\n    set size to (50) %\n    set rotation style [all around v]\n    broadcast (Enemy Fly v)\n    set [enemy; glide x 1 v] to [-2]\n    wait until <(Text) = [0]>\nelse\n    switch costume to (Enemy 1; Type)\n    set size to (100) %\n    wait until <(Text) = [0]>\n    broadcast (Enemy Walk v)\nend\nrepeat until <(Enemy 1 Harm) = [0]>\n    if <<(Enemy 1; Type) = [25]> and <(Enemy 1 Harm) = [1]>> then\n        wait (3) seconds\n        wait until <(Text) = [0]>\n        broadcast (Ninja Throw v)\n    end\nend\n\nwhen I receive [enemy walk v]\nset rotation style [left-right v]\nrepeat (Enmy Steps 1)\n    switch costume to (Enemy 1; Type)\n    move (10) steps\n    wait (0.05) seconds\n    repeat (7)\n        next costume\n        wait until <(Text) = [0]>\n        wait (0.05) seconds\n    end\nend\nturn right (180) degrees\nbroadcast (Enemy Walk v)\n\nwhen I receive [enemy fly v]\nrepeat (Enmy Steps 1)\n    change x by (Enemy; Glide x 1)\n    if <(costume [number v]) = [16]> then\n        switch costume to (glider 1 v)\n    else\n        next costume\n    end\n    wait (0.05) seconds\n    wait until <(Text) = [0]>\nend\nset [enemy; glide x 1 v] to ((Enemy; Glide x 1) * (-1))\nbroadcast (Enemy Fly v)\n\nwhen I receive [enemy fly v]\nwait until <(distance to [player v]) < [170]>\nstop [other scripts in sprite v]\nbroadcast (kill v)\ncreate clone of (_myself_ v)\nrepeat (10)\n    turn right (Enemy; Glider clone Direction) degrees\n    wait until <(Text) = [0]>\nend\nrepeat until <touching (_edge_ v)?>\n    move (15) steps\n    wait until <(Text) = [0]>\nend\nhide\n\nwhen I start as a clone\nhide\npoint towards (player v)\nset [enemy; glider clone direction v] to ((direction) / (10))\ndelete this clone\n\nwhen I receive [kill v]\nforever\n    if <(End) = [1]> then\n        stop [this script v]\n    end\n    if <<<(Level) = [25]> and <[2] > (Life)>> or <<<touching (key power v)?> and <(Key 1) = [1]>> or <<<touching (arm v)?> and <(Sword Damage) = [1]>> or <<touching (arrows v)?> and <not <(Enemy 1; Type) = [17]>>>>>> then\n        set [enemy 1 harm v] to [0]\n        change [exterminator a v] by (-1)\n        change [exterminator b v] by (1)\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        hide\n        delete this clone\n    end\n    if <<(Die Again) = [1]> and <<touching (player v)?> and <(Enemy 1 Harm) = [1]>>> then\n        broadcast (Pre-Death v)\n        change [death v] by (1)\n    end\nend\n\nwhen I receive [summon en1 v]\nif <(Level) = [25]> then\n    Enemy (Laser x) [200] [3] [-90] [1]\nelse\n    hide\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nwait (1) seconds\nhide\n\nwhen I receive [death v]\nif <(Level) = [25]> then\n    broadcast (kill v)\nelse\n    wait (0.2) seconds\n    Enemy Code\nend\n\n@Enemy2\n\nwhen flag clicked\nhide\n\ndefine Enemy Code\nstop [other scripts in sprite v]\nbroadcast (kill v)\nif <(Level) = [6]> then\n    Enemy [-20] [-128] [15] [-90] [1]\nelse\n    if <(Level) = [7]> then\n        Enemy [-50] [140] [30] [0] [2]\n    else\n        if <(Level) = [8]> then\n            Enemy [180] [68] [11] [-90] [17]\n        else\n            if <(Level) = [10]> then\n                Enemy [-160] [68] [5] [90] [17]\n            else\n                if <(Level) = [11]> then\n                    Enemy [-18] [-128] [15] [-90] [17]\n                else\n                    if <(Level) = [12]> then\n                        Enemy [90] [-128] [7] [-90] [17]\n                    else\n                        if <(Level) = [15]> then\n                            Enemy [100] [-40] [4] [-90] [25]\n                        else\n                            if <(Level) = [17]> then\n                                Enemy [30] [100] [70] [0] [2]\n                            else\n                                if <(Level) = [18]> then\n                                    Enemy [160] [-128] [4] [90] [25]\n                                else\n                                    if <(Level) = [20]> then\n                                        Enemy [15] [104] [1] [90] [25]\n                                    else\n                                        if <(Level) = [21]> then\n                                            Enemy [123] [92] [1] [90] [17]\n                                        else\n                                            if <(Level) = [23]> then\n                                                Enemy [5] [-128] [1] [90] [17]\n                                            else\n                                                if <(Level) = [24]> then\n                                                    Enemy [-70] [-26] [6] [90] [1]\n                                                else\n                                                    hide\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Enemy (xpos) (ypos) (steps) ( direction) (w/g)\nshow\ngo to x: (xpos) y: (ypos)\nif <(Level) = [25]> then\n    if <(x position) < [-74]> then\n        set y to (-128)\n    else\n        if <<(x position) < [105]> and <[16] < (x position)>> then\n            set y to (-5)\n        else\n            hide\n            set [enemy 1 harm v] to [0]\n            stop [this script v]\n        end\n    end\nend\nset [enmy steps 2 v] to (steps)\nset [enemy 2 harm v] to [1]\npoint in direction ( direction)\nclear graphic effects\nset [enemy 2; type v] to (w/g)\nif <(w/g) = [2]> then\n    switch costume to (glider 1 v)\n    set size to (50) %\n    set rotation style [all around v]\n    broadcast (Enemy Fly 2 v)\n    set [enemy glide x 2 v] to [-2]\n    wait until <(Text) = [0]>\nelse\n    switch costume to (Enemy 2; Type)\n    set size to (100) %\n    wait until <(Text) = [0]>\n    broadcast (Enemy Walk 2 v)\nend\nrepeat until <(Enemy 2 Harm) = [0]>\n    if <<(Enemy 2; Type) = [25]> and <(Enemy 2 Harm) = [1]>> then\n        wait (3) seconds\n        wait until <(Text) = [0]>\n        broadcast (Ninja Throw 2 v)\n    end\nend\n\nwhen I receive [enemy walk 2 v]\nset rotation style [left-right v]\nrepeat (Enmy Steps 2)\n    switch costume to (Enemy 2; Type)\n    move (10) steps\n    wait (0.05) seconds\n    repeat (7)\n        next costume\n        wait until <(Text) = [0]>\n        wait (0.05) seconds\n    end\nend\nturn right (180) degrees\nbroadcast (Enemy Walk 2 v)\n\nwhen I receive [enemy fly 2 v]\nrepeat (Enmy Steps 2)\n    change x by (Enemy Glide x 2)\n    if <(costume [number v]) = [16]> then\n        switch costume to (glider 1 v)\n    else\n        next costume\n    end\n    wait (0.05) seconds\n    wait until <(Text) = [0]>\nend\nset [enemy glide x 2 v] to ((Enemy Glide x 2) * (-1))\nbroadcast (Enemy Fly 2 v)\n\nwhen I receive [enemy fly 2 v]\nwait until <(distance to [player v]) < [170]>\nstop [other scripts in sprite v]\nbroadcast (kill v)\ncreate clone of (_myself_ v)\nrepeat (10)\n    turn right (Enemy Glider Clone Direction 2) degrees\n    wait until <(Text) = [0]>\nend\nrepeat until <touching (_edge_ v)?>\n    move (15) steps\n    wait until <(Text) = [0]>\nend\nhide\n\nwhen I start as a clone\nhide\npoint towards (player v)\nset [enemy glider clone direction 2 v] to ((direction) / (10))\ndelete this clone\n\nwhen I receive [kill v]\nforever\n    if <(End) = [1]> then\n        stop [this script v]\n    end\n    if <<<(Life) < [2]> and <(Level) = [25]>> or <<<touching (key power v)?> and <(Key 1) = [1]>> or <<<touching (arm v)?> and <(Sword Damage) = [1]>> or <<touching (arrows v)?> and <not <(Enemy 2; Type) = [17]>>>>>> then\n        set [enemy 2 harm v] to [0]\n        change [exterminator a v] by (-1)\n        change [exterminator b v] by (1)\n        if <(Level) = [10]> then\n            broadcast (Loot v)\n        end\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        hide\n        delete this clone\n    end\n    if <<(Die Again) = [1]> and <<touching (player v)?> and <(Enemy 2 Harm) = [1]>>> then\n        broadcast (Pre-Death v)\n        change [death v] by (1)\n    end\nend\n\nwhen I receive [death v]\nif <(Level) = [25]> then\n    broadcast (kill v)\nelse\n    wait (0.2) seconds\n    Enemy Code\nend\n\nwhen I receive [next v]\nset [enemy 2 harm v] to [0]\nwait (0.01) seconds\nEnemy Code\n\nwhen I receive [summon en2 v]\nif <(Level) = [25]> then\n    Enemy (Laser x) [200] [3] [-90] [1]\nelse\n    hide\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nwait (1) seconds\nhide\n\n@Enemy3\n\nwhen flag clicked\nhide\nset [death v] to [0]\n\ndefine Enemy Code\nstop [other scripts in sprite v]\nif <(Level) = [10]> then\n    Enemy [-20] [-128] [15] [-90] [1]\nelse\n    if <(Level) = [11]> then\n        Enemy [100] [-128] [20] [-90] [1]\n    else\n        if <(Level) = [12]> then\n            Enemy [-17] [13] [5] [-90] [1]\n        else\n            if <(Level) = [16]> then\n                Enemy [150] [7] [7] [-90] [25]\n            else\n                if <(Level) = [17]> then\n                    Enemy [80] [-128] [20] [-90] [25]\n                else\n                    if <(Level) = [18]> then\n                        Enemy [-60] [-128] [15] [-90] [25]\n                    else\n                        if <(Level) = [20]> then\n                            Enemy [-40] [128] [30] [0] [2]\n                        else\n                            if <(Level) = [23]> then\n                                Enemy [100] [128] [50] [0] [2]\n                            else\n                                if <(Level) = [24]> then\n                                    Enemy [200] [-128] [10] [-90] [25]\n                                else\n                                    if <(Level) = [22]> then\n                                        Enemy [40] [154] [10] [-90] [25]\n                                    else\n                                        hide\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Enemy (xpos) (ypos) (steps) ( direction) (w/g)\nshow\ngo to x: (xpos) y: (ypos)\nif <(Level) = [25]> then\n    if <(x position) < [-74]> then\n        set y to (-128)\n    else\n        if <<(x position) < [105]> and <[16] < (x position)>> then\n            set y to (-5)\n        else\n            hide\n            set [enemy 1 harm v] to [0]\n            stop [this script v]\n        end\n    end\nend\nset [enemy 3; harm v] to [1]\nset [enemy steps 3 v] to (steps)\npoint in direction ( direction)\nclear graphic effects\nset [enemy 3 type v] to (w/g)\nif <(w/g) = [2]> then\n    switch costume to (glider 1 v)\n    set size to (50) %\n    set rotation style [all around v]\n    broadcast (Enemy Fly 3 v)\n    set [enemy glide x 3 v] to [-2]\n    wait until <(Text) = [0]>\nelse\n    switch costume to (Enemy 3 Type)\n    set size to (100) %\n    wait until <(Text) = [0]>\n    broadcast (Enemy Walk 3 v)\nend\n\nwhen I receive [enemy walk 3 v]\nset rotation style [left-right v]\nrepeat (Enemy Steps 3)\n    if <(Enemy 3; Harm) = [1]> then\n        switch costume to (Enemy 3 Type)\n        move (10) steps\n        wait (0.05) seconds\n        repeat (7)\n            next costume\n            wait until <(Text) = [0]>\n            wait (0.05) seconds\n        end\n    end\nend\nturn right (180) degrees\nbroadcast (Enemy Walk 3 v)\n\nwhen I receive [enemy fly 3 v]\nrepeat (Enemy Steps 3)\n    change x by (Enemy glide x 3)\n    if <(costume [number v]) = [16]> then\n        switch costume to (glider 1 v)\n    else\n        next costume\n    end\n    wait (0.05) seconds\n    wait until <(Text) = [0]>\nend\nset [enemy glide x 3 v] to ((Enemy glide x 3) * (-1))\nbroadcast (Enemy Fly 3 v)\n\nwhen I receive [enemy fly 3 v]\nwait until <(distance to [player v]) < [170]>\nstop [other scripts in sprite v]\nbroadcast (kill v)\ncreate clone of (_myself_ v)\nrepeat (10)\n    turn right (Enemy Glider Clone Direction 3) degrees\n    wait until <(Text) = [0]>\nend\nrepeat until <touching (_edge_ v)?>\n    move (15) steps\n    wait until <(Text) = [0]>\nend\nhide\n\nwhen I start as a clone\nhide\npoint towards (player v)\nset [enemy glider clone direction 3 v] to ((direction) / (10))\ndelete this clone\n\nwhen I receive [kill v]\nforever\n    if <(End) = [1]> then\n        stop [this script v]\n    end\n    if <<<(Life) < [2]> and <(Level) = [25]>> or <<<touching (key power v)?> and <(Key 1) = [1]>> or <<<touching (arm v)?> and <(Sword Damage) = [1]>> or <<touching (arrows v)?> and <not <(Enemy 3; Harm) = [17]>>>>>> then\n        wait (0.01) seconds\n        set [enemy 3; harm v] to [0]\n        change [exterminator a v] by (-1)\n        change [exterminator b v] by (1)\n        if <(Enemy 3 Type) = [25]> then\n            repeat (5)\n                change [ghost v] effect by (-20)\n            end\n            repeat (5)\n                change [ghost v] effect by (10)\n                change [brightness v] effect by (-20)\n            end\n            switch costume to (fadedie v)\n            stop [other scripts in sprite v]\n            stop [this script v]\n        else\n            repeat (5)\n                change [ghost v] effect by (20)\n            end\n            hide\n        end\n    end\n    if <<(Die Again) = [1]> and <<touching (player v)?> and <(Enemy 3; Harm) = [1]>>> then\n        broadcast (Pre-Death v)\n        set [death v] to [1]\n    end\nend\n\nwhen I receive [enemy walk 3 v]\nif <(Enemy 3 Type) = [25]> then\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    wait until <(distance to [player v]) < [50]>\n    repeat (25)\n        change [ghost v] effect by (-4)\n    end\nend\n\nwhen I receive [pre-death v]\nif <(Enemy 3 Type) = [25]> then\n    repeat (25)\n        change [ghost v] effect by (-4)\n    end\nend\n\nwhen I receive [next v]\nset [enemy 3; harm v] to [0]\nwait (0.01) seconds\nEnemy Code\n\nwhen I receive [summon en3 v]\nif <(Level) = [25]> then\n    Enemy (Laser x) [200] [3] [-90] [1]\nelse\n    hide\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nwait (1) seconds\nhide\n\nwhen I receive [death v]\nif <(Level) = [25]> then\n    broadcast (kill v)\nelse\n    wait (0.2) seconds\n    Enemy Code\nend\n\n@Loot\n\nwhen flag clicked\nset [end v] to [0]\nhide\n\nwhen I receive [loot v]\npoint in direction (90)\nif <(Level) = [10]> then\n    switch costume to (costume1 v)\n    go to (enemy2 v)\nend\nif <(Level) = [13]> then\n    switch costume to (costume2 v)\n    go to (boss v)\n    set y to (-120)\nend\nif <(Level) = [19]> then\n    switch costume to (costume3 v)\n    go to (boss v)\nend\nshow\nset [brightness v] effect to (100)\nset [loot y v] to [10]\nrepeat (20)\n    change y by (Loot y)\n    change [brightness v] effect by (-5)\n    change [loot y v] by (-1)\nend\nwait until <touching (player v)?>\nhide\nif <(Level) = [10]> then\n    set [key 1 v] to [0]\n    set [allow weapon v] to [3]\n    set [allow portal v] to [1]\n    set [weapon v] to [3]\nend\nif <(Level) = [13]> then\n    set [key 2 v] to [0]\n    set [allow weapon v] to [4]\n    set [weapon v] to [4]\nend\nif <(Level) = [19]> then\n    set [key 3 v] to [0]\n    set [allow weapon v] to [5]\n    set [weapon v] to [5]\nend\n\nwhen I receive [death v]\nif <(Level) = [10]> then\n    hide\n    set [allow weapon v] to [2]\n    set [allow portal v] to [0]\n    set [weapon v] to [1]\nend\n\nwhen I receive [begin v]\nwait until <(Allow Weapon) = [2]>\nset [player x v] to [0]\nset [player y v] to [0]\nbroadcast (Loot Text v)\nset [arrow allow v] to [1]\n\nwhen I start as a clone\nif <(End) = [0]> then\n    clear graphic effects\n    show\n    switch costume to (laser v)\n    go to (player v)\n    set size to (0) %\n    repeat (10)\n        turn right (pick random (1) to (10)) degrees\n        change size by (10)\n        if <not <key (space v) pressed?>> then\n            repeat (5)\n                turn left (pick random (1) to (10)) degrees\n            end\n            delete this clone\n        end\n    end\n    repeat (12)\n        turn right (pick random (1) to (10)) degrees\n    end\n    repeat (5)\n        turn left (pick random (1) to (10)) degrees\n        change size by (-20)\n    end\n    delete this clone\nelse\n    show\n    glide (3) secs to (boss v)\n    repeat (10)\n        change [brightness v] effect by (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen I receive [keyready v]\nrepeat until <not <key (space v) pressed?>>\n    create clone of (_myself_ v)\nend\n\nwhen I receive [loot v]\nrepeat until <touching (player v)?>\n    repeat (40)\n        change y by (0.1)\n    end\n    repeat (40)\n        change y by (-0.1)\n    end\nend\n\nwhen I receive [un-loot v]\nhide\ngo to (player v)\nclear graphic effects\nswitch costume to (laser v)\npoint in direction (90)\nset [weapon v] to [5]\nwait (4) seconds\nrepeat (3)\n    switch costume to ((costume [number v]) - (1))\n    turn right (-50) degrees\n    create clone of (_myself_ v)\n    change [weapon v] by (-1)\n    change [allow weapon v] by (-1)\n    wait (1) seconds\nend\n\n@Key Power\n\nwhen flag clicked\nhide\n\nwhen I receive [use key v]\nset size to (100) %\nif <(Weapon) = [3]> then\n    start sound [Green screen laser eyes effect v]\n    stop [other scripts in sprite v]\n    set [ghost v] effect to (0)\n    switch costume to (laser v)\n    set size to (0) %\n    show\n    go to x: ((Player x) - ((Arm Side) * (4))) y: ((player y) - (6.5))\n    if <(Arm Side) = [5]> then\n        point in direction (-90)\n    else\n        point in direction (90)\n    end\n    repeat (10)\n        change size by (10)\n    end\n    wait (1) seconds\n    repeat (10)\n        change size by (-10)\n    end\n    hide\nend\n\nwhen I receive [use key 2 v]\nshow\nset size to (100) %\nset [ghost v] effect to (100)\nswitch costume to (shield v)\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (-10)\n    turn right (5) degrees\n    go to (player v)\nend\nreset timer\nrepeat until <(timer) > [5]>\n    turn right (5) degrees\n    go to (player v)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\n    turn right (5) degrees\n    go to (player v)\nend\nhide\n\n@Boss\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [boss v]\nset size to (100) %\nset [attack type v] to [1]\nset [boss harm v] to [1]\nset [life v] to [11]\nset [ghost v] effect to (0)\nif <(Level) = [13]> then\n    point in direction (-90)\n    switch costume to (jump down v)\n    hide\n    wait (1) seconds\n    go to x: (111) y: (190)\n    show\n    glide (0.18) secs to x: (111) y: (-124)\n    broadcast (Crash v)\n    if <(Mute) = [-1]> then\n        start sound [Boom v]\n    end\n    wait (1) seconds\n    wait until <(Text) = [0]>\n    repeat until <(Life) < [2]>\n        repeat (5)\n            move (10) steps\n            switch costume to (costume1 v)\n            repeat (7)\n                next costume\n                wait (0.01) seconds\n            end\n            if <(Player x) > (x position)> then\n                point in direction (90)\n            else\n                point in direction (-90)\n            end\n        end\n        if <(Attack type) = [1]> then\n            switch costume to (jump up v)\n            set [boss y v] to [20]\n            repeat (20)\n                change y by (Boss y)\n                change [boss y v] by (-1)\n            end\n            set [boss y v] to [0]\n            switch costume to (jump down v)\n            repeat (21)\n                change y by (Boss y)\n                change [boss y v] by (-1)\n            end\n            if <<(Mute) = [-1]> and <(Life) > [1]>> then\n                start sound [Boom2 v]\n            end\n            broadcast (Boss Attack v)\n            set y to (-124)\n            wait (1) seconds\n        else\n            create clone of (_myself_ v)\n            hide\n            go to x: (Player x) y: (190)\n            wait (2) seconds\n            if <(Life) > [1]> then\n                show\n            end\n            switch costume to (jump down v)\n            repeat (10)\n                change y by (-31.4)\n            end\n            if <[1] < (Life)> then\n                if <(Mute) = [-1]> then\n                    start sound [Boom v]\n                end\n                broadcast (Crash v)\n            end\n        end\n        set [attack type v] to (pick random (1) to (2))\n    end\nend\nif <<(Level) = [18]> or <(Level) = [19]>> then\n    go to x: (40) y: (-128)\n    point in direction (90)\n    show\n    set [ghost v] effect to (30)\n    set [brightness v] effect to (5)\n    switch costume to (ghost v)\n    wait until <(Text) = [0]>\n    repeat until <(Life) < [2]>\n        if <(y position) = [108]> then\n            repeat until <<[-210] > (x position)> or <(x position) > [-100]>>\n                move (10) steps\n                switch costume to (ghost v)\n                repeat (7)\n                    next costume\n                    wait (0.05) seconds\n                end\n                set [ghost attack v] to (pick random (1) to (3))\n                if <(Ghost Attack) = [1]> then\n                    broadcast (Ghost Attack v)\n                    wait (2) seconds\n                end\n            end\n        end\n        if <(y position) = [-128]> then\n            repeat until <<[-190] > (x position)> or <(x position) > [50]>>\n                move (10) steps\n                switch costume to (ghost v)\n                repeat (7)\n                    next costume\n                    wait (0.05) seconds\n                end\n                set [ghost attack v] to (pick random (1) to (3))\n                if <(Ghost Attack) = [1]> then\n                    broadcast (Ghost Attack v)\n                    wait (2) seconds\n                end\n            end\n        end\n        if <(y position) = [6]> then\n            repeat until <<[100] > (x position)> or <(x position) > [200]>>\n                move (10) steps\n                switch costume to (ghost v)\n                repeat (7)\n                    next costume\n                    wait (0.05) seconds\n                end\n                set [ghost attack v] to (pick random (1) to (3))\n                if <(Ghost Attack) = [1]> then\n                    broadcast (Ghost Attack v)\n                    wait (2) seconds\n                end\n            end\n        end\n        turn right (180) degrees\n        move (10) steps\n        switch costume to (ghost v)\n        repeat (7)\n            next costume\n            wait (0.05) seconds\n        end\n    end\n    hide\nend\nif <<(Level) = [25]> or <(Level) = [24]>> then\n    point in direction (90)\n    if <<(Toggle Text) = [-1]> or <(Mute) = [-1]>> then\n        wait (3) seconds\n    else\n        wait until <(Text) = [0]>\n    end\n    glide (3) secs to x: (203) y: (110)\n    create clone of (intro_blind v)\n    repeat until <(Life) < [2]>\n        wait (pick random (5) to (7)) seconds\n        if <[1] < (Life)> then\n            set [attack type v] to (pick random (1) to (4))\n            if <[3] > (Attack type)> then\n                broadcast (Boss Attack v)\n            else\n                if <(Attack type) > [2]> then\n                    broadcast (Ghost Attack v)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [boss v]\nrepeat until <(Life) < [2]>\n    if <<(Boss Harm) = [1]> and <<<touching (arm v)?> and <(Sword Damage) = [1]>> or <<<touching (arrows v)?> and <not <(Boss Arrow Chance) = [1]>>> or <<touching (key power v)?> and <(Key 1) = [1]>>>>> then\n        change [life v] by (-1)\n        wait (0.5) seconds\n    end\nend\nif <not <(Level) = [25]>> then\n    broadcast (Loot v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nelse\n    wait (1) seconds\n    set [end v] to [1]\n    set [toggle text v] to [-1]\n    set [text v] to [1]\n    wait (1) seconds\n    broadcast (Un-Loot v)\n    wait until <(Intro y) = [1.5]>\n    wait (1.2) seconds\n    repeat (10)\n        change size by (-10)\n    end\n    hide\n    broadcast (Almost end v)\n    wait (7) seconds\n    set voice to (tenor v)::tts\n    speak [I can't believe we've done it, it's gone. After all these times, the portal is finally closed]::tts\n    speak [The damage is already done, but the world now has a chance of recovering]::tts\n    speak [Maybe one day we'll be telling our children how terrible it all was and how we coped with it, ]::tts\n    speak [Hopefully this is our happily ever after]::tts\n    broadcast (End v)\nend\n\nwhen I start as a clone\nif <(Level) = [13]> then\n    switch costume to (jump up v)\n    repeat until <touching (_edge_ v)?>\n        change y by (20)\n    end\n    delete this clone\nend\n\nwhen I receive [crash v]\nrepeat (5)\n    change x by (1)\nend\nrepeat (5)\n    change x by (-2)\n    change y by (-2)\nend\nrepeat (5)\n    change x by (1)\n    change y by (4)\nend\nrepeat (5)\n    change y by (-2)\nend\n\nwhen I receive [boss attack v]\nif <(Level) = [19]> then\n    wait (pick random (0) to (1)) seconds\n    set [attack type v] to (pick random (1) to (3))\n    set [boss harm v] to [0]\n    repeat (10)\n        change [ghost v] effect by (7)\n    end\n    hide\n    if <(Attack type) = [1]> then\n        go to x: (40) y: (-128)\n        if <[100] > (distance to [player v])> then\n            set [attack type v] to (pick random (2) to (3))\n            broadcast (Boss Attack v)\n            stop [this script v]\n        end\n    else\n        if <(Attack type) = [2]> then\n            go to x: (200) y: (6)\n            if <[100] > (distance to [player v])> then\n                broadcast (Boss Attack v)\n                stop [this script v]\n            end\n        else\n            if <(Attack type) = [3]> then\n                go to x: (-150) y: (108)\n                if <[100] > (distance to [player v])> then\n                    set [attack type v] to (pick random (1) to (2))\n                    broadcast (Boss Attack v)\n                    stop [this script v]\n                end\n            end\n        end\n    end\n    if <(Life) > [1]> then\n        show\n        repeat (10)\n            change [ghost v] effect by (-7)\n        end\n    end\n    set [boss harm v] to [1]\nend\n\nwhen I receive [boss v]\nif <<(Level) = [18]> or <(Level) = [19]>> then\n    repeat until <(Life) < [2]>\n        if <<(distance to [player v]) < [100]> and <not <(Ghost Attack) = [1]>>> then\n            set [attack type v] to (pick random (1) to (3))\n            broadcast (Boss Attack v)\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I receive [ghost attack v]\nrepeat (20)\n    change [brightness v] effect by (4.75)\nend\nwait (1) seconds\nrepeat (20)\n    change [brightness v] effect by (-4.75)\nend\n\nwhen I receive [next v]\nif <(Level) = [24]> then\n    set [life v] to [11]\n    show\n    go to x: (203) y: (-110)\n    clear graphic effects\n    switch costume to (void v)\n    point in direction (90)\n    repeat until <(Life) < [2]>\n        repeat (40)\n            change y by (0.1)\n        end\n        repeat (40)\n            change y by (-0.1)\n        end\n    end\nend\n\nwhen I receive [un-loot v]\nset [end v] to [3]\nrepeat until <(End) = [0]>\n    if <touching (loot v)?> then\n        change [end v] by (-1)\n    end\nend\nwait (1) seconds\nset [intro y v] to [1.5]\n\nwhen I receive [end v]\nwait (8) seconds\nset size to (50) %\nshow\nwait (0.01) seconds\nhide\nset size to (0) %\nwait (1) seconds\nset size to (80) %\nshow\nwait (0.05) seconds\nhide\nset size to (0) %\nwait (2) seconds\nshow\nrepeat (5)\n    change size by (20)\nend\n\n@Health Bar\n\nwhen I receive [boss v]\nwait (1) seconds\nshow\nif <(Level) = [13]> then\n    set [color v] effect to (0)\nelse\n    if <(Level) = [19]> then\n        set [color v] effect to (130)\n    else\n        set [color v] effect to (150)\n    end\nend\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [boss v]\nwait (1) seconds\nwait until <[2] > (Life)>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nset [ghost v] effect to (1)\nhide\npoint in direction (90)\ngo to x: (195) y: (100)\n\nwhen I receive [boss v]\nwait (1) seconds\nrepeat until <[2] > (Life)>\n    switch costume to (Life)\nend\n\n@Fireball\n\nwhen flag clicked\nhide\n\nwhen I receive [ghost attack v]\nif <(Level) = [19]> then\n    set [color v] effect to (100)\nelse\n    if <(Level) = [25]> then\n        set [color v] effect to (120)\n    end\nend\nhide\nwait (1) seconds\ngo to (boss v)\npoint towards (player v)\nturn right (8) degrees\nset [fireball damage v] to [0]\nrepeat (5)\n    wait until <(Text) = [0]>\n    if <[1] < (Life)> then\n        create clone of (_myself_ v)\n    end\n    turn left (4) degrees\nend\n\nwhen I start as a clone\ngo to [front v] layer\nset size to (100) %\nswitch costume to (costume1 v)\nshow\nrepeat until <<<not <(Attack type) = [1]>> and <<touching (arm v)?> and <(Sword Damage) = [1]>>> or <<<touching (intro_blind v)?> and <(Fireball Damage) = [1]>> or <<<(Boss Harm) = [1]> and <<touching (boss v)?> and <(Fireball Damage) = [1]>>> or <<touching (player v)?> or <<touching (_edge_ v)?> or <<not <(Key 1) = [1]>> and <touching (key power v)?>>>>>>>\n    move (15) steps\n    wait until <(Text) = [0]>\n    if <<not <(Attack type) = [1]>> and <<touching (arm v)?> and <(Sword Damage) = [1]>>> then\n        turn right (180) degrees\n        change [deflected v] by (1)\n        set [fireball damage v] to [1]\n        if <(Level) = [19]> then\n            broadcast (Boss Attack v)\n        end\n    end\nend\nrepeat until <<<touching (intro_blind v)?> and <(Fireball Damage) = [1]>> or <<<(Boss Harm) = [1]> and <<touching (boss v)?> and <(Fireball Damage) = [1]>>> or <<touching (player v)?> or <<touching (_edge_ v)?> or <<not <(Key 1) = [1]>> and <touching (key power v)?>>>>>>\n    move (15) steps\n    wait until <(Text) = [0]>\n    if <<<(Boss Harm) = [1]> and <touching (boss v)?>> and <(Fireball Damage) = [1]>> then\n        change [life v] by (-1)\n    end\nend\ndelete this clone\n\ndelete this clone\n\nwhen I receive [boss attack v]\nif <(Level) = [25]> then\n    point in direction (90)\n    set size to (0) %\n    switch costume to (costume2 v)\n    go to (player v)\n    set [laser x v] to (x position)\n    set y to (200)\n    if <(Mute) = [-1]> then\n        start sound [Laser beam charge sound effect v]\n    end\n    wait (1.5) seconds\n    show\n    if <(Mute) = [-1]> then\n        start sound [Green screen laser eyes effect v]\n    end\n    repeat (10)\n        change size by (10)\n    end\n    if <(Attack type) = [1]> then\n        if <(Enemy 1 Harm) = [0]> then\n            broadcast (Summon En1 v)\n        else\n            if <(Enemy 2 Harm) = [0]> then\n                broadcast (Summon En2 v)\n            else\n                if <(Enemy 3; Harm) = [0]> then\n                    broadcast (Summon En3 v)\n                end\n            end\n        end\n    end\n    wait (1) seconds\n    repeat (10)\n        change size by (-10)\n    end\n    hide\nend\n\n@Intro_INFNTY_logo\n\nwhen I receive [message1 v]\nwait (1) seconds\nshow\nglide (0.2) secs to x: (4) y: (-10)\nstart sound [Boom v]\n\nwhen flag clicked\nswitch costume to (infntyframed v)\nset [ghost v] effect to (0)\nhide\ngo to x: (-4) y: (253)\nwait (0.5) seconds\ngo to [front v] layer\n\nwhen I receive [intro end v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\n@Intro_INFNTY\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (0)\ngo to x: (-7) y: (-17)\nswitch costume to (costume1 v)\nhide\nwait (1) seconds\nstart sound [Breaker Light v]\nstart sound [Light-Electric-Buzzing-www v]\nshow\nwait (1) seconds\nrepeat (22)\n    next costume\nend\nbroadcast (message1 v)\n\nwhen flag clicked\nwait (7.25) seconds\nstart sound [Fade v]\n\nwhen I receive [intro end v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nwhen I receive [endend v]\nswitch costume to (costume2 v)\ngo to [front v] layer\ngo [backward v] (2) layers\nshow\n\n@Intro_Blind\n\nwhen flag clicked\nset size to (100) %\npoint in direction (90)\nswitch costume to (costume1 v)\nset [ghost v] effect to (0)\nshow\ngo to x: (-80) y: (-146)\nwait (3) seconds\ngo to [front v] layer\nwait until <touching (intro_arm v)?>\nif <touching (intro_arm v)?> then\n    repeat (20)\n        change x by (10)\n    end\nend\nhide\nwait (1) seconds\nbroadcast (Intro End v)\n\nwhen I start as a clone\nif <(Level) = [25]> then\n    go to (boss v)\n    hide\n    switch costume to (costume2 v)\n    set [brightness v] effect to (100)\n    set [ghost v] effect to (100)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n        change [brightness v] effect by (-10)\n    end\n    forever\n        set [intro y v] to [1]\n        set [boss y v] to [0]\n        repeat (20)\n            change [boss y v] by (Intro y)\n            turn right (Boss y) degrees\n        end\n        repeat (40)\n            change [boss y v] by ((Intro y) * (-1))\n            turn right (Boss y) degrees\n        end\n        repeat (40)\n            change [boss y v] by (Intro y)\n            turn right (Boss y) degrees\n        end\n        repeat (20)\n            change [boss y v] by ((Intro y) * (-1))\n            turn right (Boss y) degrees\n        end\n    end\nend\n\nwhen I start as a clone\nif <(Level) = [25]> then\n    repeat until <(Life) < [2]>\n        if <(distance to [player v]) < [150]> then\n            wait (pick random (0) to (1)) seconds\n            repeat (20)\n                change [intro y v] by (0.05)\n                change [brightness v] effect by (5)\n            end\n            repeat (20)\n                change [ghost v] effect by (5)\n                change size by (10)\n            end\n            set [intro y v] to [1]\n            clear graphic effects\n            set size to (0) %\n            repeat (10)\n                change size by (10)\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nwait until <(Intro y) = [1.5]>\nwait (1) seconds\nrepeat (10)\n    change size by (-10)\nend\nset [end v] to [-1]\ndelete this clone\n\nwhen I receive [end v]\nwait (8) seconds\ncreate clone of (_myself_ v)\nwait (3) seconds\ncreate clone of (_myself_ v)\n\n@Intro_Arm\n\nwhen flag clicked\nset [ghost v] effect to (0)\nswitch costume to (costume1 v)\nset [intro y v] to [15]\nhide\nwait (1) seconds\ngo to [front v] layer\nshow\ngo to (intro_infnty v)\npoint in direction (90)\nwait (1) seconds\nrepeat (15)\n    turn right (11) degrees\nend\nrepeat (4)\n    repeat (5)\n        turn left (10) degrees\n    end\n    repeat (5)\n        turn left (-10) degrees\n    end\nend\n\nwhen I receive [message1 v]\nwait until <touching (intro_infnty_logo v)?>\nif <touching (intro_infnty_logo v)?> then\n    switch costume to (costume2 v)\n    repeat (33)\n        turn left (15.9) degrees\n        change x by (-5)\n        change y by (Intro y)\n        change [intro y v] by (-1.15)\n    end\n    wait (0.5) seconds\n    next costume\nend\n\nwhen I receive [intro end v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\n@achievementboard\n\nwhen flag clicked\nset [achievements v] to [-1]\nhide\ngo to x: (-139) y: (120)\nswitch costume to (completion2 v)\nrepeat (3)\n    create clone of (_myself_ v)\n    next costume\n    change y by (-110)\nend\ngo to x: (90) y: (120)\nrepeat (3)\n    create clone of (_myself_ v)\n    next costume\n    change y by (-110)\nend\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [1]> then\n        if <(Completion Badge) = [1]> then\n            set [brightness v] effect to (0)\n        else\n            set [brightness v] effect to (-50)\n        end\n    else\n        if <(costume [number v]) = [2]> then\n            if <(Eliminator Badge) = [1]> then\n                set [brightness v] effect to (0)\n            else\n                set [brightness v] effect to (-50)\n            end\n        else\n            if <(costume [number v]) = [3]> then\n                if <(Archer Badge) = [1]> then\n                    set [brightness v] effect to (0)\n                else\n                    set [brightness v] effect to (-50)\n                end\n            else\n                if <(costume [number v]) = [4]> then\n                    if <(Presist Badge) = [1]> then\n                        set [brightness v] effect to (0)\n                    else\n                        set [brightness v] effect to (-50)\n                    end\n                else\n                    if <(costume [number v]) = [5]> then\n                        if <(Speed badge) = [1]> then\n                            set [brightness v] effect to (0)\n                        else\n                            set [brightness v] effect to (-50)\n                        end\n                    else\n                        if <(costume [number v]) = [6]> then\n                            if <(Deflect Badge) = [1]> then\n                                set [brightness v] effect to (0)\n                            else\n                                set [brightness v] effect to (-50)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <(Achievements) = [1]> then\n        go to [front v] layer\n        set [text v] to [1]\n        set [ghost v] effect to (100)\n        set [pixelate v] effect to (100)\n        show\n        repeat (20)\n            change [pixelate v] effect by (-5)\n            change [ghost v] effect by (-10)\n        end\n        wait until <(Achievements) = [-1]>\n        repeat (20)\n            change [pixelate v] effect by (5)\n            change [ghost v] effect by (5)\n        end\n        hide\n        set [text v] to [0]\n    end\nend\n\nwhen I receive [begin v]\nrepeat until <(End) = [1]>\n    if <key (e v) pressed?> then\n        set [achievements v] to ((Achievements) * (-1))\n        wait (1) seconds\n    end\nend\n\nwhen I receive [end v]\nwait (1) seconds\nset [achievements v] to [1]\nwait (3) seconds\nset [achievements v] to [-1]\n\n@Notification\n\nwhen flag clicked\nhide\nset [deflected v] to [0]\n\nwhen I receive [begin v]\nwait until <<(End) = [1]> and <(Completion) = [0]>>\nset [completion badge v] to [2]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [completion badge v] to [1]\n\nwhen I receive [begin v]\nwait until <((Exterminator b) + (Exterminator a)) > [29]>\nset [eliminator badge v] to [2]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [eliminator badge v] to [1]\n\nwhen I receive [begin v]\nwait until <(Death) > [99]>\nset [presist badge v] to [2]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [presist badge v] to [1]\n\nwhen I receive [begin v]\nwait until <(Precise Archer) > [9]>\nset [archer badge v] to [2]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [archer badge v] to [1]\n\nset [completion badge v] to [0]\nset [eliminator badge v] to [0]\nset [presist badge v] to [0]\nset [archer badge v] to [0]\nset [speed badge v] to [0]\nset [deflect badge v] to [0]\n\nwhen I receive [begin v]\nwait until <<(End) = [1]> and <(Time) < [309]>>\nwait (2) seconds\nset [speed badge v] to [2]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [speed badge v] to [1]\n\nwhen I receive [begin v]\nwait until <[29] < (Deflected)>\nset [deflect badge v] to [2]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [deflect badge v] to [1]\n\nwhen I start as a clone\ngo to x: (160) y: (131)\ngo to [front v] layer\nset [pixelate v] effect to (100)\nset [ghost v] effect to (100)\nif <(Speed badge) = [2]> then\n    switch costume to (costume5 v)\nelse\n    if <(Completion Badge) = [2]> then\n        switch costume to (costume1 v)\n    else\n        if <(Eliminator Badge) = [2]> then\n            switch costume to (costume2 v)\n        else\n            if <(Archer Badge) = [2]> then\n                switch costume to (costume3 v)\n            else\n                if <(Deflected) = [2]> then\n                    switch costume to (costume6 v)\n                else\n                    if <(Presist Badge) = [2]> then\n                        switch costume to (costume4 v)\n                    end\n                end\n            end\n        end\n    end\nend\nshow\nrepeat (20)\n    change [ghost v] effect by (-10)\n    change [pixelate v] effect by (-5)\nend\nwait (1.5) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\n    change [pixelate v] effect by (5)\nend\ndelete this clone\n\n