Scratch - A Platformer #all

Instructions: Make your own levels:\nhttps://scratch.mit.edu/projects/753049043\n\nMovement: WASD / Arrows\n(Fire) Throw Fireball / (Tanooki) Spin Tail / Start Level: Space\nUse Pipe: S / Down Arrow\n(Tanooki) Transform into a Statue: E / M \n(Tanooki - While Running) Fly: W / Up Arrow\n\nIf the game is still loading, it's because the game is 28.1mb big. Just give it a few more seconds, read the Notes while you wait. Don't comment complaints because at this point, it's your internet that's slow. I'm sorry I made an expansive and content-rich game for you.

@Stage\n\nwhen I receive [play game v]\nstop [other scripts in sprite v]\nstop all sounds\nset [pitch v] effect to (0)\nsound?\nforever\n    play sound [Main - Synchronize v] until done\nend\n\nwhen I receive [oof v]\nrepeat (20)\n    change [pitch v] effect by (-5)\n    change volume by (-5)\nend\nstop [other scripts in sprite v]\nstop all sounds\nset volume to (100) %\nsound?\nset [pitch v] effect to (100)\nforever\n    play sound [lose - without M1ndbreaker v] until done\nend\n\nwhen I receive [space oof v]\nrepeat (20)\n    change [pitch v] effect by (-5)\n    change volume by (-5)\nend\nstop [other scripts in sprite v]\nstop all sounds\nset volume to (100) %\nsound?\nset [pitch v] effect to (100)\nforever\n    play sound [lose - without M1ndbreaker v] until done\nend\n\nwhen I receive [replay v]\nstop [other scripts in sprite v]\nstop all sounds\nstart sound [elevator sound v]\nset [pitch v] effect to (0)\nsound?\nforever\n    play sound [Main - Synchronize2 v] until done\nend\n\nwhen I receive [replay space v]\nstop [other scripts in sprite v]\nstop all sounds\nstart sound [elevator sound v]\nset [pitch v] effect to (0)\nsound?\nforever\n    play sound [Main - Synchronize2 v] until done\nend\n\nwhen I receive [menu v]\nstop [other scripts in sprite v]\nset [menu? v] to [1]\nstop all sounds\nset [pitch v] effect to (0)\nsound?\nforever\n    play sound [Across-the-Garden v] until done\nend\n\ndefine sound?\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [pause v]\nstop [other scripts in sprite v]\nwait (.3) seconds\nstop all sounds\nset [pitch v] effect to (0)\nsound?\nforever\n    play sound [pasue v] until done\nend\n\nwhen I receive [unpause v]\nstop [other scripts in sprite v]\nstop all sounds\nset [pitch v] effect to (0)\nsound?\nforever\n    play sound [Main - Synchronize2 v] until done\nend\n\nwhen flag clicked\nbroadcast (Green Flag v)\nset [pitch v] effect to (0)\nset [admin v] to [0]\ndelete all of [seen cutscenes v]\ndelete all of [weapon unlocked? v]\n\nwhen I receive [play game v]\nset [pitch v] effect to (0)\nset [admin v] to [0]\ndelete all of [seen cutscenes v]\ndelete all of [weapon unlocked? v]\n\nwhen [t v] key pressed\nset [admin v] to [1]\nset [weapon picked up? v] to [1]\nif <(admin) = [1]> then\n    ask [console] and wait\n    if <(answer) = [/money]> then\n        ask [How much?] and wait\n        if <<not <(answer) < [0]>> and <not <(answer) > [9999999999]>>> then\n            set [score v] to (answer)\n        end\n    end\n    if <(answer) = [/god]> then\n        set [max hp v] to [999999]\n        set [health v] to [999999]\n    end\n    if <(answer) = [/kill enemy]> then\n        set [enemy health v] to [0]\n        set [boss health v] to [0]\n    end\n    if <(answer) = [/help]> then\n        hide list [commands v]\n        wait (9) seconds\n        show list [commands v]\n    end\n    if <(answer) = [/kill]> then\n        set [health v] to [0]\n    end\n    if <(answer) = [/health]> then\n        ask [How much added HP?] and wait\n        if <not <(answer) < [0]>> then\n            set [health v] to (answer)\n        end\n    end\n    if <(answer) = [/weapon]> then\n        ask [which weapon? 1, 2, or 3] and wait\n        if <<not <(answer) < [0]>> and <not <(answer) > [3]>>> then\n            set [weapon picked up? v] to [1]\n            set [weapon selected v] to (answer)\n        end\n    end\n    if <(answer) = [/tp]> then\n        ask [which level] and wait\n        if <<not <(answer) < [0]>> and <not <(answer) > [24]>>> then\n            set [level v] to (answer)\n            broadcast (scroll effect X v)\n            if <[space levels v] contains (level)?> then\n                broadcast (replay space v)\n            else\n                broadcast (replay v)\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nset [score v] to [9999999]\n\n@blank\n\n@INTRO ANIMATION\n\nwhen I start as a clone\nif <(ID) = [1]> then\n    switch costume to (sky v)\n    go to x: (-100) y: (0)\n    show\n    repeat (1000)\n        change x by (.5)\n    end\nend\nif <(ID) = [2]> then\n    switch costume to (1 bitmap v)\n    show\n    repeat (250)\n        change y by (-.6)\n        change size by (.1)\n    end\nend\nif <(ID) = [3]> then\n    switch costume to (2 bitmap v)\n    show\n    repeat (250)\n        change y by (-1)\n        change size by (.2)\n    end\nend\nif <(ID) = [4]> then\n    switch costume to (3 bitmap v)\n    show\n    repeat (100)\n        change y by (-1.5)\n        change size by (.2)\n    end\n    delete this clone\nend\nif <(ID) = [5]> then\n    hide\n    switch costume to (empty v)\n    set [pixelate v] effect to (100)\n    switch costume to (logo v)\n    repeat (250)\n        change y by (.01)\n    end\n    go to x: (0) y: (0)\n    wait (1) seconds\n    show\n    repeat (36)\n        change size by (-.5)\n        change [pixelate v] effect by (-2.77)\n    end\n    wait (3) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n        change [pixelate v] effect by (5)\n    end\n    wait (1.5) seconds\n    set size to (100) %\n    clear graphic effects\n    switch costume to (scratch logo v)\n    set [pixelate v] effect to (100)\n    show\n    repeat (20)\n        change [pixelate v] effect by (-5)\n        change size by (-.5)\n    end\n    wait (3) seconds\n    repeat (20)\n        change [pixelate v] effect by (5)\n        change [ghost v] effect by (5)\n    end\n    wait (1.5) seconds\n    broadcast (long transistion v)\nend\n\nwhen I start as a clone\nif <<(ID) = [1]> or <<(ID) = [2]> or <<(ID) = [3]> or <<(ID) = [4]> or <(ID) = [5]>>>>> then\n    wait (22.5) seconds\n    delete this clone\nend\nif <(ID) = [6]> then\n    go to [back v] layer\n    switch costume to (sky v)\n    go to x: (-100) y: (0)\n    show\n    repeat (1000)\n        change x by (.5)\n    end\nend\nif <(ID) = [7]> then\n    go to [front v] layer\n    reset\n    show\n    switch costume to (exposition0 v)\n    wait (4) seconds\n    repeat (9)\n        start sound (pick random (1) to (4))\n        next costume\n        wait (pick random (.09) to (.15)) seconds\n    end\n    wait (4) seconds\n    go to x: (0) y: (0)\n    switch costume to (building main 1 v)\n    set size to (100) %\n    show\n    wait (1) seconds\n    repeat (65)\n        change y by (((-140) - (y position)) / (14))\n    end\n    go to [front v] layer\n    wait (2) seconds\n    broadcast (long transistion v)\n    wait (1) seconds\n    go to x: (0) y: (0)\n    switch costume to (slow day 1 v)\n    wait (3.5) seconds\n    repeat (18)\n        start sound (pick random (1) to (4))\n        next costume\n        wait (pick random (.09) to (.15)) seconds\n    end\n    wait (2) seconds\n    switch costume to (slow day 1 v)\n    play sound [type finished v] until done\n    switch costume to (clock1 v)\n    set [clock handshow \(cutscene 1\) v] to [1]\n    start sound [ticking clock v]\n    wait (4) seconds\n    stop all sounds\n    set [clock handshow \(cutscene 1\) v] to [0]\n    start sound [office ambience1 v]\n    switch costume to (office day v)\n    wait (4) seconds\n    stop all sounds\n    switch costume to (clock2 v)\n    set [clock handshow \(cutscene 1\) v] to [1]\n    start sound [ticking clock v]\n    wait (3.5) seconds\n    stop all sounds\n    set [clock handshow \(cutscene 1\) v] to [0]\n    start sound [office ambience2 v]\n    switch costume to (office day2 v)\n    wait (3.5) seconds\n    stop all sounds\n    switch costume to (clock3 v)\n    set [clock handshow \(cutscene 1\) v] to [1]\n    start sound [ticking clock v]\n    wait (3) seconds\n    stop all sounds\n    set [clock handshow \(cutscene 1\) v] to [0]\n    start sound [office ambience3 v]\n    switch costume to (office day3 v)\n    wait (3) seconds\n    stop all sounds\n    switch costume to (clock4 v)\n    set [clock handshow \(cutscene 1\) v] to [1]\n    start sound [ticking clock v]\n    wait (3) seconds\n    stop all sounds\n    set [clock handshow \(cutscene 1\) v] to [0]\n    start sound [office ambience4 v]\n    switch costume to (office day4 v)\n    wait (3) seconds\n    stop all sounds\n    switch costume to (clock5 v)\n    set [clock handshow \(cutscene 1\) v] to [1]\n    start sound [ticking clock v]\n    wait (3) seconds\n    stop all sounds\n    start sound [type finished v]\n    set [clock handshow \(cutscene 1\) v] to [0]\n    switch costume to (office day5 v)\n    wait (2) seconds\n    start sound [dream-sound-effect-downscale-7134 v]\n    repeat (3)\n        next costume\n        wait (1) seconds\n    end\n    wait (1.5) seconds\n    switch costume to (asleep23 v)\n    wait (.3) seconds\n    repeat (22)\n        start sound [type4 v]\n        switch costume to ((costume [number v]) - (1))\n        wait (pick random (.1) to (.2)) seconds\n    end\n    wait (2.5) seconds\n    broadcast (end wait skip cutscene \(intro\) v)\n    broadcast (transition v)\n    broadcast (menu v)\nend\nif <(ID) = [8]> then\n    reset\n    switch costume to (second hand \(for clock\) v)\n    forever\n        if <(clock handshow \(CUTSCENE 1\)) = [1]> then\n            show\n            go to [front v] layer\n            point in direction ((current [second v]) * (6))\n        else\n            hide\n            point in direction ((current [second v]) * (6))\n        end\n    end\nend\n\ndefine reset\nhide\npoint in direction (90)\nclear graphic effects\ngo to x: (0) y: (0)\nswitch costume to (empty v)\nset size to (100) %\n\nwhen I receive [menu v]\ndelete this clone\n\nchange y by (((-140) - (y position)) / (14))\n\nwhen I receive [skip intro v]\nstop [other scripts in sprite v]\nhide\nbroadcast (menu v)\ndelete this clone\n\nwhen I receive [menu v]\ndelete this clone\n\nwhen I receive [green flag v]\nhide\nstart sound [Across-the-Garden v]\nhide variable [health v]\nset [score v] to [0]\nhide variable [score v]\nset [clock handshow \(cutscene 1\) v] to [0]\npoint in direction (90)\nclear graphic effects\ngo to x: (0) y: (0)\nswitch costume to (empty v)\nset size to (100) %\nbroadcast (transition v)\nwait (1) seconds\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [3]\ncreate clone of (_myself_ v)\nset [id v] to [4]\ncreate clone of (_myself_ v)\nset [id v] to [5]\ncreate clone of (_myself_ v)\nwait (0) seconds\nwait (22.5) seconds\nstart sound [1276579_A-Colder-Blue--2023 v]\nset [id v] to [6]\ncreate clone of (_myself_ v)\nset [id v] to [7]\ncreate clone of (_myself_ v)\nset [id v] to [8]\ncreate clone of (_myself_ v)\n\n@menu\n\ndefine reset\nhide\npoint in direction (90)\nclear graphic effects\ngo to x: (0) y: (0)\nswitch costume to (empty v)\nset size to (100) %\n\nwhen I start as a clone\nif <(ID) = [1]> then\n    reset\n    go to [back v] layer\n    switch costume to (menu bg v)\n    set [ghost v] effect to (100)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\nif <(ID) = [2]> then\n    reset\n    go to [front v] layer\n    go to x: (0) y: (200)\n    show\n    switch costume to (title  v)\n    repeat (20)\n        change y by (((0) - (y position)) / (7))\n    end\nend\nif <(ID) = [3]> then\n    reset\n    go to [front v] layer\n    go to x: (-100) y: (0)\n    show\n    switch costume to (play v)\n    repeat (15)\n        change x by (((0) - (x position)) / (7))\n    end\n    forever\n        if <touching (mouse-pointer v)?> then\n            switch costume to (play slected v)\n            change x by (((10) - (x position)) / (7))\n            if <mouse down?> then\n                start sound [Machine v]\n                repeat (5)\n                    switch costume to (play v)\n                    wait (.07) seconds\n                    switch costume to (play slected v)\n                    wait (.07) seconds\n                end\n                broadcast (long transistion v)\n                wait (1.5) seconds\n                broadcast (backstory v)\n            end\n        else\n            change x by (((0) - (x position)) / (7))\n            switch costume to (play v)\n        end\n    end\nend\nif <(ID) = [4]> then\n    reset\n    go to [front v] layer\n    go to x: (-100) y: (0)\n    show\n    switch costume to (options v)\n    repeat (15)\n        change x by (((0) - (x position)) / (7))\n    end\n    forever\n        if <touching (mouse-pointer v)?> then\n            change x by (((10) - (x position)) / (7))\n            switch costume to (options selected v)\n            if <mouse down?> then\n                start sound [Machine v]\n                repeat (5)\n                    switch costume to (options v)\n                    wait (.07) seconds\n                    switch costume to (options selected v)\n                    wait (.07) seconds\n                end\n                broadcast (long transistion v)\n                wait (1) seconds\n                broadcast (menu options v)\n            end\n        else\n            change x by (((0) - (x position)) / (7))\n            switch costume to (options v)\n        end\n    end\nend\nif <(ID) = [5]> then\n    reset\n    go to [front v] layer\n    go to x: (-100) y: (0)\n    show\n    switch costume to (info v)\n    repeat (15)\n        change x by (((0) - (x position)) / (7))\n    end\n    forever\n        if <touching (mouse-pointer v)?> then\n            change x by (((10) - (x position)) / (7))\n            switch costume to (info selected v)\n            if <mouse down?> then\n                start sound [Machine v]\n                repeat (5)\n                    switch costume to (info v)\n                    wait (.07) seconds\n                    switch costume to (info selected v)\n                    wait (.07) seconds\n                end\n                broadcast (long transistion v)\n                wait (1) seconds\n                broadcast (menu info v)\n            end\n        else\n            change x by (((0) - (x position)) / (7))\n            switch costume to (info v)\n        end\n    end\nend\n\nwhen I receive [menu v]\nswitch backdrop to (empty black v)\nreset\nwait (1.5) seconds\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [3]\ncreate clone of (_myself_ v)\nset [id v] to [4]\ncreate clone of (_myself_ v)\nset [id v] to [5]\ncreate clone of (_myself_ v)\n\nwhen I receive [menu options v]\nreset\nwait (1) seconds\nset [id v] to [6]\ncreate clone of (_myself_ v)\nset [id v] to [7]\ncreate clone of (_myself_ v)\nset [id v] to [8]\ncreate clone of (_myself_ v)\nset [id v] to [9]\ncreate clone of (_myself_ v)\n\nwhen I receive [menu options v]\ndelete this clone\n\nwhen I receive [menu info v]\ndelete this clone\n\nwhen I receive [menu options v]\ndelete this clone\n\nwhen I start as a clone\nif <(ID) = [6]> then\n    reset\n    go to [back v] layer\n    switch costume to (options bg bottem v)\n    set [ghost v] effect to (100)\n    show\n    forever\n        go to x: (-519) y: (0)\n        wait (.1) seconds\n        repeat (20)\n            change [ghost v] effect by (-4)\n        end\n        repeat until <(x position) = [480]>\n            change x by (.5)\n        end\n        repeat (20)\n            change [ghost v] effect by (4)\n        end\n    end\nend\nif <(ID) = [7]> then\n    reset\n    go to [front v] layer\n    go to x: (0) y: (200)\n    show\n    switch backdrop to (black v)\n    switch costume to (options bg top v)\n    repeat (55)\n        change y by (((0) - (y position)) / (7))\n    end\nend\nif <(ID) = [8]> then\n    reset\n    set [sound? v] to [1]\n    go to [front v] layer\n    go to x: (0) y: (200)\n    show\n    switch costume to (sound on v)\n    repeat (15)\n        change y by (((0) - (y position)) / (7))\n    end\n    forever\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            if <(sound?) = [1]> then\n                set [sound? v] to [0]\n                start sound [Machine v]\n                wait (.5) seconds\n                switch costume to (sound off v)\n            else\n                if <(sound?) = [0]> then\n                    set [sound? v] to [1]\n                    start sound [Machine v]\n                    wait (.5) seconds\n                    switch costume to (sound on v)\n                end\n            end\n        end\n    end\nend\nif <(ID) = [9]> then\n    reset\n    go to [front v] layer\n    go to x: (0) y: (200)\n    show\n    switch costume to (back v)\n    repeat (15)\n        change y by (((0) - (y position)) / (7))\n    end\n    forever\n        if <touching (mouse-pointer v)?> then\n            switch costume to (back scelt v)\n            if <mouse down?> then\n                start sound [Machine v]\n                repeat (5)\n                    switch costume to (back v)\n                    wait (.07) seconds\n                    switch costume to (back scelt v)\n                    wait (.07) seconds\n                end\n                broadcast (long transistion v)\n                wait (1) seconds\n                broadcast (menu v)\n            end\n        else\n            switch costume to (back v)\n        end\n    end\nend\n\nwhen I receive [play game v]\ndelete this clone\n\nwhen I receive [menu v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(sound?) = [1]> then\n        set volume to (100) %\n    else\n        if <(sound?) = [0]> then\n            set volume to (0) %\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [backstory v]\ndelete this clone\n\nwhen I receive [green flag v]\nset [menu? v] to [0]\nset [menu? v] to [0]\nreset\n\n@SKIP intro\n\nwhen I receive [end wait skip cutscene \(intro\) v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nswitch costume to (costume2 v)\nset [ghost v] effect to (100)\n\nwhen I receive [green flag v]\nset [rtyrty v] to [100]\nwait (1) seconds\nforever\n    if <<(rtyrty) = [0]> or <(rtyrty) < [0]>> then\n        broadcast (long transistion v)\n        wait (1) seconds\n        broadcast (skip intro v)\n        stop [other scripts in sprite v]\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [green flag v]\nshow\nswitch backdrop to (black v)\nswitch costume to (costume2 v)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nforever\n    if <key (any v) pressed?> then\n        show\n        switch costume to (costume1 v)\n        change [ghost v] effect by (-2)\n        change [rtyrty v] by (-2)\n    else\n        set [ghost v] effect to (100)\n        set [rtyrty v] to [100]\n        hide\n    end\nend\n\nwhen I receive [green flag v]\nforever\n    go to [front v] layer\nend\n\n@Info panel\n\nwhen I receive [menu info v]\nbroadcast (transition v)\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nwait (2) seconds\nwait until <key (any v) pressed?>\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\nstart sound [click v]\nwait (.2) seconds\nbroadcast (long transistion v)\nwait (1) seconds\nbroadcast (menu v)\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [menu info v]\nforever\n    wait (1) seconds\n    switch costume to (1 v)\n    wait (1) seconds\n    switch costume to (2 v)\nend\n\nwhen I receive [green flag v]\nswitch costume to (1 v)\npoint in direction (90)\ngo to x: (0) y: (0)\ngo to [front v] layer\nhide\n\n@transition\n\nwhen I receive [transition v]\nset [transition? v] to [1]\nswitch costume to (black screen v)\ngo to [front v] layer\nshow\nclear graphic effects\nwait (1.3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (1 v)\nhide\nstop [other scripts in sprite v]\nset [transition? v] to [0]\n\nwhen I receive [long transistion v]\nset [transition? v] to [1]\nswitch costume to (black screen v)\nchange [ghost v] effect by (100)\nshow\nrepeat (25)\n    change [ghost v] effect by (-5)\nend\nwait (1) seconds\nrepeat (25)\n    change [ghost v] effect by (5)\nend\nswitch costume to (1 v)\nhide\nstop [other scripts in sprite v]\nset [transition? v] to [0]\ngo to [back v] layer\n\nwhen I receive [transition v]\nforever\n    go to [front v] layer\nend\n\nwhen I receive [long transistion v]\nforever\n    go to [front v] layer\nend\n\nwhen I receive [green flag v]\nhide\n\n@Back Story\n\nwhen I receive [backstory v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (costume1 v)\nwait until <key (any v) pressed?>\nbroadcast (long transistion v)\nwait (1.5) seconds\nbroadcast (Play Game v)\nhide\n\nwhen I receive [backstory v]\nforever\n    switch costume to (costume1 v)\n    wait (1) seconds\n    switch costume to (costume2 v)\n    wait (1) seconds\nend\n\nwhen I receive [green flag v]\ngo to x: (0) y: (0)\nhide\n\n@"Player"\n\nwhen I receive [play game v]\nset [dance? v] to [0]\nforever\n    if <<<not <[space levels v] contains (level)?>> and <<(move?) = [1]> and <(cutscene) = [0]>>> and <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>>> and <(AIR) = [0]>>> then\n        play sound (pick random (1) to (4)) until done\n    end\nend\n\ndefine run animation loop\nif <<(dance?) = [0]> and <<not <<(cutscene) = [0]> and <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <<(move?) = [0]> or <(weapon fire) = [1]>>>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n    switch costume to (run 2 v)\n    wait (.04) seconds\n    if <<(dance?) = [0]> and <<not <<(cutscene) = [0]> and <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <<(move?) = [0]> or <(weapon fire) = [1]>>>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n        switch costume to (run 3 v)\n        wait (.04) seconds\n        if <<(dance?) = [0]> and <<not <<(cutscene) = [0]> and <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <<(move?) = [0]> or <(weapon fire) = [1]>>>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n            switch costume to (run 4 v)\n            wait (.04) seconds\n            if <<(dance?) = [0]> and <<not <<(cutscene) = [0]> and <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <<(move?) = [0]> or <(weapon fire) = [1]>>>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n                switch costume to (intorplation 2 v)\n                wait (.04) seconds\n                if <<(dance?) = [0]> and <<not <<(cutscene) = [0]> and <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <<(move?) = [0]> or <(weapon fire) = [1]>>>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n                    switch costume to (walk f6 v)\n                    wait (.04) seconds\n                    if <<(dance?) = [0]> and <<not <<(cutscene) = [0]> and <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <<(move?) = [0]> or <(weapon fire) = [1]>>>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n                        switch costume to (walk f2 v)\n                        wait (.04) seconds\n                        if <<(dance?) = [0]> and <<not <<(cutscene) = [0]> and <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <<(move?) = [0]> or <(weapon fire) = [1]>>>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n                            switch costume to (walk f7 v)\n                            wait (.04) seconds\n                            if <<(dance?) = [0]> and <<not <<(cutscene) = [0]> and <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <<(move?) = [0]> or <(weapon fire) = [1]>>>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n                                switch costume to (walk f3 v)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine fire\nif <(Weapon selected) = [1]> then\n    set [weapon fire v] to [1]\n    switch costume to (fire v)\n    wait (.06) seconds\n    switch costume to (fire2 v)\n    wait (.06) seconds\n    switch costume to (fire3 v)\n    wait (.06) seconds\n    switch costume to (fire4 v)\n    wait (.06) seconds\n    switch costume to (fire3 v)\n    wait (.06) seconds\n    switch costume to (fire2 v)\n    wait (.06) seconds\n    switch costume to (fire v)\n    set [weapon fire v] to [0]\nend\nif <<(Weapon selected) = [2]> and <not <[space levels v] contains (level)?>>> then\n    set [weapon fire v] to [1]\n    set [move? v] to [0]\n    switch costume to (purple 1 v)\n    wait (.06) seconds\n    switch costume to (purple 2 v)\n    wait (.06) seconds\n    switch costume to (purple 3 v)\n    wait (.06) seconds\n    switch costume to (purple 4 v)\n    wait (.06) seconds\n    switch costume to (purple 5 v)\n    wait (.06) seconds\n    switch costume to (purple 6 v)\n    wait (.06) seconds\n    switch costume to (purple 7 v)\n    wait (.06) seconds\n    switch costume to (purple 8 v)\n    wait (.06) seconds\n    switch costume to (purple 9 v)\n    wait (.06) seconds\n    switch costume to (purple 9 v)\n    wait (.45) seconds\n    switch costume to (purple 8 v)\n    wait (.06) seconds\n    switch costume to (purple 7 v)\n    wait (.06) seconds\n    switch costume to (purple 6 v)\n    wait (.06) seconds\n    switch costume to (purple 5 v)\n    wait (.06) seconds\n    switch costume to (purple 4 v)\n    wait (.06) seconds\n    switch costume to (purple 3 v)\n    wait (.06) seconds\n    switch costume to (purple 2 v)\n    wait (.06) seconds\n    switch costume to (purple 1 v)\n    wait (.1) seconds\n    set [move? v] to [1]\n    set [weapon fire v] to [0]\nend\nif <(Weapon selected) = [3]> then\n    set [weapon fire v] to [1]\n    switch costume to (stapler v)\n    wait (.05) seconds\n    switch costume to (stapler2 v)\n    wait (.05) seconds\n    switch costume to (stapler3 v)\n    wait (.05) seconds\n    switch costume to (stapler4 v)\n    wait (.05) seconds\n    switch costume to (stapler3 v)\n    set [weapon fire v] to [0]\nend\n\ndefine idle\nif <not <<<(dance?) = [1]> or <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <(weapon fire) = [1]>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n    switch costume to (idle v)\n    wait (.09) seconds\n    if <not <<<(dance?) = [1]> or <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <(weapon fire) = [1]>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n        switch costume to (idle2 v)\n        wait (.09) seconds\n        if <not <<<(dance?) = [1]> or <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <(weapon fire) = [1]>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n            switch costume to (idle3 v)\n            wait (.09) seconds\n            if <not <<<(dance?) = [1]> or <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <(weapon fire) = [1]>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n                switch costume to (idle4 v)\n                wait (.09) seconds\n                if <not <<<(dance?) = [1]> or <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <(weapon fire) = [1]>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n                    switch costume to (idle3 v)\n                    wait (.09) seconds\n                    if <not <<<(dance?) = [1]> or <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <(weapon fire) = [1]>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n                        switch costume to (idle2 v)\n                        wait (.09) seconds\n                        if <not <<<(dance?) = [1]> or <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <(weapon fire) = [1]>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n                            switch costume to (idle v)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine stop running\nswitch costume to (run \(loopstart\) v)\nrepeat (2)\n    switch costume to ((costume [number v]) - (1))\n    wait (.09) seconds\nend\n\nwhen I receive [play game v]\nshow\npoint in direction (90)\nset size to (130) %\nset [weapon picked up? v] to [0]\nforever\n    if <not <<<(dance?) = [1]> or <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <(weapon fire) = [1]>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n        idle\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <<(dance?) = [0]> and <<not <<(cutscene) = [0]> and <<<key (f v) pressed?> and <(Weapon picked up?) = [1]>> or <<(move?) = [0]> or <(weapon fire) = [1]>>>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>>>>> then\n        run animation loop\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <(move?) = [1]>> then\n        point in direction (90)\n        set [direction v] to [90]\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <(move?) = [1]>> then\n        point in direction (-90)\n        set [direction v] to [-90]\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(move?) = [1]>> and <(weapon fire) = [0]>> then\n        switch costume to (up v)\n    end\nend\n\nwhen I receive [play game v]\nwait until <(Weapon picked up?) = [1]>\nforever\n    if <<not <<key (up arrow v) pressed?> or <key (w v) pressed?>>> and <<(dance?) = [0]> and <<(cutscene) = [0]> and <<(AIR) = [0]> and <<key (f v) pressed?> and <(move?) = [1]>>>>>> then\n        fire\n    end\nend\n\ndefine Lose Health\nif <<(Health) < [0]> or <(Health) = [0]>> then\n    broadcast (oof v) and wait\nelse\n    start sound (pick random (5) to (7))\n    change [health v] by (-1)\n    broadcast (Ui health/score change v)\n    set [color v] effect to (175)\n    wait (.5) seconds\n    set [color v] effect to (0)\n    wait (.5) seconds\nend\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\ndefine die\nif <<(Health) < [0]> or <(Health) = [0]>> then\n    broadcast (oof v) and wait\nelse\n    set [color v] effect to (175)\n    wait (.2) seconds\n    set [color v] effect to (0)\n    start sound (pick random (5) to (7))\n    set [health v] to [0]\nend\n\nwhen I receive [play game v]\nforever\n    if <<<<touching (robot v)?> or <touching (mouse v)?>> or <touching (boss attacks v)?>> and <(move?) = [1]>> then\n        Lose Health\n    end\nend\n\nwhen I receive [tick v]\ngo to (hitbox v)\nif <[space levels v] contains (level)?> then\n    hide\nelse\n    show\nend\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nhide\nset [level v] to [1]\n\nwhen I receive [play game v]\nforever\n    if <<<touching (oof v)?> or <(y position) < [-175]>> or <<(Health) < [0]> or <(Health) = [0]>>> then\n        die\n    end\nend\n\nwhen flag clicked\nhide\n\ndefine dance\nset [dance? v] to [1]\nswitch costume to (e1 v)\nrepeat (14)\n    next costume\n    wait (.06) seconds\nend\nrepeat (3)\n    repeat (4)\n        switch costume to ((costume [number v]) - (1))\n        wait (.06) seconds\n    end\n    repeat (4)\n        next costume\n        wait (.06) seconds\n    end\nend\nrepeat (14)\n    switch costume to ((costume [number v]) - (1))\n    wait (.06) seconds\nend\nset [dance? v] to [0]\n\n@SpaceSuit "Player"\n\nwhen I receive [play game v]\nhide\npoint in direction (90)\nset size to (130) %\nset [weapon picked up? v] to [0]\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <(move?) = [1]>> then\n        point in direction (90)\n        set [direction v] to [90]\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <(move?) = [1]>> then\n        point in direction (-90)\n        set [direction v] to [-90]\n    end\n    if <<<<(y position) < [-175]> or <touching (oof v)?>> and <(move?) = [1]>> and <[space levels v] contains (level)?>> then\n        Lose Health\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(move?) = [1]>> then\n        switch costume to (up v)\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <<not <(move?) = [0]>> and <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n        run animation loop\n    end\nend\n\ndefine run animation loop\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n    switch costume to (walk f1 v)\n    wait (.04) seconds\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n        switch costume to (walk f2 v)\n        wait (.04) seconds\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n            switch costume to (walk f3 v)\n            wait (.04) seconds\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n                switch costume to (walk f4 v)\n                wait (.04) seconds\n            end\n        end\n    end\nend\n\nwhen I receive [play game v]\nshow\nforever\n    if <not <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n        switch costume to (still v)\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <[space levels v] contains (level)?> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(move?) = [1]>> and <<not <(move?) = [0]>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>>>> then\n        switch costume to (up v)\n    end\nend\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nhide\n\ndefine Lose Health\nset [health v] to [0]\nbroadcast (oof v) and wait\n\nwhen I receive [tick v]\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [tick v]\ngo to (hitbox v)\n\nwhen I receive [play game v]\nforever\n    if <<<[space levels v] contains (level)?> and <<(move?) = [1]> and <(cutscene) = [0]>>> and <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>>> and <(AIR) = [0]>>> then\n        play sound (pick random (1) to (4)) until done\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\n@HITBOX\n\nwhen I receive [the end :\) v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [play game v]\nforever\n    if <(move?) = [1]> then\n        if <<<<(x position) = [235]> or <(x position) > [235]>> and <<(Enemy Health) = [0]> or <(Enemy Health) < [0]>>> and <(boss alive?) = [0]>> then\n            set [x move v] to [0]\n            set [y move v] to [0]\n            change [level v] by (1)\n            broadcast (scroll effect X v) and wait\n            go to x: (Spawn x) y: (Spawn y)\n            broadcast (next level v)\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <<(move?) = [1]> and <(cutscene) = [0]>> then\n    set [x move v] to ((x move) * (0.85))\n    change x by (x move)\n    if <touching (platform v)?> then\n        change y by (-2)\n        if <touching (platform v)?> then\n            change y by (1)\n            if <touching (platform v)?> then\n                change y by (1)\n                if <touching (platform v)?> then\n                    change y by (1)\n                    if <touching (platform v)?> then\n                        change y by (1)\n                        if <touching (platform v)?> then\n                            change y by (1)\n                            if <touching (platform v)?> then\n                                change y by (-5)\n                                change x by ((-1) * (x move))\n                                if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <not <(move?) = [0]>>> then\n                                    set [y move v] to [8]\n                                    set [x move v] to (((x move) / ([abs v] of (x move) )) * (-10))\n                                else\n                                    set [x move v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (2)\n    end\nend\n\nwhen I receive [tick v]\nif <<(move?) = [1]> and <(cutscene) = [0]>> then\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x move v] by (-1.5)\n        point in direction (-90)\n        set [player direction v] to [-90]\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x move v] by (1.5)\n        point in direction (90)\n        set [player direction v] to [90]\n    end\nend\n\nwhen I receive [scroll effect x v]\nrepeat (60)\n    change x by (((Spawn x) - (x position)) / (12))\n    change y by (((Spawn y) - (y position)) / (12))\nend\n\nwhen I receive [replay v]\nhide\nset [x move v] to [0]\nset [y move v] to [0]\nchange [score v] by ((level score collected) - (20))\nif <<(Score) = [0]> or <(Score) < [0]>> then\n    set [score v] to [0]\nend\ngo to x: (Spawn x) y: (Spawn y)\npoint in direction (90)\nsound?\nstart sound [elevator sound v]\nset [health v] to (max HP)\nshow\nset [score show? v] to [1]\nset [move? v] to [1]\nset [you lose? v] to [0]\n\nwhen I receive [play game v]\nset [level v] to [1]\nstart sound [elevator sound v]\n\nwait until <(level) = [3]>\nrepeat (30)\n    set [move? v] to [0]\nend\nwait until <(level) = [4]>\nwait (2) seconds\nwait until <(playerX) > [87]>\nbroadcast (cutscene 3 \(lv 1 finished\) v)\nwait until <(level) = [11]>\nwait (2) seconds\nwait until <(playerX) > [87]>\nset [level v] to [12]\nbroadcast (scroll effect X v)\nbroadcast (transition v)\nstart sound [elevator sound v]\nwait until <(level) = [15]>\nwait (2) seconds\nwait until <(playerX) > [0]>\nset [level v] to [12]\nbroadcast (scroll effect X v)\nbroadcast (transition v)\nbroadcast (animation .5 v)\nwait until <<(level) = [21]> and <(playerX) > [-90]>>\nset [level v] to [22]\nbroadcast (scroll effect X v)\nbroadcast (transition v)\nwait (1.3) seconds\nbroadcast (animation2 v)\nwait until <(level) = [23]>\nbroadcast (transition v)\nbroadcast (boss info v)\nwait until <<(level) = [24]> and <(playerX) > [87]>>\nbroadcast (transition v)\nbroadcast (game end v)\n\nwhen I receive [replay space v]\nhide\nset [x move v] to [0]\nset [y move v] to [0]\nchange [score v] by ((level score collected) - (20))\nif <<(Score) = [0]> or <(Score) < [0]>> then\n    set [score v] to [0]\nend\ngo to x: (Spawn x) y: (Spawn y)\npoint in direction (90)\nsound?\nstart sound [Crunch v]\nset [health v] to (max HP)\nshow\nset [score show? v] to [1]\nset [move? v] to [1]\nset [you lose? v] to [0]\n\nwhen I receive [game end v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nhide\nset [level v] to [1]\n\ndefine sound?\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [play game v]\nstart sound [elevator sound v]\nbroadcast (transition v)\ngo to [front v] layer\nset size to (130) %\nshow\ngo to x: (Spawn x) y: (Spawn y)\ngo to x: (-94) y: (-119)\npoint in direction (90)\nset [max hp v] to [4]\nset [health v] to [4]\nset [move? v] to [1]\nset [x move v] to [0]\nset [y move v] to [0]\nswitch costume to (hitbox v)\nset [ghost v] effect to (100)\nswitch backdrop to (empty v)\nset [score show? v] to [1]\nset [score v] to [0]\nset [admin v] to [0]\nset [ai touching player? v] to [0]\nset [air v] to [0]\nset [boss health v] to [0]\nset [collect money v] to [0]\nset [cutscene v] to [0]\nset [dialogue? v] to [0]\nset [enemy active v] to [0]\nset [enemy health v] to [0]\nset [shop? v] to [0]\nset [weapon picked up? v] to [0]\nset [level 2 score storage v] to [0]\nset [level 3 score storage v] to [0]\nset [you lose? v] to [0]\nbroadcast (enemy reset v)\n\nwhen I receive [scroll effect x v]\nif <(level) = [3]> then\n    repeat (30)\n        set [move? v] to [0]\n    end\nend\nif <(level) = [4]> then\n    wait (2) seconds\n    wait until <(playerX) > [87]>\n    broadcast (cutscene 3 \(lv 1 finished\) v)\nend\nif <(level) = [11]> then\n    wait (2) seconds\n    wait until <(playerX) > [87]>\n    set [level v] to [12]\n    broadcast (instant scroll effect x v)\n    broadcast (transition v)\n    start sound [elevator sound v]\n    broadcast (lv2 screenmove v)\n    set [level 2 score storage v] to (Score)\nend\nif <(level) = [15]> then\n    wait (2) seconds\n    wait until <(playerX) > [0]>\n    set [level v] to [16]\n    broadcast (instant scroll effect x v)\n    broadcast (transition v)\n    broadcast (animation .5 v)\n    set [level 3 score storage v] to (Score)\nend\nif <(level) = [20]> then\n    wait (2) seconds\n    wait until <(playerX) > [200]>\n    broadcast (transition v)\n    set [level v] to [21]\n    broadcast (instant scroll effect x v)\nend\nif <(level) = [22]> then\n    broadcast (transition v)\n    broadcast (boss info v)\nend\nif <(level) = [23]> then\n    wait (2) seconds\n    wait until <(playerX) > [85]>\n    broadcast (transition v)\n    set [level v] to [24]\n    broadcast (instant scroll effect x v)\nend\nif <(level) = [24]> then\n    wait (2) seconds\n    wait until <(playerX) > [-40]>\n    broadcast (transition v)\n    wait (1.3) seconds\n    broadcast (animation2 v) and wait\n    broadcast (game end v)\nend\n\nif <(level) = [21]> then\n    wait (2) seconds\n    wait until <(playerX) > [-90]>\n    set [level v] to [22]\nend\n\nbroadcast (transition v)\n\nbroadcast (animation2 v)\n\nwhen I receive [play game v]\nforever\n    broadcast (tick v)\nend\n\nwhen I receive [scroll effect x v]\nbroadcast (enemy reset v) and wait\nbroadcast (enemy start v)\n\nbroadcast (lv3 screenmove v)\n\nwhen I receive [tick v]\nset [playerx v] to (round (x position))\nset [playery v] to (round (y position))\n\nwhen I receive [pause reset v]\nhide\nset [x move v] to [0]\nset [y move v] to [0]\nbroadcast (transition v)\nif <<(level) > [0]> and <(level) < [12]>> then\n    if <[which unlocked in level 1? v] contains [purple]?> then\n        broadcast (shop purchase level reset purple v)\n    end\n    if <[which unlocked in level 1? v] contains [stapler]?> then\n        broadcast (shop purchase level reset stapler v)\n    end\n    if <[which unlocked in level 1? v] contains [health]?> then\n        broadcast (shop purchase level reset health v)\n    end\nelse\n    if <<(level) > [11]> and <(level) < [16]>> then\n        if <[which unlocked in level 2? v] contains [purple]?> then\n            broadcast (shop purchase level reset purple v)\n        end\n        if <[which unlocked in level 2? v] contains [stapler]?> then\n            broadcast (shop purchase level reset stapler v)\n        end\n        if <[which unlocked in level 2? v] contains [health]?> then\n            broadcast (shop purchase level reset health v)\n        end\n    else\n        if <<(level) > [15]> and <(level) < [24]>> then\n            if <[which unlocked in level 3? v] contains [purple]?> then\n                broadcast (shop purchase level reset purple v)\n            end\n            if <[which unlocked in level 3? v] contains [stapler]?> then\n                broadcast (shop purchase level reset stapler v)\n            end\n            if <[which unlocked in level 3? v] contains [health]?> then\n                broadcast (shop purchase level reset health v)\n            end\n        end\n    end\nend\nif <<(level) > [0]> and <(level) < [12]>> then\n    set [level v] to [1]\n    set [score v] to [0]\nelse\n    if <<(level) > [11]> and <(level) < [16]>> then\n        set [level v] to [12]\n        set [score v] to (level 2 score storage)\n    else\n        if <<(level) > [15]> and <(level) < [24]>> then\n            set [level v] to [16]\n            set [score v] to (level 3 score storage)\n        end\n    end\nend\nbroadcast (scroll effect X v)\ndelete all of [which unlocked in level 1? v]\ndelete all of [which unlocked in level 2? v]\ndelete all of [which unlocked in level 3? v]\ngo to x: (Spawn x) y: (Spawn y)\npoint in direction (90)\nset [health v] to (max HP)\nshow\nset [score show? v] to [1]\nset [move? v] to [1]\n\nif <<(level) > [0]> and <(level) < [12]>> then\n    set [level v] to [1]\n    set [score v] to [0]\nelse\n    if <<(level) > [11]> and <(level) < [16]>> then\n        set [level v] to [12]\n        set [score v] to (level 2 score storage)\n    else\n        if <<(level) > [15]> and <(level) < [24]>> then\n            set [level v] to [16]\n            set [score v] to (level 3 score storage)\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <(level) = [1]> then\n    set [spawn x v] to [-94]\n    set [spawn y v] to [-123]\nelse\n    if <(level) = [2]> then\n        set [spawn x v] to [-200]\n        set [spawn y v] to [-123]\n    else\n        if <(level) = [3]> then\n            set [spawn x v] to [-200]\n            set [spawn y v] to [-123]\n        else\n            if <(level) = [4]> then\n                set [spawn x v] to [-200]\n                set [spawn y v] to [-125]\n            else\n                if <(level) = [5]> then\n                    set [spawn x v] to [-70]\n                    set [spawn y v] to [-119]\n                else\n                    if <(level) = [6]> then\n                        set [spawn x v] to [-200]\n                        set [spawn y v] to [-119]\n                    else\n                        if <(level) = [7]> then\n                            set [spawn x v] to [-200]\n                            set [spawn y v] to [-119]\n                        else\n                            if <(level) = [8]> then\n                                set [spawn x v] to [-200]\n                                set [spawn y v] to [-119]\n                            else\n                                if <(level) = [9]> then\n                                    set [spawn x v] to [-175]\n                                    set [spawn y v] to [10]\n                                else\n                                    if <(level) = [10]> then\n                                        set [spawn x v] to [-200]\n                                        set [spawn y v] to [-119]\n                                    else\n                                        if <(level) = [11]> then\n                                            set [spawn x v] to [-200]\n                                            set [spawn y v] to [-119]\n                                        else\n                                            if <(level) = [12]> then\n                                                switch backdrop to (spaceship v)\n                                                set [spawn x v] to [-70]\n                                                set [spawn y v] to [-119]\n                                            else\n                                                if <(level) = [13]> then\n                                                    switch backdrop to (spaceship v)\n                                                    set [spawn x v] to [-200]\n                                                    set [spawn y v] to [-119]\n                                                else\n                                                    if <(level) = [14]> then\n                                                        switch backdrop to (spaceship v)\n                                                        set [spawn x v] to [-217]\n                                                        set [spawn y v] to [-119]\n                                                    else\n                                                        if <(level) = [15]> then\n                                                            switch backdrop to (hangernoship v)\n                                                            set [spawn x v] to [-200]\n                                                            set [spawn y v] to [47]\n                                                        else\n                                                            if <(level) = [16]> then\n                                                                switch backdrop to (space v)\n                                                                set [spawn x v] to [100]\n                                                                set [spawn y v] to [-86]\n                                                            else\n                                                                if <(level) = [17]> then\n                                                                    switch backdrop to (space v)\n                                                                    set [spawn x v] to [-200]\n                                                                    set [spawn y v] to [-86]\n                                                                else\n                                                                    if <(level) = [18]> then\n                                                                        switch backdrop to (space v)\n                                                                        set [spawn x v] to [-200]\n                                                                        set [spawn y v] to [-86]\n                                                                    else\n                                                                        if <(level) = [19]> then\n                                                                            switch backdrop to (space v)\n                                                                            set [spawn x v] to [-210]\n                                                                            set [spawn y v] to [84]\n                                                                        else\n                                                                            if <(level) = [20]> then\n                                                                                switch backdrop to (space v)\n                                                                                set [spawn x v] to [-200]\n                                                                                set [spawn y v] to [-86]\n                                                                            else\n                                                                                if <(level) = [21]> then\n                                                                                    set [spawn x v] to [-70]\n                                                                                    set [spawn y v] to [-119]\n                                                                                else\n                                                                                    if <(level) = [22]> then\n                                                                                        switch backdrop to (empty v)\n                                                                                        set [spawn x v] to [-205]\n                                                                                        set [spawn y v] to [-122]\n                                                                                    else\n                                                                                        if <(level) = [23]> then\n                                                                                            set [spawn x v] to [-200]\n                                                                                            set [spawn y v] to [-119]\n                                                                                        else\n                                                                                            if <(level) = [24]> then\n                                                                                                switch backdrop to (space v)\n                                                                                                set [spawn x v] to [-200]\n                                                                                                set [spawn y v] to [-86]\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        end\n    end\nend\n\nwhen I receive [tick v]\nif <<(move?) = [1]> and <(cutscene) = [0]>> then\n    set [air v] to [1]\n    change y by (-3)\n    if <touching (platform v)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y move v] to [8.5]\n        end\n    end\n    change y by (3)\n    if <(y move) > [-15]> then\n        change [y move v] by (-0.5)\n    end\n    change y by (-2)\n    if <not <touching (platform v)?>> then\n        change y by (-1)\n        if <not <touching (platform v)?>> then\n            change y by (-1)\n            if <not <touching (platform v)?>> then\n                change y by (-1)\n                if <not <touching (platform v)?>> then\n                    change y by (-1)\n                    if <not <touching (platform v)?>> then\n                        change y by (-1)\n                        if <not <touching (platform v)?>> then\n                            change y by (5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\n    change y by (y move)\n    if <touching (platform v)?> then\n        set [air v] to [0]\n        change y by (-2)\n        if <touching (platform v)?> then\n            change y by ((-1) * (y move))\n            set [y move v] to [-3]\n        end\n        change y by (2)\n    end\nend\n\nwhen I receive [player spawn reset v]\ngo to x: (Spawn x) y: (Spawn y)\n\nwhen I receive [green flag v]\nhide\n\n@rocket lift off\n\nwhen I receive [animation .5 v]\nset [cutscene v] to [1]\nwait (1.3) seconds\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume2 v)\ngo to [front v] layer\nshow\nreset timer\nwait (2) seconds\nrepeat (30)\n    change y by (10)\nend\nwait (1) seconds\nbroadcast (transition v)\nwait (1.3) seconds\nbroadcast (animation1 v)\nhide\n\nwhen I start as a clone\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nshow\nwait (4.2) seconds\nhide\ndelete this clone\n\nwhen I receive [game end v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [green flag v]\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nset size to (100) %\n\n@cutscene 5/6\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (clone v)\ngo to x: (pick random (-125) to (125)) y: (pick random (-150) to (-50))\nset size to (500) %\nset [ghost v] effect to (80)\nrepeat (15)\n    change size by (4)\nend\ndelete this clone\n\nwhen I receive [animation1 v]\nswitch backdrop to (space v)\nset [move? v] to [0]\nset [cutscene v] to [1]\nshow\nswitch costume to (1 v)\nset size to (100) %\ngo to x: (0) y: (0)\ngo to [front v] layer\nrepeat (8)\n    go to [front v] layer\n    show\n    create clone of (_myself_ v)\n    change y by (my variable)\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change x by ((my variable) * (-1))\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change y by ((my variable) * (-1))\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change x by (my variable)\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change y by ((my variable) * (-1))\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change x by (my variable)\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change y by (my variable)\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change x by ((my variable) * (-1))\n    wait (0.01) seconds\nend\ngo to x: (0) y: (0)\nrepeat (13)\n    next costume\n    wait (.02) seconds\nend\nwait (2) seconds\nswitch costume to (costume v)\nbroadcast (transition v) and wait\nwait (1) seconds\nrepeat (12)\n    next costume\n    wait (.02) seconds\nend\nwait (2) seconds\nset [level v] to [16]\nbroadcast (instant scroll effect x v)\nswitch backdrop to (space v)\nbroadcast (long transistion v)\nwait (1) seconds\nset [move? v] to [1]\nhide\nbroadcast (lv3 screenmove v)\nset [cutscene v] to [0]\ndelete this clone\n\nwhen I receive [animation2 v]\nset [move? v] to [0]\nset [cutscene v] to [1]\nshow\nswitch costume to (moon1 v)\nset size to (100) %\ngo to x: (0) y: (0)\ngo to [front v] layer\nrepeat (8)\n    go to [front v] layer\n    create clone of (_myself_ v)\n    change y by (my variable)\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change x by ((my variable) * (-1))\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change y by ((my variable) * (-1))\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change x by (my variable)\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change y by ((my variable) * (-1))\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change x by (my variable)\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change y by (my variable)\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    change x by ((my variable) * (-1))\n    wait (0.01) seconds\nend\ngo to x: (0) y: (0)\nrepeat (14)\n    next costume\n    wait (.02) seconds\nend\nwait (2) seconds\nswitch costume to (moonspace1 v)\nbroadcast (transition v) and wait\nwait (1) seconds\nrepeat (11)\n    next costume\n    wait (.02) seconds\nend\nwait (2) seconds\nbroadcast (long transistion v)\nwait (1) seconds\nhide\ndelete this clone\n\nwhen I receive [game end v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [play game v]\nset [cutscene v] to [0]\n\nwhen I receive [green flag v]\nhide\nset size to (100) %\ngo to x: (0) y: (0)\ngo to [front v] layer\n\n@Bullets\n\nwhen I start as a clone\nif <<(Weapon selected) = [1]> or <(Weapon selected) = [3]>> then\n    wait (.05) seconds\n    change [ammo v] by (-1)\n    sound?\n    if <(Weapon selected) = [1]> then\n        start sound (pick random (1) to (3))\n    end\n    if <(Weapon selected) = [3]> then\n        start sound [stapler v]\n    end\n    go to ("player" v)\n    point in direction (direction)\n    change y by (50)\n    move (12) steps\n    show\n    if <<not <(direction) = [180]>> and <not <(Ammo) < [0]>>> then\n        repeat until <<touching (platform v)?> or <<<touching (_edge_ v)?> or <<touching (robot v)?> or <touching (mouse v)?>>> or <touching (final boss v)?>>>\n            move (12) steps\n        end\n    end\n    mouse\n    robot\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Weapon selected) = [1]> then\n    set rotation style [left-right v]\n    set size to (70) %\n    forever\n        switch costume to (bullet v)\n        repeat (4)\n            wait (.03) seconds\n            next costume\n        end\n        repeat (4)\n            wait (.03) seconds\n            switch costume to ((costume [number v]) - (1))\n        end\n    end\nend\nif <(Weapon selected) = [2]> then\n    switch costume to (purple v)\n    set size to (100) %\n    forever\n        forever\n            switch costume to (purple v)\n            change size by (3)\n            repeat (3)\n                wait (.03) seconds\n                change size by (3)\n                next costume\n            end\n            repeat (3)\n                wait (.03) seconds\n                change size by (3)\n                switch costume to ((costume [number v]) - (1))\n            end\n        end\n    end\nend\nif <(Weapon selected) = [3]> then\n    switch costume to (staple v)\n    set size to (70) %\nend\n\nwhen I receive [play game v]\nwait until <(Weapon picked up?) = [1]>\nforever\n    if <<(cutscene) = [0]> and <<(AIR) = [0]> and <<<key (f v) pressed?> and <(paused?) = [0]>> and <not <[space levels v] contains (level)?>>>>> then\n        create clone of (_myself_ v)\n        wait (.2) seconds\n        if <(Weapon selected) = [1]> then\n            wait (.3) seconds\n        end\n        if <(Weapon selected) = [2]> then\n            wait (1.5) seconds\n        end\n        if <(Weapon selected) = [3]> then\n            wait (0) seconds\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <(Ammo) < [0]> then\n    set [ammo v] to [0]\nend\n\nwhen I receive [game end v]\nhide\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nif <(Weapon selected) = [2]> then\n    wait (.05) seconds\n    change [ammo v] by (-1)\n    sound?\n    start sound [purple v]\n    go to ("player" v)\n    point in direction (direction)\n    change y by (63)\n    show\n    set [ghost v] effect to (70)\n    move (45) steps\n    repeat (35)\n        change [ghost v] effect by (-2)\n        move (.5) steps\n    end\n    if <<not <(direction) = [180]>> and <not <(Ammo) < [0]>>> then\n        repeat until <touching (_edge_ v)?>\n            move (12) steps\n        end\n        repeat (13)\n            move (12) steps\n        end\n    end\n    mouse\n    robot\n    delete this clone\nend\n\ndefine sound?\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [tick v]\nif <key (1 v) pressed?> then\n    if <[weapon unlocked? v] contains [1]?> then\n        set [weapon selected v] to [1]\n    end\nelse\n    if <key (2 v) pressed?> then\n        if <[weapon unlocked? v] contains [2]?> then\n            set [weapon selected v] to [2]\n        end\n    else\n        if <key (3 v) pressed?> then\n            if <[weapon unlocked? v] contains [3]?> then\n                set [weapon selected v] to [3]\n            end\n        end\n    end\nend\n\ndefine robot\nif <<(enemy active) = [robot]> and <<touching (robot v)?> and <not <<(Enemy Health) < [0]> or <(Enemy Health) = [0]>>>>> then\n    if <<(Enemy Health) < [0]> or <(Enemy Health) = [0]>> then\n        set [enemy health v] to [0]\n    else\n        set [color v] effect to (175)\n        if <(Weapon selected) = [1]> then\n            start sound [hurt v]\n            change [enemy health v] by (-15)\n        end\n        if <(Weapon selected) = [2]> then\n            start sound [purpled v]\n            set [enemy health v] to [0]\n        end\n        if <(Weapon selected) = [3]> then\n            start sound [hurt v]\n            change [enemy health v] by (-8)\n        end\n        set [color v] effect to (0)\n    end\nend\n\ndefine mouse\nif <<(enemy active) = [mouse]> and <<touching (mouse v)?> and <not <<(Enemy Health) < [0]> or <(Enemy Health) = [0]>>>>> then\n    if <not <<(Enemy Health) < [0]> or <(Enemy Health) = [0]>>> then\n        set [color v] effect to (175)\n        if <(Weapon selected) = [1]> then\n            start sound [hurt v]\n            change [enemy health v] by (-20)\n        end\n        if <(Weapon selected) = [2]> then\n            start sound [purpled v]\n            set [enemy health v] to [0]\n        end\n        if <(Weapon selected) = [3]> then\n            start sound [hurt v]\n            change [enemy health v] by (-10)\n        end\n        set [color v] effect to (0)\n    else\n        set [enemy health v] to [0]\n    end\nend\n\nwhen I receive [green flag v]\nset [enemy active v] to [0]\nset [ammo v] to [99999999999]\ngo to x: (0) y: (0)\nclear graphic effects\nswitch costume to (bullet v)\nset size to (70) %\nhide\n\n@Mouse\n\nwhen I receive [enemy start v]\nif <(level) = [3]> then\n    hide\n    go to x: (200) y: (-93)\n    set [enemy active v] to [0]\n    set [enemy health v] to [0]\n    switch costume to (normal v)\n    set size to (100) %\n    clear graphic effects\n    if <not <[seen cutscenes v] contains [mouse]?>> then\n        broadcast (cutscene 2 v) and wait\n    end\n    show\n    set [enemy active v] to [mouse]\n    1\n    set [enemy active v] to [0]\n    broadcast (enemy reset v)\nend\nif <(level) = [10]> then\n    hide\n    go to x: (200) y: (-93)\n    set [enemy active v] to [0]\n    set [enemy health v] to [0]\n    switch costume to (normal v)\n    set size to (100) %\n    clear graphic effects\n    show\n    set [enemy active v] to [mouse]\n    2\n    broadcast (mouse ded v)\n    set [enemy active v] to [0]\n    broadcast (enemy reset v)\nend\n\ndefine Lose Health\nif <not <<(Enemy Health) < [0]> or <(Enemy Health) = [0]>>> then\n    set [color v] effect to (175)\n    if <(Weapon selected) = [1]> then\n        start sound [hurt v]\n        change [enemy health v] by (-20)\n    end\n    if <(Weapon selected) = [2]> then\n        start sound [purpled v]\n        set [enemy health v] to [0]\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n    end\n    if <(Weapon selected) = [3]> then\n        start sound [hurt v]\n        change [enemy health v] by (-10)\n    end\n    set [color v] effect to (0)\nelse\n    set [enemy health v] to [0]\nend\n\ndefine mice ded\nswitch costume to (ded v)\nwait (.2) seconds\nhide\n\nwhen I receive [tick v]\nif <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(you lose?) = [1]>> then\n    hide\nelse\n    if <<(enemy active) = [mouse]> and <not <(level) = [23]>>> then\n        show\n    else\n        hide\n    end\nend\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [game end v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [replay v]\nif <(enemy active) = [mouse]> then\n    switch costume to (normal v)\n    set [enemy health v] to [80]\n    point in direction (-90)\n    go to x: (200) y: (-102)\nend\n\ndefine 1\npoint in direction (-90)\ngo to x: (200) y: (-102)\nset [mouse x limits v] to [200]\nset [mouse -x limits v] to [-200]\nset [enemy health v] to [80]\nswitch costume to (normal v)\nwait (1) seconds\nrepeat until <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) > [3]>>\n    wait until\n    if <(move?) = [1]> then\n        wait until\n        if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [3]>>> then\n            wait until\n            repeat until <<(x position) = [-199]> or <(x position) < [-199]>>\n                wait until\n                point in direction (-90)\n                change x by (-3)\n                wait until\n            end\n            wait until\n            if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [3]>>> then\n                wait until\n                if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [3]>>> then\n                    wait until\n                    repeat until <<(x position) = [199]> or <(x position) > [199]>>\n                        wait until\n                        point in direction (90)\n                        change x by (3)\n                        wait until\n                    end\n                    wait until\n                end\n                wait until\n            end\n            wait until\n        end\n        wait until\n    end\n    wait until\nend\n\nwhen I receive [enemy start v]\nforever\n    if <<(ai touching player?) = [1]> and <(enemy active) = [mouse]>> then\n        switch costume to (agro v)\n        if <<(x position) > (mouse -X limits)> and <(x position) < (mouse X limits)>> then\n            point towards ("player" v)\n            if <(join (letter (1) of (direction)) [1]) = [-1]> then\n                point in direction (-90)\n            else\n                point in direction (90)\n            end\n            move (5) steps\n            if <touching (hitbox v)?> then\n                repeat (4)\n                    move (5) steps\n                end\n                wait (.5) seconds\n            end\n        end\n    else\n        if <<(enemy active) = [mouse]> and <<touching (bullets v)?> and <not <<(Enemy Health) < [0]> or <(Enemy Health) = [0]>>>>> then\n            switch costume to (hurt v)\n            start sound [hurt v]\n            if <(Weapon selected) = [2]> then\n                start sound [purpled v]\n                repeat (10)\n                    change [ghost v] effect by (10)\n                end\n                set [enemy health v] to [0]\n            end\n        else\n            switch costume to (normal v)\n        end\n    end\nend\n\ndefine wait until\nwait until <<not <(ai touching player?) = [1]>> and <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [3]>>>>\n\nwhen I receive [enemy reset v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\nhide\n\ndefine 2\npoint in direction (-90)\ngo to x: (200) y: (-102)\nset [mouse x limits v] to [200]\nset [mouse -x limits v] to [-200]\nset [enemy health v] to [80]\nswitch costume to (normal v)\nrepeat until <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) > [10]>>\n    wait until 2\n    if <(move?) = [1]> then\n        wait until 2\n        if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [10]>>> then\n            wait until 2\n            repeat until <<(x position) = [-199]> or <(x position) < [-199]>>\n                wait until 2\n                point in direction (-90)\n                change x by (-3)\n                wait until 2\n            end\n            wait until 2\n            if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [10]>>> then\n                wait until 2\n                if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [10]>>> then\n                    wait until 2\n                    repeat until <<(x position) = [199]> or <(x position) > [199]>>\n                        wait until 2\n                        point in direction (90)\n                        change x by (3)\n                        wait until 2\n                    end\n                    wait until 2\n                end\n                wait until 2\n            end\n            wait until 2\n        end\n        wait until 2\n    end\n    wait until 2\nend\n\ndefine wait until 2\nwait until <<not <(ai touching player?) = [1]>> and <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [10]>>>>\n\nwhen I receive [tick v]\nif <not <<<[robotlv v] contains (level)?> or <[mouselv v] contains (level)?>> or <(level) = [22]>>> then\n    set [enemy active v] to [0]\nend\n\nwhen I receive [enemy start v]\nwait until <<(enemy active) = [mouse]> and <not <(level) = [23]>>>\nset [ghost v] effect to (100)\nset [ghost v] to [100]\nwait (.5) seconds\nrepeat until <<(ghost) = [0]> or <(ghost) < [0]>>\n    change [ghost v] effect by (-5)\n    change [ghost v] by (-5)\nend\n\nwhen I receive [enemy start v]\nwait until <<(move?) = [1]> and <(cutscene) = [0]>>\nwait (2) seconds\nwait until <<(Enemy Health) < [0]> or <(Enemy Health) = [0]>>\nif <[mouselv v] contains (level)?> then\n    broadcast (mouse ded v)\nend\nif <[robotlv v] contains (level)?> then\n    broadcast (robot ded v)\nend\n\nwhen I receive [green flag v]\nbroadcast (enemy reset v)\ngo to x: (200) y: (-93)\nclear graphic effects\ngo to [front v] layer\nhide\n\n@Robot\n\nwhen I receive [play game v]\nhide\nset [enemy health v] to [0]\nset [enemy active v] to [0]\nswitch costume to (normal v)\nset size to (140) %\nclear graphic effects\nbroadcast (enemy reset v)\n\ndefine Lose Health\nif <<(Enemy Health) < [0]> or <(Enemy Health) = [0]>> then\n    set [enemy health v] to [0]\nelse\n    set [color v] effect to (175)\n    if <(Weapon selected) = [1]> then\n        start sound [hurt v]\n        change [enemy health v] by (-15)\n    end\n    if <(Weapon selected) = [2]> then\n        start sound [purpled v]\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [enemy health v] to [0]\n    end\n    if <(Weapon selected) = [3]> then\n        start sound [hurt v]\n        change [enemy health v] by (-12)\n    end\n    set [color v] effect to (0)\nend\n\ndefine robo ded\nswitch costume to (robot ded v)\nwait (.2) seconds\nhide\nclear graphic effects\n\nwhen I receive [tick v]\nif <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(you lose?) = [1]>> then\n    hide\nelse\n    if <<(enemy active) = [robot]> and <not <(level) = [23]>>> then\n        show\n    else\n        hide\n    end\nend\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [game end v]\nhide\nstop [other scripts in sprite v]\n\ndefine 1\ngo to x: (230) y: (-122)\nset [robot x limits v] to [230]\nset [robot -x limits v] to [-230]\nset [enemy health v] to [80]\nswitch costume to (normal v)\nshow\nwait (1) seconds\nrepeat until <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) > [7]>>\n    (LEVEL 7) wait until\n    if <(move?) = [1]> then\n        (LEVEL 7) wait until\n        if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [7]>>> then\n            (LEVEL 7) wait until\n            repeat until <<(x position) = [-230]> or <(x position) < [-230]>>\n                (LEVEL 7) wait until\n                point in direction (-90)\n                change x by (-3)\n                (LEVEL 7) wait until\n            end\n            (LEVEL 7) wait until\n            if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [7]>>> then\n                (LEVEL 7) wait until\n                if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [7]>>> then\n                    (LEVEL 7) wait until\n                    repeat until <<(x position) = [230]> or <(x position) > [230]>>\n                        (LEVEL 7) wait until\n                        point in direction (90)\n                        change x by (3)\n                        (LEVEL 7) wait until\n                    end\n                    (LEVEL 7) wait until\n                end\n                (LEVEL 7) wait until\n            end\n            (LEVEL 7) wait until\n        end\n        (LEVEL 7) wait until\n    end\n    (LEVEL 7) wait until\nend\n\ndefine 2\nset [enemy health v] to [80]\nclear graphic effects\nswitch costume to (normal v)\nwait (1) seconds\nrepeat until <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) > [8]>>\n    (LEVEL 8) wait until\n    if <(move?) = [1]> then\n        (LEVEL 8) wait until\n        if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [8]>>> then\n            (LEVEL 8) wait until\n            point in direction (-90)\n            go to x: (230) y: (15)\n            (LEVEL 8) wait until\n            repeat (50)\n                (LEVEL 8) wait until\n                if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [8]>>> then\n                    change x by (-2)\n                    (LEVEL 8) wait until\n                end\n                (LEVEL 8) wait until\n            end\n            (LEVEL 8) wait until\n            if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [8]>>> then\n                (LEVEL 8) wait until\n                wait (.5) seconds\n                (LEVEL 8) wait until\n                if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [8]>>> then\n                    (LEVEL 8) wait until\n                    point in direction (90)\n                    go to x: (130) y: (15)\n                    (LEVEL 8) wait until\n                    repeat (50)\n                        (LEVEL 8) wait until\n                        if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [8]>>> then\n                            change x by (2)\n                            (LEVEL 8) wait until\n                        end\n                        (LEVEL 8) wait until\n                    end\n                    (LEVEL 8) wait until\n                    if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [8]>>> then\n                        (LEVEL 8) wait until\n                        wait (.5) seconds\n                        (LEVEL 8) wait until\n                    end\n                    (LEVEL 8) wait until\n                end\n                (LEVEL 8) wait until\n            end\n            (LEVEL 8) wait until\n        end\n        (LEVEL 8) wait until\n    end\n    (LEVEL 8) wait until\nend\n\ndefine 3\ngo to x: (210) y: (-110)\nclear graphic effects\nset [robot x limits v] to [205]\nset [robot -x limits v] to [-50]\nset [enemy health v] to [80]\nswitch costume to (normal v)\nwait (1) seconds\nrepeat until <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) > [9]>>\n    (LEVEL 9) wait until\n    if <(move?) = [1]> then\n        (LEVEL 9) wait until\n        if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [9]>>> then\n            (LEVEL 9) wait until\n            repeat until <<(x position) = [-50]> or <(x position) < [-50]>>\n                (LEVEL 9) wait until\n                point in direction (-90)\n                change x by (-3)\n                (LEVEL 9) wait until\n            end\n            (LEVEL 9) wait until\n            if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [9]>>> then\n                (LEVEL 9) wait until\n                if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [9]>>> then\n                    (LEVEL 9) wait until\n                    repeat until <<(x position) = [205]> or <(x position) > [205]>>\n                        (LEVEL 9) wait until\n                        point in direction (90)\n                        change x by (3)\n                        (LEVEL 9) wait until\n                    end\n                    (LEVEL 9) wait until\n                end\n                (LEVEL 9) wait until\n            end\n            (LEVEL 9) wait until\n        end\n        (LEVEL 9) wait until\n    end\n    (LEVEL 9) wait until\nend\n\ndefine 4\nset [enemy health v] to [80]\nswitch costume to (normal v)\nwait (1) seconds\nrepeat until <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) > [14]>>\n    (LEVEL 14) wait until\n    if <(move?) = [1]> then\n        (LEVEL 14) wait until\n        if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [14]>>> then\n            (LEVEL 14) wait until\n            point in direction (-90)\n            go to x: (40) y: (-124)\n            (LEVEL 14) wait until\n            repeat (60)\n                (LEVEL 14) wait until\n                if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [14]>>> then\n                    (LEVEL 14) wait until\n                    change x by (-2)\n                end\n                (LEVEL 14) wait until\n            end\n            (LEVEL 14) wait until\n            if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [14]>>> then\n                (LEVEL 14) wait until\n                if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [14]>>> then\n                    (LEVEL 14) wait until\n                    point in direction (90)\n                    go to x: (-80) y: (-124)\n                    (LEVEL 14) wait until\n                    repeat (60)\n                        (LEVEL 14) wait until\n                        if <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [14]>>> then\n                            (LEVEL 14) wait until\n                            change x by (2)\n                        end\n                    end\n                    (LEVEL 14) wait until\n                end\n                (LEVEL 14) wait until\n            end\n            (LEVEL 14) wait until\n        end\n        (LEVEL 14) wait until\n    end\n    (LEVEL 14) wait until\nend\n\nwhen I receive [replay v]\nif <(enemy active) = [robot]> then\n    switch costume to (normal v)\n    set [enemy health v] to [80]\n    point in direction (-90)\n    go to x: (Robot X limits) y: ()\nend\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nhide\ngo to x: (200) y: (-93)\nset [enemy active v] to [0]\nset [enemy health v] to [0]\nswitch costume to (mouse/mice v)\nset size to (100) %\nclear graphic effects\n\nwhen I receive [enemy start v]\nforever\n    if <<<(ai touching player?) = [1]> and <(enemy active) = [robot]>> and <<not <(level) = [8]>> and <not <(level) = [14]>>>> then\n        switch costume to (agro v)\n        if <<(x position) > (Robot -X limits)> and <(x position) < (Robot X limits)>> then\n            point towards ("player" v)\n            if <(join (letter (1) of (direction)) [1]) = [-1]> then\n                point in direction (-90)\n            else\n                point in direction (90)\n            end\n            move (5) steps\n            if <touching (hitbox v)?> then\n                repeat (4)\n                    move (5) steps\n                end\n                wait (.5) seconds\n            end\n        end\n    else\n        if <<(enemy active) = [robot]> and <<touching (bullets v)?> and <not <<(Enemy Health) < [0]> or <(Enemy Health) = [0]>>>>> then\n            switch costume to (hurt v)\n            start sound [hurt v]\n            if <(Weapon selected) = [2]> then\n                start sound [purpled v]\n                repeat (10)\n                    change [ghost v] effect by (10)\n                end\n                set [enemy health v] to [0]\n            end\n        else\n            switch costume to (normal v)\n        end\n    end\nend\n\ndefine (LEVEL 7) wait until\nwait until <<not <(ai touching player?) = [1]>> and <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [7]>>>>\nset y to (-122)\n\ndefine (LEVEL 9) wait until\nwait until <<not <(ai touching player?) = [1]>> and <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [9]>>>>\nset y to (-110)\n\nwhen I receive [enemy start v]\nif <(level) = [7]> then\n    set [enemy health v] to [80]\n    switch costume to (normal v)\n    set size to (140) %\n    go to x: (230) y: (-122)\n    clear graphic effects\n    if <not <[seen cutscenes v] contains [robot]?>> then\n        broadcast (cutscene 4 v) and wait\n    end\n    set [enemy active v] to [robot]\n    1\n    set [enemy active v] to [0]\nend\nif <(level) = [8]> then\n    set [enemy health v] to [80]\n    go to x: (230) y: (15)\n    switch costume to (normal v)\n    set size to (140) %\n    clear graphic effects\n    show\n    set [enemy active v] to [robot]\n    2\n    set [enemy active v] to [0]\nend\nif <(level) = [9]> then\n    set [enemy health v] to [80]\n    switch costume to (normal v)\n    set size to (140) %\n    clear graphic effects\n    go to x: (205) y: (-110)\n    show\n    go to x: (205) y: (-110)\n    set [enemy active v] to [robot]\n    3\n    set [enemy active v] to [0]\nend\nif <(level) = [14]> then\n    set [enemy health v] to [80]\n    switch costume to (normal v)\n    set size to (140) %\n    clear graphic effects\n    go to x: (40) y: (-124)\n    show\n    set [enemy active v] to [robot]\n    4\n    set [enemy active v] to [0]\nend\n\nwhen I receive [enemy reset v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\nhide\n\ndefine (LEVEL 14) wait until\nwait until <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [14]>>>\nset y to (-124)\n\ndefine (LEVEL 8) wait until\nwait until <<(move?) = [1]> and <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> or <(level) = [8]>>>\nset y to (15)\n\nwhen I receive [enemy start v]\nwait until <<(enemy active) = [robot]> and <not <(level) = [23]>>>\nset [ghost v] effect to (100)\nset [ghost v] to [100]\nwait (1) seconds\nrepeat until <<(ghost) = [0]> or <(ghost) < [0]>>\n    change [ghost v] effect by (-5)\n    change [ghost v] by (-5)\nend\n\nwhen I receive [green flag v]\ngo to x: (200) y: (-93)\nclear graphic effects\ngo to [front v] layer\nhide\n\n@Ai radius\n\nwhen I receive [tick v]\nif <(enemy active) = [mouse]> then\n    go to (mouse v)\nend\nif <(enemy active) = [robot]> then\n    go to (robot v)\nend\n\nwhen I receive [play game v]\nshow\nforever\n    if <<(enemy active) = [mouse]> or <(enemy active) = [robot]>> then\n        if <touching (hitbox v)?> then\n            set [ai touching player? v] to [1]\n            wait (1) seconds\n        else\n            set [ai touching player? v] to [0]\n        end\n    else\n        set [ai touching player? v] to [0]\n    end\nend\n\nwhen I receive [green flag v]\nset [mouse argo v] to [0]\nset [ghost v] effect to (100)\npoint in direction (90)\nhide\n\n@enemyhealthbar\n\ndefine Health Bar\nif <(level) = [22]> then\n    switch costume to ((81) - (Boss health))\nelse\n    switch costume to ((81) - (Enemy Health))\nend\n\nwhen I receive [tick v]\nHealth Bar\nif <(enemy active) = [mouse]> then\n    go to (mouse v)\n    change y by (50)\nend\nif <(enemy active) = [robot]> then\n    go to (robot v)\n    change y by (95)\nend\nif <(level) = [22]> then\n    go to (final boss v)\n    change y by (130)\nend\nif <<<(Enemy Health) = [0]> or <(Enemy Health) < [0]>> and <not <(level) = [22]>>> then\n    hide\nelse\n    if <<(enemy active) = [mouse]> or <<(enemy active) = [robot]> or <(level) = [22]>>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [replay space v]\nif <[mouse levels v] contains (level)?> then\n    set [enemy active v] to [mouse]\nelse\n    if <[robot levels v] contains (level)?> then\n        set [enemy active v] to [robot]\n    else\n        set [enemy active v] to [0]\n    end\nend\n\nwhen I receive [replay v]\nif <[mouse levels v] contains (level)?> then\n    set [enemy active v] to [mouse]\nelse\n    if <[robot levels v] contains (level)?> then\n        set [enemy active v] to [robot]\n    else\n        set [enemy active v] to [0]\n    end\nend\n\nwhen I receive [enemy start v]\nwait until <<(enemy active) = [robot]> or <<(enemy active) = [mouse]> or <(level) = [22]>>>\nset [ghost v] effect to (100)\nset [ghost v] to [100]\nwait (1) seconds\nrepeat until <<(ghost) = [0]> or <(ghost) < [0]>>\n    change [ghost v] effect by (-5)\n    change [ghost v] by (-5)\nend\n\nwhen I receive [enemy reset v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [green flag v]\nhide\ngo to x: (0) y: (0)\nset size to (100) %\nswitch costume to (costume80 v)\nset [enemy health v] to [80]\n\n@Enemy ded\n\nwhen flag clicked\nhide\n\nwhen I receive [mouse ded v]\nset size to (100) %\nclear graphic effects\nswitch costume to (mouse v)\ngo to (mouse v)\nshow\nwait (.4) seconds\nrepeat (25)\n    change [pixelate v] effect by (4)\n    change [ghost v] effect by (4)\nend\nhide\nclear graphic effects\n\nwhen I receive [robot ded v]\nset size to (140) %\nclear graphic effects\nswitch costume to (robot v)\ngo to (robot v)\nshow\nwait (.4) seconds\nrepeat (25)\n    change [pixelate v] effect by (4)\n    change [ghost v] effect by (4)\nend\nhide\nclear graphic effects\n\nwhen I receive [instant scroll effect x v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [scroll effect x v]\nstop [other scripts in sprite v]\nhide\n\n@Final Boss\n\ndefine Lose Health\nif <not <<(Boss health) < [1]> or <(Boss health) = [1]>>> then\n    start sound (pick random (1) to (3))\n    if <(Weapon selected) = [1]> then\n        start sound [hurt2 v]\n        change [boss health v] by (-5)\n    end\n    if <(Weapon selected) = [2]> then\n        start sound [hurt2 v]\n        change [boss health v] by (-20)\n        wait (2) seconds\n    end\n    if <(Weapon selected) = [3]> then\n        start sound [hurt2 v]\n        change [boss health v] by (-3)\n    end\nelse\n    set [boss health v] to [1]\nend\n\nwhen I receive [play game v]\nset [boss alive? v] to [0]\nforever\n    if <<touching (bullets v)?> and <not <<(Boss health) < [1]> or <(Boss health) = [1]>>>> then\n        Lose Health\n    end\nend\n\nwhen I receive [play game v]\nwait until <(level) = [22]>\nset [boss health v] to [80]\nswitch costume to (still v)\nset size to (120) %\nclear graphic effects\ngo to x: (180) y: (-122)\nshow\nset [enemy active v] to [1]\nset [boss alive? v] to [1]\nwait until <(move?) = [1]>\nwait until <<<(Boss health) = [1]> or <(Boss health) < [1]>> or <not <(level) = [22]>>>\nset [boss health v] to [1]\nset [boss alive? v] to [0]\nswitch costume to (downed v)\nbroadcast (Boss Lose v) and wait\nset [enemy active v] to [0]\nwait until <(level) > [22]>\nstop [other scripts in sprite v]\nhide\nset [enemy active v] to [0]\nset [boss health v] to [0]\n\nwhen I receive [oof v]\nswitch costume to (still v)\nif <(boss alive?) = [1]> then\n    set [boss health v] to [80]\nend\n\nwhen I receive [tick v]\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [green flag v]\nset [boss health v] to [80]\nset [boss alive? v] to [0]\nswitch costume to (still v)\nset size to (120) %\nclear graphic effects\ngo to x: (180) y: (-122)\nhide\n\n@BOSS attacks\n\ndefine attack dagger\nif <(move?) = [1]> then\n    set [id v] to [1]\n    create clone of (_myself_ v)\nend\n\nwhen I receive [boss attacks v]\nforever\n    if <<(level) = [22]> and <(move?) = [1]>> then\n        wait (1.5) seconds\n        attack spikes\n        wait (1.5) seconds\n    end\nend\n\nwhen I start as a clone\nif <(ID) = [1]> then\n    set [ghost v] effect to (100)\n    set size to (100) %\n    go to x: (200) y: (60)\n    switch costume to (attack 2 v)\n    show\n    repeat (50)\n        change y by (((120) - (y position)) / (7))\n        turn left (15) degrees\n        change [ghost v] effect by (-2)\n    end\n    repeat (40)\n        point towards ("player" v)\n    end\n    repeat until <touching (_edge_ v)?>\n        move (10) steps\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\ndefine attack spikes\nif <(move?) = [1]> then\n    set [id v] to [2]\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(ID) = [2]> then\n    set [ghost v] effect to (100)\n    set size to (100) %\n    go to x: (pick random (-200) to (200)) y: (-121)\n    point in direction (90)\n    switch costume to (attack 1 v)\n    show\n    repeat (50)\n        change [ghost v] effect by (-2)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\nwhen I receive [boss attacks v]\nforever\n    if <<(level) = [22]> and <(move?) = [1]>> then\n        wait (1.5) seconds\n        attack dagger\n        wait (.5) seconds\n    end\nend\n\nwhen I receive [boss lose v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [ingame pause menu quit v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [tick v]\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [oof v]\ndelete this clone\n\nwhen I receive [space oof v]\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\n@platform\n\nwhen I receive [play game v]\nchange [ghost v] effect by (100)\nset [level v] to [1]\nshow\n\nwhen flag clicked\nswitch costume to (1 1 v)\nchange [ghost v] effect by (100)\nset [level v] to [1]\nhide\n\nwhen I receive [game end v]\nhide\nswitch costume to (1 1 v)\nstop [other scripts in sprite v]\nset [level v] to [1]\n\nwhen I receive [ingame pause menu quit v]\nhide\nswitch costume to (1 1 v)\nstop [other scripts in sprite v]\nset [level v] to [1]\n\nwhen I receive [tick v]\nswitch costume to (level)\n\nwhen I receive [green flag v]\nhide\nswitch costume to (1 1 v)\n\n@deco\n\nwhen I receive [play game v]\nclear graphic effects\ngo to x: (0) y: (0)\nshow\n\ndefine scroll effect X\nset [move? v] to [0]\ncreate clone of (_myself_ v)\nswitch costume to (level)\ngo to x: (0) y: (0)\nrepeat (60)\n    switch costume to (empty v)\n    change x by (((-480) - (x position)) / (12))\n    switch costume to (level)\nend\ngo to x: (0) y: (0)\nswitch costume to ((level) + (1))\nset [move? v] to [1]\n\nwhen I start as a clone\nhide\nswitch costume to (empty v)\ngo to x: (480) y: (0)\nswitch costume to ((level) + (1))\nshow\nrepeat (60)\n    change x by (((0) - (x position)) / (12))\nend\ndelete this clone\n\nwhen I receive [scroll effect x v]\nscroll effect X\n\nwhen I receive [game end v]\nhide\nswitch costume to (1 1 v)\nstop [other scripts in sprite v]\nswitch backdrop to (black v)\n\nwhen I receive [ingame pause menu quit v]\nhide\nswitch costume to (1 1 v)\nstop [other scripts in sprite v]\nswitch backdrop to (black v)\n\nwhen I receive [instant scroll effect x v]\nset [move? v] to [0]\nswitch costume to ((level) + (1))\ngo to x: (0) y: (0)\nbroadcast (player spawn reset v)\nset [move? v] to [1]\n\nwhen I receive [green flag v]\nswitch costume to (1 1 v)\nhide\n\n@BG\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nswitch costume to (1 1 v)\nhide\n\nwhen flag clicked\nswitch costume to (1 1 v)\nhide\n\nwhen I receive [play game v]\nshow\nclear graphic effects\nset size to (100) %\nset [brightness v] effect to (-10)\ngo to x: (0) y: (0)\n\nswitch costume to ((level) + (1))\n\ndefine scroll effect X\nset [move? v] to [0]\ncreate clone of (_myself_ v)\nswitch costume to (level)\ngo to x: (0) y: (0)\nrepeat (60)\n    switch costume to (empty v)\n    change x by (((-480) - (x position)) / (12))\n    switch costume to (level)\nend\ngo to x: (0) y: (0)\nswitch costume to ((level) + (1))\nset [move? v] to [1]\n\nwhen I start as a clone\nhide\nswitch costume to (empty v)\ngo to x: (480) y: (0)\nswitch costume to ((level) + (1))\nshow\nrepeat (60)\n    change x by (((0) - (x position)) / (12))\nend\ndelete this clone\n\nwhen I receive [scroll effect x v]\nscroll effect X\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nswitch costume to (1 1 v)\nhide\n\nwhen I receive [tick v]\ngo to [back v] layer\n\nwhen I receive [instant scroll effect x v]\nset [move? v] to [0]\nswitch costume to ((level) + (1))\ngo to x: (0) y: (0)\nset [move? v] to [1]\n\n@level transition\n\nwhen I receive [play game v]\nwait (2) seconds\nswitch costume to (empty v)\ngo to x: (420) y: (0)\ngo to [front v] layer\nshow\nrepeat (65)\n    switch costume to (empty v)\n    change x by (((0) - (x position)) / (7))\n    switch costume to (level1 v)\nend\nrepeat (65)\n    switch costume to (empty v)\n    change x by (((-420) - (x position)) / (7))\n    switch costume to (level1 v)\nend\nhide\n\nwhen I receive [lv2 screenmove v]\nwait (2) seconds\nswitch costume to (empty v)\ngo to x: (420) y: (0)\ngo to [front v] layer\nshow\nrepeat (65)\n    switch costume to (empty v)\n    change x by (((0) - (x position)) / (7))\n    switch costume to (level2 v)\nend\nrepeat (65)\n    switch costume to (empty v)\n    change x by (((-420) - (x position)) / (7))\n    switch costume to (level2 v)\nend\nhide\n\nwhen I receive [lv3 screenmove v]\nwait (2) seconds\nswitch costume to (empty v)\ngo to x: (420) y: (0)\ngo to [front v] layer\nshow\nrepeat (65)\n    switch costume to (empty v)\n    change x by (((0) - (x position)) / (7))\n    switch costume to (level3 v)\nend\nrepeat (65)\n    switch costume to (empty v)\n    change x by (((-420) - (x position)) / (7))\n    switch costume to (level3 v)\nend\nhide\n\nwhen I receive [green flag v]\nhide\n\n@interactable\n\nwhen I receive [play game v]\nshow\n\nwhen I receive [game end v]\nswitch costume to (1 1 v)\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [play game v]\nshow\nif <(level) = [1]> then\n    show\n    switch costume to (1 1 v)\n    go to x: (0) y: (0)\n    repeat until <not <(level) = [1]>>\n        if <touching ("player" v)?> then\n            think [Use ARROW keys or WASD to move around!]\n        else\n            think []\n        end\n    end\nend\nif <(level) = [2]> then\n    show\n    switch costume to (1 2 v)\n    go to x: (0) y: (0)\n    wait (.5) seconds\n    wait until <touching ("player" v)?>\n    wait (.2) seconds\n    hide\n    broadcast (cutscene 1 v) and wait\n    set [weapon picked up? v] to [1]\n    stop [this script v]\nend\n\ndefine scroll effect X\nset [move? v] to [0]\ncreate clone of (_myself_ v)\nswitch costume to (level)\ngo to x: (0) y: (0)\nrepeat (60)\n    switch costume to (empty v)\n    change x by (((-480) - (x position)) / (12))\n    switch costume to (level)\nend\ngo to x: (0) y: (0)\nswitch costume to ((level) + (1))\nset [move? v] to [1]\n\nwhen I start as a clone\nhide\nswitch costume to (empty v)\ngo to x: (480) y: (0)\nswitch costume to ((level) + (1))\nshow\nrepeat (60)\n    change x by (((0) - (x position)) / (12))\nend\ndelete this clone\n\nwhen I receive [scroll effect x v]\nscroll effect X\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nswitch costume to (1 1 v)\nhide\ndelete this clone\n\nwhen I receive [pause reset v]\nstop [other scripts in sprite v]\nswitch costume to (1 1 v)\nhide\nif <(level) = [1]> then\n    show\n    switch costume to (1 1 v)\n    go to x: (0) y: (0)\n    repeat until <not <(level) = [1]>>\n        if <touching ("player" v)?> then\n            think [Use ARROW keys or WASD to move around!]\n        else\n            think []\n        end\n    end\nend\nif <(level) = [2]> then\n    show\n    switch costume to (1 2 v)\n    go to x: (0) y: (0)\n    wait (.5) seconds\n    wait until <touching ("player" v)?>\n    wait (.2) seconds\n    hide\n    broadcast (cutscene 1 v) and wait\n    set [weapon picked up? v] to [1]\n    stop [this script v]\nend\n\nwhen I receive [pause reset v]\ndelete this clone\n\nwhen I receive [green flag v]\nswitch costume to (1 1 v)\nhide\n\n@oof\n\nwhen I receive [tick v]\nswitch costume to (level)\nshow\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [green flag v]\nhide\nswitch costume to (1 v)\nclear graphic effects\nset [ghost v] effect to (100)\n\n@cutscene 1-4\n\nwhen I receive [cutscene 1 v]\nadd [1] to [weapon unlocked? v]\nset [weapon selected v] to [1]\nif <(admin) = [1]> then\n    stop [other scripts in sprite v]\n    set [move? v] to [1]\n    set [cutscene v] to [0]\n    hide\n    stop [this script v]\nend\ngo to [front v] layer\nset [move? v] to [0]\nset [cutscene v] to [1]\nbroadcast (transition v)\nswitch costume to (1 v)\nset size to (300) %\ngo to x: (-47) y: (-107)\nshow\nwait (2) seconds\nrepeat (3)\n    wait (.03) seconds\n    next costume\nend\nwait (2) seconds\nbroadcast (long transistion v)\nwait (1) seconds\nset size to (100) %\ngo to x: (0) y: (0)\nforever\n    switch costume to (weapon info v)\n    wait (1) seconds\n    switch costume to (weapon info2 v)\n    wait (1) seconds\nend\n\nwhen I receive [cutscene 1 v]\nwait (6) seconds\nwait until <key (any v) pressed?>\nbroadcast (long transistion v)\nwait (1) seconds\nstop [other scripts in sprite v]\nset [move? v] to [1]\nset [cutscene v] to [0]\nhide\n\nwhen I receive [cutscene 2 v]\nif <(admin) = [1]> then\n    stop [other scripts in sprite v]\n    add [mouse] to [seen cutscenes v]\n    set [move? v] to [1]\n    set [cutscene v] to [0]\n    hide\n    stop [this script v]\nend\ngo to [front v] layer\nset [move? v] to [0]\nset [cutscene v] to [1]\nbroadcast (transition v)\nset size to (100) %\ngo to x: (0) y: (0)\nshow\nwait (2) seconds\nwait until <key (any v) pressed?>\nbroadcast (long transistion v)\nwait (1) seconds\nstop [other scripts in sprite v]\nadd [mouse] to [seen cutscenes v]\nset [cutscene v] to [0]\nset [move? v] to [1]\nhide\n\nwhen I receive [cutscene 2 v]\nforever\n    switch costume to (enemy info v)\n    wait (1) seconds\n    switch costume to (enemy info2 v)\n    wait (1) seconds\nend\n\nwhen I receive [cutscene 3 \(lv 1 finished\) v]\nif <(admin) = [1]> then\n    stop [other scripts in sprite v]\n    set [move? v] to [1]\n    set [cutscene v] to [0]\n    broadcast (transition v)\n    hide\n    set [level v] to [5]\n    broadcast (scroll effect X v)\n    broadcast (next level v)\n    stop [this script v]\nend\nset [move? v] to [0]\nset [cutscene v] to [1]\nbroadcast (transition v)\ngo to [front v] layer\nset size to (100) %\ngo to x: (0) y: (0)\nswitch costume to (\(cut 3\) 1 v)\nshow\nwait (3) seconds\nrepeat (4)\n    next costume\n    wait (.03) seconds\nend\nwait (.6) seconds\nrepeat (4)\n    next costume\n    wait (.03) seconds\nend\nstart sound [elevator sound v]\nwait (.4) seconds\nrepeat (4)\n    switch costume to ((costume [number v]) - (1))\n    wait (.03) seconds\nend\nwait (2) seconds\nset [move? v] to [1]\nset [cutscene v] to [0]\nbroadcast (long transistion v)\nwait (1) seconds\nhide\nset [level v] to [5]\nbroadcast (instant scroll effect x v)\n\nwhen I receive [cutscene 4 v]\nif <(admin) = [1]> then\n    stop [other scripts in sprite v]\n    add [robot] to [seen cutscenes v]\n    set [move? v] to [1]\n    set [cutscene v] to [0]\n    hide\n    stop [this script v]\nend\nbroadcast (transition v)\nset [move? v] to [0]\nset [cutscene v] to [1]\ngo to [front v] layer\nset size to (100) %\ngo to x: (0) y: (0)\nshow\nwait (2) seconds\nwait until <key (any v) pressed?>\nbroadcast (long transistion v)\nwait (1) seconds\nstop [other scripts in sprite v]\nadd [robot] to [seen cutscenes v]\nset [cutscene v] to [0]\nset [move? v] to [1]\nhide\n\nwhen I receive [cutscene 4 v]\nforever\n    switch costume to (enemy info 2 v)\n    wait (1) seconds\n    switch costume to (enemy info 2 \( v)\n    wait (1) seconds\nend\n\nwhen I receive [cutscene 3 \(lv 1 finished\) v]\n\nwhen I receive [boss info v]\nif <(level) = [22]> then\n    if <(admin) = [1]> then\n        stop [other scripts in sprite v]\n        broadcast (transition v)\n        wait (1.2) seconds\n        set [move? v] to [1]\n        set [cutscene v] to [0]\n        broadcast (Boss attacks v)\n        stop [this script v]\n    end\n    broadcast (transition v)\n    reset\n    set [move? v] to [0]\n    set [cutscene v] to [1]\n    wait (1.3) seconds\n    show\n    wait (1) seconds\n    wait until <key (any v) pressed?>\n    broadcast (long transistion v)\n    wait (1.2) seconds\n    stop [other scripts in sprite v]\n    set [move? v] to [1]\n    set [cutscene v] to [0]\n    broadcast (Boss attacks v)\n    hide\nend\n\nwhen I receive [boss info v]\nif <(level) = [22]> then\n    forever\n        switch costume to (boss info5 v)\n        wait (1) seconds\n        switch costume to (boss info2 v)\n        wait (1) seconds\n    end\nend\n\ndefine reset\nswitch costume to (enemy info 2 v)\ngo to [front v] layer\nset size to (100) %\ngo to x: (0) y: (0)\n\nwait (1) seconds\nwait until <key (any v) pressed?>\nset [move? v] to [1]\nbroadcast (transition v)\nhide\nset [level v] to [5]\nbroadcast (scroll effect X v)\nbroadcast (next level v)\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\nbroadcast (next level v)\n\nwhen I receive [green flag v]\nhide\nswitch costume to (1 v)\nset size to (300) %\ngo to x: (-47) y: (-107)\ndelete all of [seen cutscenes v]\n\n@Game End\n\nwhen I receive [game end v]\nset [cutscene v] to [1]\nset [level v] to [1]\nhide variable [health v]\nhide variable [score v]\nwait (1.3) seconds\ngo to x: (0) y: (0)\nclear graphic effects\ngo to [front v] layer\nswitch costume to (costume1 v)\nshow\nwait (2) seconds\nswitch costume to (costume1 v)\nwait (.3) seconds\nswitch costume to (costume2 v)\nwait (.2) seconds\nswitch costume to (costume3 v)\nwait (2) seconds\nswitch costume to (1 v)\nwait (1) seconds\nrepeat (26)\n    start sound (pick random (1) to (4))\n    next costume\n    wait (pick random (.09) to (.15)) seconds\nend\nwait (2) seconds\nstart sound [type finished v]\nwait (1) seconds\nset [score v] to (((Score) * (3)) + (20))\nshow variable [score v]\nswitch costume to (win screen v)\nbroadcast (you win screen cycle v)\nwait (1) seconds\nwait until <key (any v) pressed?>\nhide variable [score v]\nset [score v] to [0]\nstop [other scripts in sprite v]\nbroadcast (transition v)\nhide\nbroadcast (menu v)\n\nwhen I receive [you win screen cycle v]\nforever\n    switch costume to (win screen v)\n    wait (1) seconds\n    switch costume to (win screen2 v)\n    wait (1) seconds\nend\n\nwhen I receive [tick v]\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [play game v]\nhide variable [score v]\n\nwhen I receive [green flag v]\nset [cutscene v] to [0]\ngo to x: (0) y: (0)\nhide\n\n@pause menu\n\nwhen I receive [pause loader v]\ngo to x: (0) y: (0)\nswitch costume to (cog v)\nshow\nwait until <<key (p v) pressed?> and <not <(cutscene) = [1]>>>\nbroadcast (pause v)\nset [move? v] to [0]\nhide variable [health v]\ngo to [front v] layer\nset [pause done? v] to [0]\nswitch costume to (opacity screen v)\nset [paused? v] to [1]\ngo to [front v] layer\nshow\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [3]\ncreate clone of (_myself_ v)\nset [id v] to [4]\ncreate clone of (_myself_ v)\nwait until <<(pause done?) = [1]> or <(menu reset) = [1]>>\nset [move? v] to [1]\nbroadcast (unpause v)\nstop [other scripts in sprite v]\nbroadcast (pause loader v)\ndelete this clone\n\nwhen I start as a clone\nif <(id) = [1]> then\n    go to [front v] layer\n    switch costume to (resume v)\n    show\n    forever\n        if <not <(pause done?) = [1]>> then\n            if <touching (mouse-pointer v)?> then\n                switch costume to (resume selected v)\n                if <mouse down?> then\n                    start sound [slect v]\n                    set [pause done? v] to [1]\n                    set [paused? v] to [0]\n                end\n            else\n                switch costume to (resume v)\n            end\n        else\n            delete this clone\n        end\n    end\nend\nif <(id) = [2]> then\n    go to [front v] layer\n    switch costume to (quit game v)\n    show\n    forever\n        if <not <(pause done?) = [1]>> then\n            if <touching (mouse-pointer v)?> then\n                switch costume to (quit game selected v)\n                if <mouse down?> then\n                    start sound [slect v]\n                    set [pause done? v] to [1]\n                    set [paused? v] to [0]\n                    broadcast (ingame pause menu quit v)\n                    set [level v] to [1]\n                end\n            else\n                switch costume to (quit game v)\n            end\n        else\n            delete this clone\n        end\n    end\nend\nif <(id) = [3]> then\n    go to [front v] layer\n    switch costume to (reset level v)\n    show\n    forever\n        if <not <(pause done?) = [1]>> then\n            if <touching (mouse-pointer v)?> then\n                switch costume to (reset level selected v)\n                if <mouse down?> then\n                    start sound [slect v]\n                    set [pause done? v] to [1]\n                    set [paused? v] to [0]\n                    broadcast (Pause reset v)\n                end\n            else\n                switch costume to (reset level v)\n            end\n        else\n            delete this clone\n        end\n    end\nend\nif <(id) = [4]> then\n    go to [front v] layer\n    clear graphic effects\n    switch costume to (paused text v)\n    show\n    forever\n        if <not <(pause done?) = [1]>> then\n    end\nend\n\nwhen I receive [play game v]\nset [paused? v] to [0]\nset [pause done? v] to [0]\nbroadcast (pause loader v)\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [menu v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [ingame pause menu quit v]\nset [paused? v] to [0]\nset [pause done? v] to [0]\nbroadcast (transition v)\nbroadcast (menu v)\n\nwhen I receive [pause loader v]\nset [pause done? v] to [1]\nforever\n    if <(pause done?) = [0]> then\n        set [move? v] to [0]\n    end\nend\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nhide\nset [pause done? v] to [1]\n\nwhen this sprite clicked\nstop [other scripts in sprite v]\nbroadcast (pause v)\nstart sound [slect v]\nset [move? v] to [0]\nhide variable [health v]\ngo to [front v] layer\nset [pause done? v] to [0]\nswitch costume to (opacity screen v)\nset [paused? v] to [1]\ngo to [front v] layer\nshow\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [3]\ncreate clone of (_myself_ v)\nset [id v] to [4]\ncreate clone of (_myself_ v)\nwait until <<(pause done?) = [1]> or <(menu reset) = [1]>>\nset [move? v] to [1]\nbroadcast (unpause v)\nhide\nstop [other scripts in sprite v]\nbroadcast (pause loader v)\ndelete this clone\n\nwhen I receive [tick v]\nif <<(transition?) = [1]> or <(cutscene) = [1]>> then\n    hide\nelse\n    show\nend\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [green flag v]\nclear graphic effects\ngo to x: (0) y: (0)\nset [paused? v] to [0]\nset [pause done? v] to [0]\nhide\n\n@Lose screen\n\ndefine Smooth size (numba) Start (start)\nset size to (start) %\nrepeat (50)\n    change size by (((numba) - (size)) / (25))\nend\nrepeat (50)\n    change size by (((size) - (numba)) / (25))\nend\n\nwhen I receive [oof v]\nhide\nset [you lose? v] to [1]\nset [cutscene v] to [1]\nhide variable [health v]\nhide variable [score v]\nset [move? v] to [0]\ngo to x: (0) y: (0)\nclones\n\nwhen I receive [oof v]\nwait (1) seconds\nwait until <key (any v) pressed?>\nbroadcast (long transistion v)\nwait (1) seconds\nhide\nbroadcast (replay v)\nset [cutscene v] to [0]\nstop [other scripts in sprite v]\n\nwhen I receive [space oof v]\nhide\nset [you lose? v] to [1]\nset [cutscene v] to [1]\nhide variable [health v]\nhide variable [score v]\nset [move? v] to [0]\ngo to x: (0) y: (0)\nclones\n\nwhen I receive [space oof v]\nwait (1) seconds\nwait until <key (any v) pressed?>\nbroadcast (long transistion v)\nwait (1) seconds\nhide\nbroadcast (replay space v)\nset [cutscene v] to [0]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nif <(ID) = [4]> then\n    switch costume to (bg v)\n    set size to (100) %\n    clear graphic effects\n    go to x: (0) y: (0)\n    show\n    forever\n        repeat (25)\n            change [brightness v] effect by (-.3)\n        end\n        repeat (25)\n            change [brightness v] effect by (.3)\n        end\n    end\nend\nif <(ID) = [3]> then\n    switch costume to (game over v)\n    go to [front v] layer\n    set size to (100) %\n    clear graphic effects\n    go to x: (0) y: (0)\n    show\n    forever\n        Smooth size [105] Start [100]\n    end\nend\nif <(ID) = [2]> then\n    switch costume to (pick random (1) to (4))\n    set size to (100) %\n    clear graphic effects\n    go to x: (0) y: (0)\n    go to [front v] layer\n    show\nend\nif <(ID) = [1]> then\n    switch costume to (press anykey v)\n    set size to (100) %\n    clear graphic effects\n    go to [front v] layer\n    go to x: (0) y: (0)\n    forever\n        show\n        wait (1) seconds\n        hide\n        wait (1) seconds\n    end\nend\n\ndefine clones\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [3]\ncreate clone of (_myself_ v)\nset [id v] to [4]\ncreate clone of (_myself_ v)\n\nwhen I receive [replay v]\ndelete this clone\n\nwhen I receive [replay space v]\ndelete this clone\n\nwhen I receive [green flag v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nhide\n\n@Shop\n\nwhen I receive [shop v]\nset [move? v] to [0]\nset [shop? v] to [1]\nset [cutscene v] to [1]\nshow\ngo to [front v] layer\nforever\n    if <<touching (mouse-pointer v)?> and <<<<(mouse x) > [-169]> and <(mouse y) < [169]>> and <(mouse y) > [89]>> and <(mouse x) < [-70]>>> then\n        switch costume to (shop purp v)\n        switch costume to ((costume [number v]) + (Purple))\n        if <mouse down?> then\n            if <<(Purple) = [0]> and <<(Score) = [350]> or <(Score) > [350]>>> then\n                start sound [chaching v]\n                set [purple v] to [1]\n                change [score v] by (-350)\n                add [2] to [weapon unlocked? v]\n                set [weapon selected v] to [2]\n                if <<(level) > [0]> and <(level) < [12]>> then\n                    add [purple] to [which unlocked in level 1? v]\n                else\n                    if <<(level) > [11]> and <(level) < [16]>> then\n                        add [purple] to [which unlocked in level 2? v]\n                    else\n                        if <<(level) > [15]> and <(level) < [24]>> then\n                            add [purple] to [which unlocked in level 3? v]\n                        end\n                    end\n                end\n            else\n                if <(Purple) = [1]> then\n                    start sound [click v]\n                    set [weapon selected v] to [2]\n                end\n            end\n        end\n    else\n        if <<touching (mouse-pointer v)?> and <<<<(mouse x) > [-186]> and <(mouse y) < [51]>> and <(mouse y) > [-24]>> and <(mouse x) < [-55]>>> then\n            switch costume to (shop stap v)\n            switch costume to ((costume [number v]) + (stapler))\n            if <mouse down?> then\n                if <<(stapler) = [0]> and <<(Score) = [120]> or <(Score) > [120]>>> then\n                    start sound [chaching v]\n                    set [stapler v] to [1]\n                    change [score v] by (-120)\n                    add [3] to [weapon unlocked? v]\n                    set [weapon selected v] to [3]\n                    if <<(level) > [0]> and <(level) < [12]>> then\n                        add [stapler] to [which unlocked in level 1? v]\n                    else\n                        if <<(level) > [11]> and <(level) < [16]>> then\n                            add [stapler] to [which unlocked in level 2? v]\n                        else\n                            if <<(level) > [15]> and <(level) < [24]>> then\n                                add [stapler] to [which unlocked in level 3? v]\n                            end\n                        end\n                    end\n                else\n                    if <(Purple) = [1]> then\n                        start sound [click v]\n                        set [weapon selected v] to [3]\n                    end\n                end\n            end\n        else\n            if <<touching (mouse-pointer v)?> and <<<<(mouse x) > [-184]> and <(mouse y) < [-55]>> and <(mouse y) > [-127]>> and <(mouse x) < [-59]>>> then\n                switch costume to (shop health v)\n                switch costume to ((costume [number v]) + (Shield))\n                if <mouse down?> then\n                    if <<(Shield) = [0]> and <<(Score) = [150]> or <(Score) > [150]>>> then\n                        start sound [chaching v]\n                        set [shield v] to [1]\n                        set [health v] to [7]\n                        set [max hp v] to [7]\n                        add [4] to [weapon unlocked? v]\n                        change [score v] by (-150)\n                        if <<(level) > [0]> and <(level) < [12]>> then\n                            add [health] to [which unlocked in level 1? v]\n                        else\n                            if <<(level) > [11]> and <(level) < [16]>> then\n                                add [health] to [which unlocked in level 2? v]\n                            else\n                                if <<(level) > [15]> and <(level) < [24]>> then\n                                    add [health] to [which unlocked in level 3? v]\n                                end\n                            end\n                        end\n                    else\n                        if <(Shield) = [1]> then\n                            start sound [click v]\n                            set [max hp v] to [7]\n                        end\n                    end\n                end\n            else\n                if <<touching (mouse-pointer v)?> and <<<<(mouse x) > [159]> and <(mouse y) < [-154]>> and <(mouse y) > [-175]>> and <(mouse x) < [230]>>> then\n                    if <mouse down?> then\n                        start sound [click v]\n                        broadcast (end shop v)\n                        broadcast (transition v)\n                        hide\n                        wait (1.2) seconds\n                        set [shop? v] to [0]\n                        set [move? v] to [1]\n                        set [cutscene v] to [0]\n                        stop [this script v]\n                    end\n                else\n                    switch costume to (shop none v)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [play game v]\nhide\ngo to x: (0) y: (0)\nclear graphic effects\ndelete all of [weapon unlocked? v]\ndelete all of [which unlocked in level 3? v]\ndelete all of [which unlocked in level 2? v]\ndelete all of [which unlocked in level 1? v]\nset [shield v] to [0]\nset [stapler v] to [0]\nset [purple v] to [0]\nset [max hp v] to [4]\nset [shop? v] to [0]\nset [cutscene v] to [0]\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [shop purchase level reset stapler v]\ndelete (item # of [3] in [weapon unlocked? v]) of [weapon unlocked? v]\nset [stapler v] to [0]\n\nwhen I receive [shop purchase level reset purple v]\ndelete (item # of [2] in [weapon unlocked? v]) of [weapon unlocked? v]\nset [purple v] to [0]\n\nwhen I receive [shop purchase level reset health v]\ndelete (item # of [4] in [weapon unlocked? v]) of [weapon unlocked? v]\nset [shield v] to [0]\nset [max hp v] to [4]\n\nwhen I receive [green flag v]\nhide\ngo to x: (0) y: (0)\nclear graphic effects\ndelete all of [weapon unlocked? v]\ndelete all of [which unlocked in level 3? v]\ndelete all of [which unlocked in level 2? v]\ndelete all of [which unlocked in level 1? v]\nset [shield v] to [0]\nset [stapler v] to [0]\nset [purple v] to [0]\nset [max hp v] to [4]\nset [shop? v] to [0]\nset [cutscene v] to [0]\n\n@coin\n\ndefine spawn (x) (y)\ngo to x: (x) y: (y)\nswitch costume to (cash v)\nclear graphic effects\nset size to (95) %\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (cash v)\nwait (pick random (.01) to (1)) seconds\nforever\n    repeat until <touching (hitbox v)?>\n        repeat (10)\n            change y by (.5)\n        end\n        repeat (10)\n            change y by (-.5)\n        end\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nwait (1.3) seconds\nshow\nrepeat (25)\n    change [ghost v] effect by (-4)\nend\nforever\n    if <touching (hitbox v)?> then\n        start sound [Coin v]\n        broadcast (Ui health/score change v)\n        change [level score collected v] by (-10)\n        change [score v] by (10)\n        repeat (10)\n            change y by (2)\n            change [ghost v] effect by (10)\n            change [brightness v] effect by (5)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [play game v]\nbroadcast (money spawn reset v)\nset [collect money v] to [0]\nset [level score collected v] to [0]\n\nwhen I receive [scroll effect x v]\nbroadcast (money spawn reset v)\n\nwhen I receive [replay v]\nbroadcast (money spawn reset v)\n\nwhen I receive [replay space v]\nbroadcast (money spawn reset v)\n\ndefine reset\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [money spawn reset v]\nset [level score collected v] to [0]\nreset\nif <(level) = [3]> then\n    spawn [70] [40]\n    spawn [0] [40]\n    spawn [-70] [40]\n    spawn [0] [-85]\nend\nif <(level) = [4]> then\n    spawn [20] [-85]\n    spawn [-60] [-85]\n    spawn [-140] [-85]\nend\nif <(level) = [5]> then\n    spawn [0] [-85]\n    spawn [80] [-85]\n    spawn [160] [-85]\nend\nif <(level) = [6]> then\n    spawn [-14] [20]\n    spawn [-80] [-30]\n    spawn [48] [-30]\nend\nif <(level) = [7]> then\n    spawn [-130] [45]\n    spawn [92] [100]\n    spawn [200] [-75]\n    spawn [100] [-75]\n    spawn [0] [-75]\n    spawn [100] [-75]\n    spawn [0] [-75]\nend\nif <(level) = [8]> then\n    spawn [-52] [80]\n    spawn [187] [45]\nend\nif <(level) = [9]> then\n    spawn [165] [-75]\n    spawn [97] [-75]\nend\nif <(level) = [10]> then\n    spawn [0] [-85]\n    spawn [80] [-85]\n    spawn [160] [-85]\n    spawn [0] [-85]\n    spawn [80] [-85]\n    spawn [160] [-85]\nend\nif <(level) = [13]> then\n    spawn [-80] [-85]\n    spawn [0] [-85]\n    spawn [80] [-85]\n    spawn [160] [-85]\n    spawn [0] [-10]\n    spawn [80] [-10]\n    spawn [160] [-10]\n    spawn [-80] [-10]\nend\nif <(level) = [14]> then\n    spawn [-146] [100]\n    spawn [102] [5]\n    spawn [195] [85]\nend\nif <(level) = [21]> then\n    spawn [0] [-85]\n    spawn [80] [-85]\n    spawn [160] [-85]\nend\n\nwait until <(level) = [155]>\nspawn [-146] [100]\nspawn [102] [5]\nspawn [195] [85]\n\nwhen I receive [tick v]\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nset [score v] to [0]\nhide\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [ingame pause menu quit v]\ndelete this clone\n\nwhen I receive [green flag v]\nset [collect money v] to [0]\nset [level score collected v] to [0]\n\n@Shop icon\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nswitch costume to (shop v)\nhide\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nswitch costume to (shop v)\nhide\n\nwhen flag clicked\nhide\nclear graphic effects\ngo to x: (0) y: (0)\n\nwhen I receive [tick v]\nif <<(transition?) = [1]> or <<(cutscene) = [1]> or <(paused?) = [1]>>> then\n    hide\n    go to [back v] layer\n    switch costume to (empty v)\nelse\n    show\n    go to [front v] layer\n    switch costume to (shop v)\nend\nif <(sound?) = [1]> then\n    set volume to (100) %\nelse\n    if <(sound?) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [play game v]\nshow\nset [ghost v] to [0]\nset [ghost v] effect to (0)\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            broadcast (shop v)\n            start sound [Machine v]\n            wait (1) seconds\n        end\n        if <not <<(ghost) < [0]> or <(ghost) = [0]>>> then\n            change [ghost v] effect by (-2)\n            change [ghost v] by (-2)\n        end\n    else\n        if <not <<[64] < (ghost)> or <(ghost) = [64]>>> then\n            change [ghost v] effect by (1)\n            change [ghost v] by (1)\n        end\n    end\nend\n\n@Score\n\nwhen I start as a clone\nif <<(cutscene) = [1]> and <not <(shop?) = [1]>>> then\n    hide\nelse\n    show\nend\nset size to (round (score size)) %\nif <(shop?) = [1]> then\n    set [ghost v] effect to (0)\n    set size to (70) %\nend\nwait (0.01) seconds\ndelete this clone\n\ndefine Draw Number\ngo to x: (-220) y: (98)\nif <(shop?) = [1]> then\n    go to x: (110) y: (-164)\nelse\n    go to x: (-220) y: (98)\nend\nset [i v] to [1]\nrepeat (length of (Score))\n    switch costume to (letter (i) of (Score))\n    create clone of (_myself_ v)\n    if <(shop?) = [1]> then\n        change x by (15)\n    else\n        change x by (20)\n    end\n    change [i v] by (1)\nend\n\nwhen I receive [play game v]\nforever\n    Draw Number\nend\n\nwhen I receive [tick v]\nset [ghost v] effect to (score GHOST EFFECT)\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nhide\nswitch costume to (0 v)\ndelete this clone\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nhide\nswitch costume to (0 v)\ndelete this clone\n\nwhen I receive [shop v]\nwait () seconds\ngo to [front v] layer\n\nwhen I receive [green flag v]\nhide\nswitch costume to (0 v)\nset [score v] to [0]\ngo to [front v] layer\n\n@Score/health\n\nwhen I receive [play game v]\nswitch costume to ((Health) + (1))\nshow\nset [score ghost effect v] to [0]\nset [ghost v] effect to (0)\nwait (3) seconds\nrepeat until <(score GHOST EFFECT) = [50]>\n    change [ghost v] effect by (1)\n    change [score ghost effect v] by (1)\nend\nforever\n    switch costume to ((Health) + (1))\nend\n\nwhen I receive [ui health/score change v]\nset size to (100) %\nset [score size v] to [100]\nset [score ghost effect v] to [0]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [score size v] by (((105) - (score size)) / (14))\nend\nrepeat until <<(score GHOST EFFECT) = [50]> or <(score GHOST EFFECT) > [50]>>\n    change [ghost v] effect by (1)\n    change [score ghost effect v] by (1)\n    change [score size v] by (((100) - (score size)) / (14))\nend\n\nwhen I receive [game end v]\nstop [other scripts in sprite v]\nswitch costume to (hp full \(normal\)4 v)\nhide\n\nwhen I receive [ingame pause menu quit v]\nstop [other scripts in sprite v]\nswitch costume to (hp full \(normal\)4 v)\nhide\n\nwhen I receive [green flag v]\nhide\nset [health v] to [4]\nclear graphic effects\ngo to x: (0) y: (0)\n\n@thumbnail\n\nwhen [timer v] > (.1)\ngo to [front v] layer\ngo to x: (0) y: (200)\nset [brightness v] effect to (45)\nshow\nrepeat (45)\n    change y by (((0) - (y position)) / (7))\n    change [brightness v] effect by (-1)\nend\n\nwhen I receive [green flag v]\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [green flag v]\nforever\n    reset timer\nend\n\n@Fog effect\n\nwhen I start as a clone\nswitch costume to (light v)\nset [brightness v] effect to (0)\ngo to [front v] layer\nshow\nforever\n    if <[space levels v] contains (level)?> then\n        show\n        go to (hitbox v)\n        change y by (20)\n    else\n        hide\n        go to x: (0) y: (0)\n    end\n    if <[space levels v] contains (level)?> then\n        set [brightness v] effect to (0)\n        set [ghost v] effect to (70)\n    end\nend\n\nwhen I receive [play game v]\ncreate clone of (_myself_ v)\nset [fog scroll v] to [0]\nswitch costume to (fog v)\n\nwhen I receive [tick v]\nif <[space levels v] contains (level)?> then\n    go to [front v] layer\n    show\nelse\n    go to [back v] layer\n    hide\nend\ngo to x: ((((Camera X) * (-1)) + (Fog Scroll)) mod (480)) y: (((Camera Y) * (-1)) mod (360))\nchange [fog scroll v] by (1.5)\nif <[space levels v] contains (level)?> then\n    set [brightness v] effect to (10)\n    set [ghost v] effect to (70)\nend\n\nwhen I receive [green flag v]\nhide\nclear graphic effects\ngo to x: (0) y: (0)\n\n