Ninja Nick - A Platformer

Instructions: ----If the game is not working smoothly try turning turbo mode on-----\n---------and / or use the offline editor to play the game instead----------\n\nIntroduction will not effect gameplay so feel free to skip!\n\nWASD / Arrow Keys To Move\nSpacebar To Attack\nE To Interact\nEnter To Teleport

@Stage\n\nwhen I receive [backstory v]\nset [level number v] to [1]\nset [brightness v] effect to (-100)\nrepeat (60)\n    change [brightness v] effect by (1)\nend\nwait until <not <(Skip) = [1]>>\nswitch backdrop to (backstory v)\nwait until <not <(Skip) = [1]>>\nwait (2) seconds\nwait until <not <(Skip) = [1]>>\nrepeat (10)\n    change [brightness v] effect by (1)\nend\nwait until <not <(Skip) = [1]>>\nswitch backdrop to (backstory2 v)\nwait until <not <(Skip) = [1]>>\nwait (2) seconds\nrepeat (10)\n    change [brightness v] effect by (1)\nend\nwait until <not <(Skip) = [1]>>\nswitch backdrop to (backstory3 v)\nwait until <not <(Skip) = [1]>>\nwait (2) seconds\nrepeat (10)\n    change [brightness v] effect by (1)\nend\nwait until <not <(Skip) = [1]>>\nswitch backdrop to (backstory4 v)\nwait until <not <(Skip) = [1]>>\nwait (2) seconds\nrepeat (10)\n    change [brightness v] effect by (1)\nend\nbroadcast (Flower Grow v)\nwait until <not <(Skip) = [1]>>\nswitch backdrop to (backstory4 v)\nwait until <not <(Skip) = [1]>>\nwait (5) seconds\nwait until <not <(Skip) = [1]>>\nswitch backdrop to (backstory5 v)\nwait until <not <(Skip) = [1]>>\nwait (5) seconds\nbroadcast (Flower Stop Growing v)\nwait until <not <(Skip) = [1]>>\nswitch backdrop to (backstory6 v)\nwait until <not <(Skip) = [1]>>\nwait (6) seconds\nbroadcast (Intro v)\nwait until <not <(Skip) = [1]>>\nwait (21) seconds\nbroadcast (Backstory Over? v)\n\nwhen flag clicked\nswitch backdrop to (backstory v)\n\nwhen I receive [switch backdrop v]\nswitch backdrop to (main menu v)\nset [ghost v] effect to (0)\nbroadcast (Main Menu v)\nset [ghost v] effect to (0)\n\nwhen I receive [customize v]\nswitch backdrop to (customize v)\n\nwhen I receive [options v]\nswitch backdrop to (options v)\n\nwhen I receive [main menu v]\nswitch backdrop to (main menu v)\n\nwhen I receive [backstory over? v]\nrepeat (100)\n    set [brightness v] effect to (0)\nend\n\nwhen I receive [start game! v]\nswitch backdrop to (game play backdrop v)\n\nwhen I receive [level 6 v]\nswitch backdrop to (level 6 v)\n\nwhen I receive [level 7 v]\nswitch backdrop to (level 7 a v)\n\nwhen I receive [lift #2 v]\nswitch backdrop to (level 7 b v)\n\nwhen I receive [level 8 v]\nswitch backdrop to (level 8 a v)\n\nwhen I receive [smash v]\nswitch backdrop to (level 8 b v)\n\nwhen I receive [level 9 v]\nswitch backdrop to (level 9  a v)\n\nwhen I receive [smash #2 v]\nswitch backdrop to (level 9  b v)\n\nwhen I receive [intro v]\nswitch backdrop to (blank v)\n\nwhen I receive [level 10 v]\nswitch backdrop to (level 10 v)\n\nwhen I receive [level 11 v]\nswitch backdrop to (level 11 a v)\n\nwhen I receive [11 b v]\nswitch backdrop to (level 11 b v)\n\nwhen I receive [level 15 // boss battle v]\nswitch backdrop to (level 15 // boss battle v)\n\nwhen I receive [level 12 v]\nswitch backdrop to (level 12 v)\n\nwhen I receive [level 13 v]\nswitch backdrop to (level 13 v)\n\nwhen I receive [dead boss v]\nbroadcast (Smash #4 v)\nswitch backdrop to (level 15 // boss dead v)\n\nwhen I receive [level 14 v]\nswitch backdrop to (level 14 v)\n\nwhen I receive [level 16 v]\nswitch backdrop to (level 16 v)\n\nwhen I receive [drop v]\nswitch backdrop to (level 16 drop v)\n\nwhen I receive [finish v]\nbroadcast (End v)\n\nwhen I receive [end v]\nswitch backdrop to (black v)\n\n@Coding Sprite\n\nwhen flag clicked\nset [health v] to [10]\nset [multiplier v] to [0]\nset [costume number v] to [1]\nset [difficulty costume number v] to [1]\nset [customize v] to [0]\nset [attack v] to [4]\nswitch costume to (empty v)\nbroadcast (Backstory v)\n\nwhen I receive [customize v]\nhide\n\nwhen I receive [options v]\nset [customize v] to [1]\nhide\n\nwhen I receive [main menu v]\nset [defense v] to [2]\nset [undo size change? v] to [true]\n\nwhen I receive [backstory over? v]\nswitch costume to (empty2 v)\nbroadcast (Switch Backdrop v)\nhide\nnext costume\n\nwhen I receive [start game! v]\nforever\n    if <(Level Number) = [2]> then\n        broadcast (Level 2 v)\n        wait until <not <(Level Number) = [2]>>\n    end\n    if <(Level Number) = [3]> then\n        broadcast (Level 3 v)\n        wait until <not <(Level Number) = [3]>>\n    end\n    if <(Level Number) = [4]> then\n        broadcast (Level 4 v)\n        wait until <not <(Level Number) = [4]>>\n    end\n    if <(Level Number) = [5]> then\n        broadcast (Level 5 v)\n        wait until <not <(Level Number) = [5]>>\n    end\n    if <(Level Number) = [6]> then\n        broadcast (Level 6 v)\n        wait until <not <(Level Number) = [6]>>\n    end\n    if <(Level Number) = [7]> then\n        broadcast (Level 7 v)\n        wait until <not <(Level Number) = [7]>>\n    end\n    if <(Level Number) = [8]> then\n        broadcast (Level 8 v)\n        wait until <not <(Level Number) = [8]>>\n    end\n    if <(Level Number) = [9]> then\n        broadcast (Level 9 v)\n        wait until <not <(Level Number) = [9]>>\n    end\n    if <(Level Number) = [10]> then\n        broadcast (Level 10 v)\n        wait until <not <(Level Number) = [10]>>\n    end\n    if <(Level Number) = [11]> then\n        broadcast (Level 11 v)\n        wait until <not <(Level Number) = [11]>>\n    end\n    if <(Level Number) = [12]> then\n        broadcast (Level 12 v)\n        wait until <not <(Level Number) = [12]>>\n    end\n    if <(Level Number) = [13]> then\n        broadcast (Level 13 v)\n        wait until <not <(Level Number) = [13]>>\n    end\n    if <(Level Number) = [14]> then\n        broadcast (Level 14 v)\n        wait until <not <(Level Number) = [14]>>\n    end\n    if <(Level Number) = [15]> then\n        broadcast (Level 15 // BOSS BATTLE v)\n        wait until <not <(Level Number) = [15]>>\n    end\n    if <(Level Number) = [16]> then\n        broadcast (Level 16 v)\n        wait until <not <(Level Number) = [16]>>\n    end\n    if <(Level Number) = [17]> then\n        broadcast (Level 17 v)\n        wait until <not <(Level Number) = [17]>>\n    end\nend\n\nwhen I receive [death v]\nchange [deaths v] by (1)\n\nwhen I receive [backstory v]\nhide variable [defense v]\nhide variable [attack v]\nhide variable [health v]\nhide variable [deaths v]\nforever\n    if <(username) = [OpenWood]> then\n        Admin Powers\n    end\nend\n\nwhen I receive [start game! v]\nreset timer\n\nwhen I receive [death v]\nset [health v] to [10]\n\nwhen I receive [start game! v]\nset [customize v] to [1]\nhide\n\nwhen I receive [customize v]\nset [customize v] to [1]\nhide\n\nwhen I receive [options v]\nset [customize v] to [1]\nhide\n\ndefine Admin Powers\nif <key (6 v) pressed?> then\n    set [deaths v] to [0]\nend\nif <key (7 v) pressed?> then\n    hide variable [defense v]\n    hide variable [attack v]\n    hide variable [health v]\n    hide variable [deaths v]\nend\nif <key (8 v) pressed?> then\n    show variable [attack v]\n    show variable [health v]\n    show variable [defense v]\n    show variable [deaths v]\nend\nif <key (9 v) pressed?> then\n    set [health v] to [10]\nend\nif <key (p v) pressed?> then\n    change [level number v] by (1)\n    wait until <not <key (p v) pressed?>>\nend\n\n@Mouse\n\nwhen I start as a clone\nwait (0.1) seconds\ndelete this clone\n\nwhen I receive [main menu v]\nforever\n    go to [front v] layer\n    if <(Costume Number) = [1]> then\n        set [brightness v] effect to (1)\n    end\nend\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [main menu v]\nshow\nforever\n    go to (mouse-pointer v)\n    if <(Costume Number) = [1]> then\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I receive [backstory v]\nforever\n    if <(Costume Number) = [1]> then\n        switch costume to (mouse 1 v)\n    end\n    if <(Costume Number) = [2]> then\n        set [ghost v] effect to (0)\n        switch costume to (mouse 2 v)\n    end\n    if <(Costume Number) = [3]> then\n        set [ghost v] effect to (0)\n        if <touching color (#00cc44)?> then\n            switch costume to (mouse 4 v)\n        else\n            if <touching color (#6500cb)?> then\n                switch costume to (mouse 5 v)\n            else\n                switch costume to (mouse 3 v)\n            end\n        end\n    end\nend\n\nwhen I receive [main menu v]\nforever\n    if <(Costume Number) = [3]> then\n        go to (mouse-pointer v)\n    end\nend\n\nwhen I receive [start game! v]\nhide\n\n@Volume Control2\n\nwhen this sprite clicked\nif <(Volume Control) < [4]> then\n    change [volume control v] by (1)\n    wait until <not <mouse down?>>\nelse\n    set [volume control v] to [1]\n    wait until <not <mouse down?>>\nend\nswitch costume to (Volume Control)\n\nwhen flag clicked\nforever\n    if <(Volume Control) = [1]> then\n        set volume to (100) %\n    end\n    if <(Volume Control) = [2]> then\n        set volume to (66) %\n    end\n    if <(Volume Control) = [3]> then\n        set volume to (33) %\n    end\n    if <(Volume Control) = [4]> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [backstory over? v]\nset [backstory over v] to [True]\nstop all sounds\nforever\n    if <<not <(Override Randomness) = [true]>> and <not <<[11] < (Level Number)> and <(Level Number) < [17]>>>> then\n        set [random v] to (pick random (1) to (3))\n        if <(Random) = [1]> then\n            play sound [Fruit_Ninja_Full_Soundtrack.mp3 v] until done\n        end\n        if <(Random) = [2]> then\n            play sound [temple v] until done\n        end\n        if <(Random) = [3]> then\n            play sound [temple v] until done\n        end\n    else\n        if <not <<[11] < (Level Number)> and <(Level Number) < [17]>>> then\n            stop all sounds\n            if <(Random) = [1]> then\n                play sound [Fruit_Ninja_Full_Soundtrack.mp3 v] until done\n            end\n            if <(Random) = [2]> then\n                play sound [temple v] until done\n            end\n            if <(Random) = [3]> then\n                play sound [dance head nod v] until done\n            end\n        else\n            broadcast (Stop Sounds v)\n            if <(Level Number) = [12]> then\n                wait (pick random (0.5) to (3)) seconds\n                play sound [Heavy stomp   sound effect.mp3 v] until done\n            end\n            if <(Level Number) = [13]> then\n                wait (pick random (0.5) to (3)) seconds\n                play sound [Heavy stomp   sound effect.mp2 v] until done\n            end\n            if <(Level Number) = [14]> then\n                wait (pick random (0.5) to (3)) seconds\n                play sound [Heavy stomp   sound effect.mp4 v] until done\n            end\n        end\n    end\nend\n\nwhen I receive [backstory v]\nset [random v] to [1]\nset [backstory over v] to [False]\nrepeat until <(Backstory Over) = [True]>\n    play sound [crystalis title! v] until done\nend\n\nwhen I receive [backstory v]\nset [override randomness v] to [false]\nset [backstory over v] to [False]\nswitch costume to (100% v)\nhide\n\nwhen I receive [backstory over? v]\nshow\nset [volume control v] to [1]\nset volume to (100) %\nswitch costume to (volume v)\n\nwhen I receive [main menu v]\nset [end v] to [false]\nset [sound all sounds debug v] to [false]\nshow\ngo to [front v] layer\ngo to x: (188) y: (160)\n\nwhen I receive [backstory v]\nforever\n    if <(Override Randomness) = [true]> then\n        set [random v] to (Random 2)\n    end\nend\n\nwhen I receive [main menu v]\nforever\n    if <<touching (mouse v)?> and <mouse down?>> then\n        if <(Volume Control) < [4]> then\n            change [volume control v] by (1)\n            wait until <not <mouse down?>>\n        else\n            set [volume control v] to [1]\n            wait until <not <mouse down?>>\n        end\n        switch costume to (Volume Control)\n    end\nend\n\nwhen I receive [sword sound effect v]\nplay sound [Drawn Sword Sound Effect.mp3 v] until done\n\nwhen I receive [hit v]\nplay sound [Minecraft Getting Hit Damage Sound Effect \[1_3\].mp2 v] until done\n\nwhen I receive [powerup collected v]\nplay sound [Sci-Fi Power Up Sound Effect.mp3 v] until done\n\nwhen I receive [click noise v]\nplay sound [mouseclick v] until done\n\nwhen I receive [breaking hammer v]\nplay sound [Hammer Break v] until done\n\nwhen I receive [smash #2 v]\nplay sound [Blocks Breaking v] until done\n\nwhen I receive [smash #3 v]\nplay sound [Blocks Breaking v] until done\n\nwhen I receive [smash v]\nplay sound [Blocks Breaking v] until done\n\nwhen I receive [level 11 v]\nforever\n    if <<<[11] < (Level Number)> and <(Level Number) < [16]>> and <not <(Sound All Sounds Debug) = [true]>>> then\n        set [sound all sounds debug v] to [true]\n        repeat (10)\n            stop all sounds\n        end\n    end\nend\n\nwhen I receive [level 15 // boss battle v]\ngo to x: (178) y: (137)\n\nwhen I receive [intro v]\nset [once v] to [0]\nstop all sounds\nset [backstory over v] to [True]\nplay sound [20th Century Fox Intro \[HD\].mp3 v] until done\n\nwhen I receive [level 15 // boss battle v]\nrepeat until <(Level Number) = [16]>\n    play sound [Top 10 Pokemon Game Battle Music.mp2 v] until done\nend\n\nwhen I receive [roar v]\nplay sound [Pokemon Cries - _323 Camerupt.mp3 v] until done\n\nwhen I receive [level 15 // boss battle v]\ngo to [front v] layer\n\nwhen I receive [smash #4 v]\nplay sound [Blocks Breaking v] until done\n\nwhen I receive [stop sounds v]\nif <(Once) = [0]> then\n    set [once v] to [1]\n    stop all sounds\n    stop [this script v]\nend\n\nwhen I receive [level 16 v]\nstop all sounds\ngo to x: (188) y: (160)\nrepeat until <(End) = [true]>\n    play sound [Haunting Mysterious Music - The Dusty Attic.mp3 v] until done\nend\n\nwhen I receive [end v]\nhide\n\nwhen I receive [end v]\nset [end v] to [true]\nrepeat (5)\n    stop all sounds\nend\nforever\n    play sound [Mission Impossible Theme\(full theme\).mp2 v] until done\nend\n\nwhen I receive [exclaim v]\nplay sound [Exclaim v] until done\n\n@Shuriken\n\nwhen I receive [backstory v]\nset [debug cooldown spacebar 2 v] to [false]\nset [debug cooldown spacebar v] to [false]\nset [debug cooldown v] to [false]\nset [cooldown v] to [1]\nset [cooldown of cooldown v] to [1]\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nshow\ngo to (ninja nick v)\npoint towards (ninja nick v)\nrepeat until <<<<<<touching color (#7f7f7f)?> or <touching (_edge_ v)?>> or <touching (zombie v)?>> or <touching (golden zombie v)?>> or <touching (zombie horde v)?>> or <touching (zombie with hammer v)?>>\n    if <<([costume # v] of [ninja nick v]) = [1]> or <<([costume # v] of [ninja nick v]) = [3]> or <([costume # v] of [ninja nick v]) = [5]>>> then\n        repeat until <<<<<<touching color (#7f7f7f)?> or <touching (_edge_ v)?>> or <touching (zombie v)?>> or <touching (golden zombie v)?>> or <touching (zombie horde v)?>> or <touching (zombie with hammer v)?>>\n            change x by (5)\n            turn right (20) degrees\n        end\n    else\n        repeat until <<<<<<touching color (#7f7f7f)?> or <touching (_edge_ v)?>> or <touching (zombie v)?>> or <touching (golden zombie v)?>> or <touching (zombie horde v)?>> or <touching (zombie with hammer v)?>>\n            change x by (-5)\n            turn right (20) degrees\n        end\n    end\nend\nhide\n\nwhen I receive [attacking v]\nif <(Cooldown) = [0]> then\n    create clone of (_myself_ v)\n    set [cooldown v] to (Cooldown Of Cooldown)\n    wait until <not <(Cooldown) = [0]>>\nelse\nend\n\nwhen I receive [attacking v]\nif <<<<(Cooldown) = [1]> or <[0] < (Cooldown)>> and <(Debug Cooldown) = [false]>> and <(Debug Cooldown Spacebar) = [false]>> then\n    set [debug cooldown spacebar v] to [true]\n    set [debug cooldown v] to [true]\n    broadcast (Debug Cooldown v)\n    broadcast (Debug Cooldown Spacebar v)\nend\n\nwhen I receive [debug cooldown v]\nwait (Cooldown) seconds\nset [debug cooldown v] to [false]\nset [cooldown v] to [0]\n\nwhen I receive [debug cooldown spacebar v]\nwait until <not <key (space v) pressed?>>\nset [debug cooldown spacebar v] to [false]\nif <(Debug Cooldown Spacebar 2) = [true]> then\n    set [cooldown v] to [0]\nend\n\nwhen I receive [debug cooldown spacebar v]\nset [debug cooldown spacebar 2 v] to [false]\nwait (Cooldown) seconds\nset [debug cooldown spacebar 2 v] to [true]\n\n@Flower Growing\n\nwhen I receive [backstory v]\nswitch costume to (flower x1 v)\nhide\n\nwhen I receive [flower grow v]\nif <not <(Skip) = [1]>> then\n    go to [front v] layer\n    wait (0.5) seconds\n    show\n    switch costume to (flower x1 v)\n    wait (0.5) seconds\n    next costume\n    wait (0.5) seconds\n    next costume\n    wait (0.5) seconds\n    next costume\n    wait (0.5) seconds\n    next costume\n    wait (0.5) seconds\n    next costume\n    wait (0.5) seconds\n    next costume\n    wait (0.5) seconds\n    next costume\n    wait (0.5) seconds\n    next costume\nend\n\nwhen I receive [flower stop growing v]\nhide\n\nwhen I receive [backstory over? v]\nhide\n\nwhen I receive [main menu v]\nhide\n\n@Play Button\n\nwhen I receive [backstory v]\nset [undo size change? v] to [true]\nset size to (60) %\nset [ghost v] effect to (0)\ngo to x: (0) y: (-23)\nhide\n\nwhen I receive [main menu v]\nshow\nset size to (60) %\nforever\n    if <touching (mouse-pointer v)?> then\n        Size Change\n        repeat until <not <touching (mouse v)?>>\n            if <mouse down?> then\n                repeat (20)\n                    change [ghost v] effect by (5)\n                    change size by (3)\n                    set [undo size change? v] to [false]\n                end\n                broadcast (Start Game! v)\n            end\n        end\n        if <<not <touching (mouse v)?>> and <(Undo Size Change?) = [true]>> then\n            Undo Size Change\n            set size to (60) %\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\ndefine Size Change\nrepeat (10)\n    change size by (3)\n    change [ghost v] effect by (1)\nend\n\ndefine Undo Size Change\nrepeat (5)\n    change size by (-6)\n    change [ghost v] effect by (-1)\nend\n\nwhen I receive [customize v]\nhide\n\nwhen I receive [options v]\nhide\n\nwhen I receive [main menu v]\nset size to (60) %\nset [ghost v] effect to (0)\ngo to x: (0) y: (-23)\nshow\n\nwhen I receive [start game! v]\nhide\n\n@Customize\n\nwhen I receive [backstory v]\nset [undo size change? v] to [true]\nset size to (60) %\nset [ghost v] effect to (0)\ngo to x: (-160) y: (-23)\nhide\n\nwhen I receive [main menu v]\nshow\nset size to (60) %\nforever\n    if <touching (mouse-pointer v)?> then\n        Size Change\n        repeat until <not <touching (mouse v)?>>\n            if <mouse down?> then\n                repeat (20)\n                    change [ghost v] effect by (5)\n                    change size by (3)\n                    set [undo size change? v] to [false]\n                    broadcast (Customize v)\n                end\n            end\n        end\n        if <<not <touching (mouse v)?>> and <(Undo Size Change?) = [true]>> then\n            Undo Size Change\n            set size to (60) %\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\ndefine Size Change\nrepeat (10)\n    change size by (2)\n    change [ghost v] effect by (1)\nend\n\ndefine Undo Size Change\nrepeat (5)\n    change size by (-4)\n    change [ghost v] effect by (-1)\nend\n\nwhen I receive [customize v]\nhide\nset [ghost v] effect to (0)\nset [undo size change? v] to [true]\n\nwhen I receive [options v]\nhide\n\nwhen I receive [start game! v]\nhide\n\n@Options\n\nwhen I receive [backstory v]\nset [undo size change? v] to [true]\nset size to (60) %\nset [ghost v] effect to (0)\ngo to x: (160) y: (-23)\nhide\n\nwhen I receive [main menu v]\nshow\nset size to (60) %\nforever\n    if <touching (mouse-pointer v)?> then\n        Size Change\n        repeat until <not <touching (mouse v)?>>\n            if <mouse down?> then\n                repeat (20)\n                    change [ghost v] effect by (5)\n                    change size by (3)\n                    set [undo size change? v] to [false]\n                    broadcast (Options v)\n                end\n            end\n        end\n        if <<not <touching (mouse v)?>> and <(Undo Size Change?) = [true]>> then\n            Undo Size Change\n            set size to (60) %\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\ndefine Size Change\nrepeat (10)\n    change size by (2)\n    change [ghost v] effect by (1)\nend\n\ndefine Undo Size Change\nrepeat (5)\n    change size by (-4)\n    change [ghost v] effect by (-1)\nend\n\nwhen I receive [customize v]\nhide\n\nwhen I receive [options v]\nhide\nset [ghost v] effect to (0)\nset [undo size change? v] to [true]\n\nwhen I receive [start game! v]\nhide\n\n@Back\n\nwhen I receive [backstory v]\nset [undo size change? v] to [true]\nset size to (45) %\nset [ghost v] effect to (0)\ngo to x: (195) y: (-150)\nhide\n\nwhen I receive [main menu v]\nshow\nhide\nset size to (45) %\nforever\n    if <touching (mouse-pointer v)?> then\n        Size Change\n        repeat until <not <touching (mouse v)?>>\n            if <mouse down?> then\n                repeat (20)\n                    change [ghost v] effect by (5)\n                    change size by (3)\n                    set [undo size change? v] to [false]\n                    set [customize v] to [0]\n                    broadcast (Main Menu v)\n                end\n            end\n        end\n        if <<not <touching (mouse v)?>> and <(Undo Size Change?) = [true]>> then\n            Undo Size Change\n            set size to (45) %\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\ndefine Size Change\nrepeat (10)\n    change size by (1)\n    change [ghost v] effect by (1)\nend\n\ndefine Undo Size Change\nrepeat (5)\n    change size by (-2)\n    change [ghost v] effect by (-1)\nend\n\nwhen I receive [customize v]\nshow\n\nwhen I receive [options v]\nshow\n\nset size to (200) %\n\n@Mouse Detection\n\nwhen I receive [backstory v]\nswitch costume to (mouse 1 v)\nhide\n\nwhen I receive [main menu v]\ngo to x: (-152) y: (49)\nhide\n\nwhen I receive [options v]\nshow\n\nwhen I receive [options v]\nforever\n    if <<touching (mouse v)?> and <mouse down?>> then\n        if <<(Costume Number) = [1]> or <(Costume Number) = [2]>> then\n            change [costume number v] by (1)\n            next costume\n            wait until <not <mouse down?>>\n        else\n            set [costume number v] to [1]\n            switch costume to (mouse 1 v)\n            wait until <not <mouse down?>>\n        end\n    end\nend\n\nwhen this sprite clicked\n\n@Difficulty\n\nwhen I receive [backstory v]\nswitch costume to (normal v)\nhide\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [options v]\nshow\ngo to x: (130) y: (40)\n\nwhen I receive [options v]\nforever\n    if <<touching (mouse v)?> and <mouse down?>> then\n        if <<(Difficulty Costume Number) = [1]> or <(Difficulty Costume Number) = [2]>> then\n            change [difficulty costume number v] by (1)\n            next costume\n            wait until <not <mouse down?>>\n        else\n            set [difficulty costume number v] to [1]\n            switch costume to (normal v)\n            wait until <not <mouse down?>>\n        end\n    end\nend\n\nwhen I receive [main menu v]\nforever\n    if <(costume [number v]) = [1]> then\n        set [difficulty change v] to [0.8]\n    end\n    if <(costume [number v]) = [2]> then\n        set [difficulty change v] to [1]\n    end\n    if <(costume [number v]) = [3]> then\n        set [difficulty change v] to [1.5]\n    end\nend\n\n@Music\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [options v]\nset [random 2 v] to [1]\nswitch costume to (random v)\nshow\ngo to x: (-156) y: (-103)\nforever\n    if <<touching (mouse v)?> and <mouse down?>> then\n        next costume\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I receive [options v]\nforever\n    if <<touching (mouse v)?> and <mouse down?>> then\n        set [override randomness v] to [true]\n        stop all sounds\n        if <(costume [number v]) = [1]> then\n            set [random 2 v] to [1]\n        end\n        if <(costume [number v]) = [2]> then\n            set [random 2 v] to [2]\n        end\n        if <(costume [number v]) = [3]> then\n            set [random 2 v] to [3]\n        end\n        if <(costume [number v]) = [4]> then\n            next costume\n        end\n    end\nend\n\nwhen I receive [main menu v]\nhide\n\n@Skip Prolog\n\nwhen I receive [backstory v]\nset [skip v] to [0]\nset [brightness v] effect to (-60)\nset [ghost v] effect to (100)\nshow\ngo to x: (-187) y: (159)\nrepeat (20)\n    wait (0.1) seconds\n    change [ghost v] effect by (-5)\nend\nwait (3) seconds\nset [brightness v] effect to (-40)\nwait (3) seconds\nset [brightness v] effect to (-20)\nwait (3) seconds\nset [brightness v] effect to (0)\n\nwhen this sprite clicked\nset [skip v] to [1]\nbroadcast (Backstory Over? v)\nhide\n\nwhen I receive [intro v]\nhide\n\n@Intro\n\nwhen I receive [backstory v]\nset [clone 1 or 2 v] to [1]\nhide\nswitch costume to (intro 2 v)\n\nwhen I receive [intro v]\ngo to x: (0) y: (0)\nchange [ghost v] effect by (100)\nshow\ngo to [front v] layer\nwait (8) seconds\nrepeat (25)\n    change [ghost v] effect by (-4)\n    wait (0.1) seconds\nend\nwait (1.8) seconds\nrepeat (2)\n    create clone of (_myself_ v)\n    wait (0.05) seconds\nend\nwait (8) seconds\nrepeat (5)\n    change [ghost v] effect by (20)\n    wait (0.1) seconds\nend\n\nwhen I start as a clone\nif <(Clone 1 or 2) = [1]> then\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    set [clone 1 or 2 v] to [2]\n    switch costume to (intro 1 v)\n    broadcast (Sword Sound Effect v)\n    repeat (10)\n        change [ghost v] effect by (-10)\n        wait (0.15) seconds\n    end\n    wait (6.5) seconds\n    repeat (5)\n        change [ghost v] effect by (20)\n        wait (0.1) seconds\n    end\nelse\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    switch costume to (intro 3 v)\n    repeat (10)\n        change [ghost v] effect by (-10)\n        wait (0.15) seconds\n    end\n    wait (6.5) seconds\n    repeat (5)\n        change [ghost v] effect by (20)\n        wait (0.1) seconds\n    end\nend\n\n@Sprite1\n\nwhen I receive [backstory v]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [intro v]\nswitch costume to (openwood presents v)\nshow\nwait (12) seconds\nhide\n\n@Customizable Ninja Nick\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [customize v]\ngo to x: (12) y: (-15)\nswitch costume to (headband red v)\nshow\ngo to [front v] layer\nforever\n    if <touching (mouse v)?> then\n        next costume\n        wait until <<not <touching (mouse v)?>> or <mouse down?>>\n        if <mouse down?> then\n            broadcast (Click Noise v)\n            wait until <<not <mouse down?>> and <not <touching (mouse v)?>>>\n        else\n            if <<not <touching (mouse v)?>> and <not <mouse down?>>> then\n                next costume\n                next costume\n            end\n        end\n    end\nend\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [backstory v]\nforever\n    set [colour v] to (costume [number v])\nend\n\n@Ninja Nick\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [main menu v]\nhide\n\ndefine Detect Customized Sprite\nif <(Colour) = [1]> then\n    set [right custom v] to [1]\n    set [left custom v] to [2]\nelse\n    if <(Colour) = [2]> then\n        set [right custom v] to [3]\n        set [left custom v] to [4]\n    else\n        if <(Colour) = [3]> then\n            set [right custom v] to [5]\n            set [left custom v] to [6]\n        end\n    end\nend\n\nwhen I receive [start game! v]\nset [multiplier v] to [1]\ngo to x: (-206) y: (-108)\nDetect Customized Sprite\nif <(Right Custom) = [1]> then\n    switch costume to (ninja right red v)\nend\nif <(Right Custom) = [3]> then\n    switch costume to (ninja right green v)\nend\nif <(Right Custom) = [5]> then\n    switch costume to (ninja right blue v)\nend\nshow\ngo to [front v] layer\n\nwhen I receive [start game! v]\nset [x v] to [0]\nset [y v] to [0]\nforever\n    change [y v] by (-1)\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        if <(Left Custom) = [2]> then\n            switch costume to (ninja left red v)\n        end\n        if <(Left Custom) = [4]> then\n            switch costume to (ninja left green v)\n        end\n        if <(Left Custom) = [6]> then\n            switch costume to (ninja left blue v)\n        end\n        change [x v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        if <(Right Custom) = [1]> then\n            switch costume to (ninja right red v)\n        end\n        if <(Right Custom) = [3]> then\n            switch costume to (ninja right green v)\n        end\n        if <(Right Custom) = [5]> then\n            switch costume to (ninja right blue v)\n        end\n        change [x v] by (1)\n    end\n    set [x v] to ((X) * (0.9))\n    change x by (X)\n    if <touching color (#666666)?> then\n        change y by (1)\n    end\n    if <touching color (#666666)?> then\n        change y by (1)\n    end\n    if <touching color (#666666)?> then\n        change y by (1)\n    end\n    if <touching color (#666666)?> then\n        change y by (1)\n    end\n    if <touching color (#666666)?> then\n        change y by (-4)\n        change x by ((X) * (-1))\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y v] to [10]\n            if <([abs v] of (X) ) = (X)> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (Y)\n    if <touching color (#666666)?> then\n        change y by ((Y) - ((Y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching color (#666666)?>> then\n        set [y v] to [8]\n    end\n    change y by (1)\n    if <<(x position) = [240]> or <(x position) > [240]>> then\n        change [level number v] by (1)\n        wait until <not <<(x position) = [240]> or <(x position) > [240]>>>\n    end\nend\n\nwhen I receive [level 2 v]\ngo to x: (-206) y: (-108)\n\nwhen I receive [death v]\nif <(Level Number) = [2]> then\n    go to x: (-206) y: (-108)\nend\nif <(Level Number) = [4]> then\n    go to x: (-206) y: (-108)\nend\nif <(Level Number) = [5]> then\n    go to x: (-206) y: (-108)\nend\nif <(Level Number) = [6]> then\n    go to x: (-206) y: (-108)\nend\nif <(Level Number) = [7]> then\n    go to x: (-206) y: (-108)\nend\nif <(Level Number) = [8]> then\n    go to x: (-206) y: (-108)\nend\nif <(Level Number) = [9]> then\n    go to x: (-188) y: (-109)\nend\nif <(Level Number) = [10]> then\n    go to x: (-188) y: (-109)\nend\nif <(Level Number) = [11]> then\n    go to x: (-206) y: (-108)\nend\nif <(Level Number) = [15]> then\n    go to x: (-199) y: (-108)\nend\n\nwhen I receive [backstory v]\nforever\n    if <(Health) < [1]> then\n        broadcast (Death v)\n    end\nend\n\nwhen I receive [level 6 v]\nset [cooldown v] to [0]\ngo to x: (-206) y: (-108)\n\nwhen I receive [level 3 v]\ngo to x: (-206) y: (-108)\n\nwhen I receive [level 4 v]\nset [attack v] to [4]\ngo to x: (-206) y: (-108)\nforever\n    if <key (space v) pressed?> then\n        set [attack v] to ((Attack) * (Multiplier))\n        broadcast (Attacking v)\n    end\nend\n\nwhen I receive [level 6 v]\nforever\n    set [top y v] to ((y position) + (30))\n    set [bottom y v] to ((y position) + (-25))\n    if <<(Detect Top Y) = [true]> or <(Detect Bottom Y) = [true]>> then\n        broadcast (Death v)\n        wait until <<not <(Detect Top Y) = [true]>> and <not <(Detect Bottom Y) = [true]>>>\n    end\nend\n\nwhen I receive [level 6 v]\nset [cooldown v] to [0]\ngo to x: (-206) y: (-108)\n\nwhen I receive [attach to ninja v]\nif <[-88] < (x position)> then\n    set x to (-89)\nend\n\nwhen I receive [attach to ninja v]\nforever\n    if <<[-90] < (x position)> and <key (s v) pressed?>> then\n        broadcast (Smash v)\n        stop [this script v]\n    else\n        if <[-88] < (x position)> then\n            set x to (-88)\n        end\n    end\nend\n\nwhen I receive [level 7 v]\nset [cooldown v] to [0]\ngo to x: (-206) y: (-108)\n\nwhen I receive [level 9 v]\ngo to [front v] layer\nset [cooldown v] to [0]\ngo to x: (-188) y: (-109)\nforever\n    if <key (space v) pressed?> then\n        set [attack v] to ((Attack) * (Multiplier))\n        broadcast (Attacking v)\n    end\nend\n\nwhen I receive [attach to ninja #2 v]\nforever\n    if <<[-85] < (x position)> and <key (s v) pressed?>> then\n        broadcast (Smash #2 v)\n        stop [this script v]\n    else\n        if <[-70] < (x position)> then\n            set x to (-70)\n        end\n    end\nend\n\nwhen I receive [level 11 v]\ngo to [front v] layer\nset [cooldown v] to [0]\ngo to x: (-206) y: (-108)\n\nwhen I receive [level 11 v]\nrepeat until <(Level Number) = [12]>\n    set [enter pressed? v] to <key (\n v) pressed?>\n    if <<[-190] < (x position)> and <<[-150] > (x position)> and <<(y position) = [-108]> and <(Enter Pressed?) = [true]>>>> then\n        set [hide zombie with hammer v] to [false]\n        set y to (84)\n    end\nend\n\nwhen I receive [level 13 v]\ngo to x: (-206) y: (-108)\n\nwhen I receive [level 9 v]\nrepeat until <(Level Number) = [11]>\n    set [enter pressed? v] to <key (\n v) pressed?>\n    if <<[-148] < (x position)> and <<[-94] > (x position)> and <<(y position) = [-108]> and <(Enter Pressed?) = [true]>>>> then\n        set [hide zombie with hammer v] to [false]\n        set y to (70)\n    end\n    if <<[89] < (x position)> and <<[142] > (x position)> and <(Enter Pressed?) = [true]>>> then\n        set y to (-109)\n    end\nend\n\nwhen I receive [level 12 v]\ngo to x: (-206) y: (-108)\n\nwhen I receive [level 14 v]\ngo to x: (-206) y: (-108)\n\nwhen I receive [level 15 // boss battle v]\ngo to x: (-199) y: (-108)\n\nwhen I receive [level 8 v]\ngo to [front v] layer\nset [cooldown v] to [0]\ngo to x: (-206) y: (-108)\n\nwhen I receive [level 10 v]\ngo to [front v] layer\nset [cooldown v] to [0]\ngo to x: (-188) y: (-109)\n\nwhen I receive [level 16 v]\ngo to x: (-206) y: (-108)\nforever\n    if <[-50] < (x position)> then\n        broadcast (Exclaim v)\n        go to x: (-50) y: (-70)\n        stop [other scripts in sprite v]\n    end\n    if <[-50] < (x position)> then\n        broadcast (Exclaim v)\n        go to x: (-50) y: (-70)\n        wait (0.01) seconds\n        stop [this script v]\n    end\nend\n\nwhen I receive [level 5 v]\ngo to x: (-206) y: (-108)\n\nwhen I receive [drop v]\nglide (0.75) secs to x: (-50) y: (-198)\nhide\nbroadcast (Finish v)\n\n@Head\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [customize v]\nshow\ngo to x: (12) y: (-15)\nswitch costume to (head v)\n\n@Block\n\ndefine None\nshow\nif <(number) = [6]> then\n    erase all\nend\nif <(number) = [5]> then\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change y by (20)\n    set x to (-216)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change y by (20)\n    set x to (92)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    set x to (114)\n    change y by (-160)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change x by (66)\n    change y by (40)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (0)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (-120)\n    change x by (-88)\n    change x by (-88)\n    change x by (-66)\n    stamp\n    change x by (-22)\n    stamp\n    change x by (-22)\n    stamp\n    change x by (-22)\n    stamp\n    change x by (-22)\n    stamp\n    change x by (-22)\n    stamp\n    change x by (-22)\n    stamp\n    change x by (-22)\n    stamp\n    change x by (-22)\n    stamp\n    change x by (-22)\n    stamp\n    change x by (-22)\n    stamp\n    hide\nend\nif <(number) = [4]> then\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change y by (20)\n    set x to (-216)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change y by (20)\n    set x to (92)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    set x to (114)\n    change y by (-160)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    hide\nend\nif <(number) = [1]> then\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change y by (20)\n    set x to (-216)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    hide\nend\nif <(number) = [3]> then\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change y by (20)\n    set x to (-216)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    hide\n    set x to (106)\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\n    change y by (20)\n    stamp\nend\nif <(number) = [2]> then\n    erase all\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (88)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change y by (20)\n    set x to (-216)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (88)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\n    change x by (22)\n    stamp\nend\ngo to x: (-216) y: (-173)\n\nwhen I receive [backstory v]\nerase all\nhide\n\nwhen I receive [start game! v]\nset [level number v] to [1]\nrepeat until <(Level Number) = [6]>\n    Create Level (Level Number)\nend\nerase all\nhide\n\n@Hole\n\nwhen I receive [level 2 v]\nshow\nset [deaths v] to [0]\ngo to x: (33) y: (-31)\nforever\n    if <touching (ninja nick v)?> then\n        broadcast (Death v)\n        wait until <not <touching (ninja nick v)?>>\n    end\nend\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [level 3 v]\nhide\n\n@Zombie\n\nwhen I receive [backstory v]\nset [health of zombie v] to [5]\nhide\n\nwhen I receive [level 4 v]\nswitch costume to (zombie left v)\nshow\ngo to [front v] layer\ngo to x: (42) y: (-116)\nforever\n    if <not <touching color (#666666)?>> then\n        change y by (-1)\n    end\nend\n\nwhen I receive [level 4 v]\nrepeat until <(Level Number) = [5]>\n    if <(x position) = [55]> then\n        change x by (-1)\n    end\nend\n\nwhen I receive [level 4 v]\nset [zombie attack damage v] to [-3]\nset [health of zombie v] to [5]\nshow\nforever\n    if <(x position) > ([x position v] of [ninja nick v])> then\n        switch costume to (zombie left v)\n        repeat until <not <(x position) > ([x position v] of [ninja nick v])>>\n            change x by (-1)\n        end\n    else\n        switch costume to (zombie right v)\n        repeat until <(x position) > ([x position v] of [ninja nick v])>\n            change x by (1)\n        end\n    end\n    if <touching (ninja nick v)?> then\n        broadcast (Hit v)\n        change [health v] by ((Zombie Attack Damage) * ((Defense) - (1)))\n        wait (0.5) seconds\n    end\nend\n\nwhen I receive [death v]\nif <(Level Number) = [4]> then\n    go to x: (42) y: (-116)\n    set [health of zombie v] to [5]\nend\nif <(Level Number) = [5]> then\n    set [health of zombie v] to [9]\nend\nif <(Level Number) = [7]> then\n    set [health of zombie v] to [25]\nend\nif <(Level Number) = [10]> then\n    set [health of zombie v] to [28]\nend\n\nwhen I receive [level 5 v]\nset [health of zombie v] to [9]\nshow\ngo to x: (-192) y: (104)\nforever\n    if <not <touching color (#666666)?>> then\n        change y by (-1)\n    end\n    if <(x position) = [-20]> then\n        change x by (-1)\n    end\nend\n\nwhen I receive [level 5 v]\nrepeat until <<(Level Number) = [6]> or <(Health Of Zombie) < [1]>>\n    if <touching (shuriken v)?> then\n        broadcast (Hit v)\n        set [health of zombie v] to ((Health Of Zombie) - ((Attack) * (Multiplier)))\n        if <<<(costume [number v]) = [1]> and <(x position) < [0]>> or <<(costume [number v]) = [2]> and <[-1] < (x position)>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n        if <<<(costume [number v]) = [1]> and <[-1] < (x position)>> or <<(costume [number v]) = [2]> and <(x position) < [0]>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (-1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n    end\n    if <(Health Of Zombie) < [1]> then\n        hide\n    end\nend\n\nwhen I receive [start game! v]\nhide\n\nwhen I receive [level 4 v]\nrepeat until <<(Level Number) = [6]> or <(Health Of Zombie) < [1]>>\n    if <touching (shuriken v)?> then\n        broadcast (Hit v)\n        set [health of zombie v] to ((Health Of Zombie) - ((Attack) * (Multiplier)))\n        if <<<(costume [number v]) = [1]> and <(x position) < [0]>> or <<(costume [number v]) = [2]> and <[-1] < (x position)>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n        if <<<(costume [number v]) = [1]> and <[-1] < (x position)>> or <<(costume [number v]) = [2]> and <(x position) < [0]>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (-1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n    end\n    if <(Health Of Zombie) < [1]> then\n        hide\n    end\nend\n\nwhen I receive [level 6 v]\nhide\nrepeat until <(Level Number) = [7]>\n    go to x: (500) y: (500)\nend\n\nwhen I receive [level 7 v]\nshow\nrepeat until <<(Level Number) = [8]> or <(Health Of Zombie) < [1]>>\n    if <touching (shuriken v)?> then\n        broadcast (Hit v)\n        set [health of zombie v] to ((Health Of Zombie) - ((Attack) * (Multiplier)))\n        if <<<(costume [number v]) = [1]> and <(x position) < [0]>> or <<(costume [number v]) = [2]> and <[-1] < (x position)>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n        if <<<(costume [number v]) = [1]> and <[-1] < (x position)>> or <<(costume [number v]) = [2]> and <(x position) < [0]>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (-1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n    end\n    if <(Health Of Zombie) < [1]> then\n        hide\n    end\nend\n\nwhen I receive [level 7 v]\ngo to x: (72) y: (133)\nset [zombie attack damage v] to [-6]\nset [health of zombie v] to [25]\nrepeat until <(Level Number) = [8]>\n    if <(x position) = [-19]> then\n        change x by (1)\n    end\n    if <(x position) = [110]> then\n        change x by (-1)\n    end\nend\n\nwhen I receive [level 8 v]\nhide\nrepeat until <(Level Number) = [10]>\n    go to x: (500) y: (500)\nend\n\nwhen I receive [level 10 v]\nset [health of zombie v] to [35]\nshow\ngo to x: (-30) y: (66)\nrepeat until <<(Level Number) = [11]> or <(Health Of Zombie) < [1]>>\n    if <touching (shuriken v)?> then\n        broadcast (Hit v)\n        set [health of zombie v] to ((Health Of Zombie) - ((Attack) * (Multiplier)))\n        if <<<(costume [number v]) = [1]> and <(x position) < [0]>> or <<(costume [number v]) = [2]> and <[-1] < (x position)>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n        if <<<(costume [number v]) = [1]> and <[-1] < (x position)>> or <<(costume [number v]) = [2]> and <(x position) < [0]>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (-1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n    end\n    if <(Health Of Zombie) < [1]> then\n        hide\n    end\nend\n\nwhen I receive [level 11 v]\nhide\n\n@Health Bar\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [level 4 v]\nshow\ngo to x: (-175) y: (156)\nforever\n    if <(Rounded Health) = [1]> then\n        switch costume to (1 heart v)\n    end\n    if <(Rounded Health) = [2]> then\n        switch costume to (2 hearts v)\n    end\n    if <(Rounded Health) = [3]> then\n        switch costume to (3 hearts v)\n    end\n    if <(Rounded Health) = [4]> then\n        switch costume to (4 hearts v)\n    end\n    if <(Rounded Health) = [5]> then\n        switch costume to (5 hearts v)\n    end\n    if <(Rounded Health) = [6]> then\n        switch costume to (6 hearts v)\n    end\n    if <(Rounded Health) = [7]> then\n        switch costume to (7 hearts v)\n    end\n    if <(Rounded Health) = [8]> then\n        switch costume to (8 hearts v)\n    end\n    if <(Rounded Health) = [9]> then\n        switch costume to (9 hearts v)\n    end\n    if <(Rounded Health) = [10]> then\n        switch costume to (10 hearts v)\n    end\nend\n\nwhen I receive [level 4 v]\nforever\n    set [rounded health v] to (round (Health))\nend\n\nwhen I receive [level 4 v]\nif <not <(Health) = [10]>> then\n    wait (10) seconds\n    change [health v] by (1)\nend\n\nwhen I receive [level 15 // boss battle v]\ngo to [front v] layer\n\nwhen I receive [end v]\nhide\n\n@Multiplier Powerup\n\nwhen I receive [backstory v]\nhide\n\nwhen I start as a clone\nif <(pick random (1) to (2)) = [1]> then\n    set [ghost v] effect to (0)\n    show\n    go to [front v] layer\n    change [attack v] by (1)\n    change [defense v] by (-0.1)\n    switch costume to (defence + attack v)\n    go to x: (0) y: (0)\n    set size to (90) %\n    repeat (25)\n        change size by (1)\n    end\n    wait (0.75) seconds\n    hide\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nelse\n    set [ghost v] effect to (0)\n    show\n    go to [front v] layer\n    change [cooldown of cooldown v] by (-0.1)\n    switch costume to (cooldown v)\n    go to x: (0) y: (0)\n    set size to (90) %\n    repeat (25)\n        change size by (1)\n    end\n    wait (0.75) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nend\n\nwhen I receive [level 5 v]\ngo to [front v] layer\nswitch costume to (closed v)\nshow\ngo to x: (-210) y: (98)\nset size to (50) %\nrepeat until <touching (ninja nick v)?>\n    repeat (16)\n        change y by (1)\n        change size by (0.5)\n    end\n    repeat (16)\n        change y by (-1)\n        change size by (-0.5)\n    end\nend\nset size to (50) %\ngo to x: (-210) y: (98)\nswitch costume to (open v)\nwait (0.2) seconds\nbroadcast (Powerup collected v)\ncreate clone of (_myself_ v)\nhide\nwait until <not <touching (ninja nick v)?>>\nset [ghost v] effect to (0)\nstop [this script v]\n\nwhen I receive [level 6 v]\nshow\nset [ghost v] effect to (0)\ngo to [front v] layer\nswitch costume to (closed v)\nshow\ngo to x: (-12) y: (-128)\nset size to (50) %\nrepeat until <touching (ninja nick v)?>\n    repeat (16)\n        change y by (1)\n        change size by (0.5)\n    end\n    repeat (16)\n        change y by (-1)\n        change size by (-0.5)\n    end\nend\nset size to (50) %\ngo to x: (-12) y: (-126)\nswitch costume to (open v)\nwait (0.2) seconds\nbroadcast (Powerup collected v)\ncreate clone of (_myself_ v)\nhide\nwait until <not <touching (ninja nick v)?>>\nset [ghost v] effect to (0)\nstop [this script v]\n\nwhen I receive [level 7 v]\nhide\n\n@Tips\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [start game! v]\nswitch costume to (tip 1 v)\nshow\ngo to x: (-5) y: (94)\n\nwhen I receive [level 2 v]\ngo to x: (12) y: (102)\nswitch costume to (tip 2 v)\nshow\n\nwhen I receive [level 3 v]\ngo to x: (12) y: (102)\nswitch costume to (tip 3 v)\nshow\n\nwhen I receive [level 4 v]\ngo to x: (2) y: (19)\nswitch costume to (tip 4 v)\nshow\n\nwhen I receive [level 5 v]\ngo to x: (2) y: (19)\nswitch costume to (tip 5 v)\nshow\n\nwhen I receive [level 6 v]\ngo to x: (6) y: (-35)\nshow\nswitch costume to (tip 6 v)\n\nwhen I receive [powerup collected v]\nhide\n\nwhen I receive [level 7 v]\ngo to x: (206) y: (16)\nshow\nswitch costume to (tip 7 v)\n\nwhen I receive [level 8 v]\ngo to x: (-150) y: (87)\nshow\nswitch costume to (tip 8 v)\n\nwhen I receive [level 9 v]\ngo to x: (-150) y: (87)\nshow\nswitch costume to (tip 9 v)\n\nwhen I receive [level 10 v]\ngo to x: (-127) y: (-21)\nshow\nswitch costume to (tip 10 v)\n\nwhen I receive [level 11 v]\ngo to x: (-127) y: (-21)\nshow\nswitch costume to (tip 11 v)\n\nwhen I receive [level 12 v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (tip 12 v)\n\nwhen I receive [level 13 v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (tip 13 v)\n\nwhen I receive [level 14 v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (tip 14 v)\n\nwhen I receive [level 15 // boss battle v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (tip 15 v)\n\nwhen I receive [level 16 v]\ngo to x: (135) y: (0)\nshow\nswitch costume to (tip 16 v)\n\nwhen I receive [drop hammer v]\nswitch costume to (tip extra v)\n\n@Spike\n\nwhen I receive [backstory v]\nset [hide v] to [false]\nhide\n\nwhen I start as a clone\nshow\ngo to x: (98) y: (-131)\nrepeat until <(Level Number) = [7]>\n    if <touching (ninja nick v)?> then\n        broadcast (Death v)\n        wait until <not <touching (ninja nick v)?>>\n    end\n    if <(Hide) = [true]> then\n        hide\n    end\nend\n\nwhen I receive [level 6 v]\nshow\ngo to x: (-118) y: (-131)\ncreate clone of (_myself_ v)\nrepeat until <(Level Number) = [7]>\n    if <touching (ninja nick v)?> then\n        broadcast (Death v)\n        wait until <not <touching (ninja nick v)?>>\n    end\nend\n\nwhen I receive [lift #1 v]\nset [hide v] to [true]\nhide\n\nwhen I receive [level 7 v]\nhide\n\n@Lava\n\nwhen I receive [backstory v]\nhide\nswitch costume to (lava v)\n\nwhen I receive [level 6 v]\nshow\ngo to x: (36) y: (-58)\nwait (0.25) seconds\nrepeat until <(Level Number) = [7]>\n    if <not <(costume [number v]) = [9]>> then\n        wait (0.15) seconds\n        next costume\n    else\n        switch costume to (lava v)\n    end\nend\n\nwhen I receive [level 6 v]\nrepeat until <(Level Number) = [7]>\n    if <touching (ninja nick v)?> then\n        go to [front v] layer\n        broadcast (Hit v)\n        change [health v] by ((-4) * ((Defense) - (1)))\n        wait (0.3) seconds\n    end\nend\n\nwhen I receive [level 7 v]\nhide\n\nwhen I receive [level 11 v]\nshow\ngo to x: (36) y: (-58)\nwait (0.25) seconds\nrepeat until <(Level Number) = [12]>\n    if <not <(costume [number v]) = [9]>> then\n        wait (0.15) seconds\n        next costume\n    else\n        switch costume to (lava v)\n    end\nend\n\nwhen I receive [level 11 v]\nrepeat until <(Level Number) = [12]>\n    if <touching (ninja nick v)?> then\n        go to [front v] layer\n        broadcast (Hit v)\n        change [health v] by ((-5) * ((Defense) - (1)))\n        wait (0.3) seconds\n    end\nend\n\nwhen I receive [level 12 v]\nhide\n\n@Pressure Plate\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [level 6 v]\nshow\ngo to x: (202) y: (-150)\nrepeat until <(Level Number) = [7]>\n    if <[179.99] < ([x position v] of [ninja nick v])> then\n        hide\n        broadcast (Click Noise v)\n        broadcast (Lift #1 v)\n        wait until <(Level Number) = [7]>\n    end\nend\n\nwhen I receive [level 7 v]\nshow\ngo to x: (-36) y: (-150)\nrepeat until <(Level Number) = [8]>\n    if <[-66] < ([x position v] of [ninja nick v])> then\n        hide\n        broadcast (Click Noise v)\n        broadcast (Lift #2 v)\n        wait until <(Level Number) = [8]>\n    end\nend\n\nwhen I receive [level 8 v]\nhide\n\n@Lift\n\nwhen I receive [lift #1 v]\nshow\nforever\n    if <not <(Level Number) = [6]>> then\n        stop [this script v]\n    else\n        go to [front v] layer\n        glide (6) secs to x: (143) y: (76)\n        wait (1) seconds\n        glide (6) secs to x: (143) y: (-132)\n        wait (1) seconds\n    end\nend\n\nwhen I receive [level 6 v]\ngo to [front v] layer\nshow\ngo to x: (143) y: (76)\n\nwhen I receive [level 8 v]\nhide\n\nwhen I receive [level 7 v]\nhide\n\nwhen I receive [backstory v]\nswitch costume to (lift #1 v)\nhide\n\n@Top Y\n\nwhen I receive [backstory v]\nset [detect top y v] to [false]\nhide\n\nwhen I receive [level 6 v]\nshow\nforever\n    go to x: ([x position v] of [ninja nick v]) y: (Top Y)\nend\n\nwhen I receive [level 6 v]\nforever\n    if <touching color (#666666)?> then\n        set [detect top y v] to [true]\n    end\n    if <not <touching color (#666666)?>> then\n        set [detect top y v] to [false]\n    end\nend\n\n@Bottom Y\n\nwhen I receive [backstory v]\nset [detect bottom y v] to [false]\nhide\n\nwhen I receive [level 6 v]\nshow\nforever\n    go to x: ([x position v] of [ninja nick v]) y: (Bottom Y)\nend\n\nwhen I receive [level 6 v]\nforever\n    if <touching color (#666666)?> then\n        set [detect bottom y v] to [true]\n    end\n    if <not <touching color (#666666)?>> then\n        set [detect bottom y v] to [false]\n    end\nend\n\n@Hammer\n\nwhen I receive [backstory v]\nset [stop attaching? v] to [false]\nhide\n\nwhen I receive [attach to ninja v]\nshow\nswitch costume to (hammer b v)\ngo to [front v] layer\nrepeat until <(Level Number) = [9]>\n    if <<([costume # v] of [ninja nick v]) = [1]> or <<([costume # v] of [ninja nick v]) = [3]> or <([costume # v] of [ninja nick v]) = [5]>>> then\n        switch costume to (hammer b v)\n        go to x: (([x position v] of [ninja nick v]) + (49)) y: (([y position v] of [ninja nick v]) - (4))\n    else\n        switch costume to (hammer c v)\n        go to x: (([x position v] of [ninja nick v]) - (24)) y: (([y position v] of [ninja nick v]) - (4))\n    end\nend\n\nwhen I receive [smash v]\nwait (0.75) seconds\nbroadcast (Breaking Hammer v)\nhide\nstop [this script v]\n\nwhen I receive [level 9 v]\nshow\nswitch costume to (hammer b v)\ngo to [front v] layer\nrepeat until <(Stop Attaching?) = [true]>\n    if <<([costume # v] of [zombie with hammer v]) = [2]> or <([costume # v] of [zombie with hammer v]) = [4]>> then\n        switch costume to (hammer b v)\n        go to x: (([x position v] of [zombie with hammer v]) + (60)) y: (([y position v] of [zombie with hammer v]) - (-8))\n    else\n        switch costume to (hammer c v)\n        go to x: (([x position v] of [zombie with hammer v]) - (35)) y: (([y position v] of [zombie with hammer v]) - (-9.5))\n    end\nend\n\nwhen I receive [level 8 v]\nswitch costume to (hammer a v)\nshow\ngo to x: (-27) y: (-132)\nrepeat until <(Level Number) = [9]>\n    if <<[-66] < ([x position v] of [ninja nick v])> and <key (e v) pressed?>> then\n        hide\n        broadcast (Attach To Ninja v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [drop hammer v]\nhide\nset [stop attaching? v] to [true]\nswitch costume to (hammer d v)\nset y to (63)\nset x to (-100)\nshow\ngo to [front v] layer\nrepeat until <(Level Number) = [10]>\n    if <<<([x position v] of [ninja nick v]) > [-75]> and <[-125] < ([x position v] of [ninja nick v])>> and <key (e v) pressed?>> then\n        reset timer\n        hide\n        broadcast (Attach To Ninja #2 v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [attach to ninja #2 v]\nshow\nswitch costume to (hammer b v)\ngo to [front v] layer\nrepeat until <(Level Number) = [10]>\n    if <<([costume # v] of [ninja nick v]) = [1]> or <<([costume # v] of [ninja nick v]) = [3]> or <([costume # v] of [ninja nick v]) = [5]>>> then\n        switch costume to (hammer b v)\n        go to x: (([x position v] of [ninja nick v]) + (49)) y: (([y position v] of [ninja nick v]) - (4))\n    else\n        switch costume to (hammer c v)\n        go to x: (([x position v] of [ninja nick v]) - (24)) y: (([y position v] of [ninja nick v]) - (4))\n    end\nend\n\nwhen I receive [smash #2 v]\nwait (0.75) seconds\nbroadcast (Breaking Hammer v)\nhide\nstop [this script v]\n\nwhen I receive [level 10 v]\nhide\n\n@Zombie With Hammer\n\nwhen I receive [backstory v]\nset [health of zombie v] to [25]\nset [hide zombie with hammer v] to [true]\nhide\n\nwhen I receive [level 9 v]\nset [zombie attack damage v] to [-6]\nset [health of zombie v] to [25]\ngo to x: (-30) y: (66)\nshow\nforever\n    if <(Hide Zombie With Hammer) = [false]> then\n        if <(x position) > ([x position v] of [ninja nick v])> then\n            switch costume to (zombie left v)\n            repeat until <not <(x position) > ([x position v] of [ninja nick v])>>\n                change x by (-1)\n            end\n        else\n            switch costume to (zombie right v)\n            repeat until <(x position) > ([x position v] of [ninja nick v])>\n                change x by (1)\n            end\n        end\n        if <touching (ninja nick v)?> then\n            broadcast (Hit v)\n            change [health v] by ((Zombie Attack Damage) * ((Defense) - (1)))\n            wait (0.5) seconds\n        end\n    end\nend\n\nwhen I receive [death v]\nif <(Level Number) = [9]> then\n    if <(Hide Zombie With Hammer) = [false]> then\n        go to x: (-30) y: (66)\n        set [health of zombie v] to [25]\n    end\nend\n\nwhen I receive [level 9 v]\nforever\n    if <(Hide Zombie With Hammer) = [false]> then\n        if <not <touching color (#666666)?>> then\n            change y by (-1)\n        end\n        if <(x position) = [-20]> then\n            change x by (-1)\n        end\n    end\nend\n\nwhen I receive [level 9 v]\nrepeat until <(Level Number) = [10]>\n    if <(Hide Zombie With Hammer) = [false]> then\n        if <(x position) = [-225]> then\n            change x by (1)\n        end\n        if <(x position) = [-29]> then\n            change x by (-1)\n        end\n    end\nend\n\nwhen I receive [level 9 v]\nrepeat until <<(Level Number) = [10]> or <(Health Of Zombie) < [1]>>\n    if <(Hide Zombie With Hammer) = [false]> then\n        if <touching (shuriken v)?> then\n            broadcast (Hit v)\n            set [health of zombie v] to ((Health Of Zombie) - ((Attack) * (Multiplier)))\n            if <<<(costume [number v]) = [1]> and <(x position) < [0]>> or <<(costume [number v]) = [2]> and <[-1] < (x position)>>> then\n                if <(costume [number v]) = [1]> then\n                    switch costume to (zombie left damaged v)\n                else\n                    switch costume to (zombie right damaged v)\n                end\n                repeat (5)\n                    change x by (1)\n                end\n                if <(costume [number v]) = [3]> then\n                    switch costume to (zombie left v)\n                else\n                    switch costume to (zombie right v)\n                end\n            end\n            if <<<(costume [number v]) = [1]> and <[-1] < (x position)>> or <<(costume [number v]) = [2]> and <(x position) < [0]>>> then\n                if <(costume [number v]) = [1]> then\n                    switch costume to (zombie left damaged v)\n                else\n                    switch costume to (zombie right damaged v)\n                end\n                repeat (5)\n                    change x by (-1)\n                end\n                if <(costume [number v]) = [3]> then\n                    switch costume to (zombie left v)\n                else\n                    switch costume to (zombie right v)\n                end\n            end\n        end\n        if <(Health Of Zombie) < [1]> then\n            broadcast (Drop Hammer v)\n            hide\n        end\n    end\nend\n\nwhen I receive [level 10 v]\nhide\n\n@Lift #2\n\nwhen I receive [backstory v]\nswitch costume to (lift #2 v)\nhide\n\nwhen I receive [lift #2 v]\nshow\ngo to x: (-82) y: (92)\nforever\n    if <not <(Level Number) = [7]>> then\n        hide\n        stop [this script v]\n    else\n        go to [front v] layer\n        glide (6) secs to x: (-82) y: (92)\n        wait (1) seconds\n        glide (6) secs to x: (-82) y: (-132)\n        wait (1) seconds\n    end\nend\n\nwhen I receive [level 7 v]\nhide\nswitch costume to (lift #2 v)\ngo to x: (-82) y: (92)\n\nwhen I receive [level 8 v]\nhide\n\n@Golden Zombie\n\nwhen I receive [backstory v]\nset [zombie attack damage v] to [-6]\nset [health of zombie v] to [35]\nhide\n\nwhen I receive [death v]\nif <(Level Number) = [11]> then\n    set [health of zombie v] to [35]\nend\n\nwhen I receive [start game! v]\nhide\n\nwhen I receive [level 11 v]\nswitch costume to (zombie left v)\nshow\ngo to [front v] layer\ngo to x: (-90) y: (85)\nrepeat until <<(Level Number) = [6]> or <(Health Of Zombie) < [1]>>\n    if <touching (ninja nick v)?> then\n        broadcast (Hit v)\n        change [health v] by ((Zombie Attack Damage) * ((Defense) - (1)))\n        wait (0.5) seconds\n    end\n    if <not <touching color (#666666)?>> then\n        change y by (-1)\n    end\n    if <[-5] < (x position)> then\n        change x by (-1)\n    end\n    if <touching (shuriken v)?> then\n        broadcast (Hit v)\n        set [health of zombie v] to ((Health Of Zombie) - ((Attack) * (Multiplier)))\n        if <<<(costume [number v]) = [1]> and <(x position) < [0]>> or <<(costume [number v]) = [2]> and <[-1] < (x position)>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n        if <<<(costume [number v]) = [1]> and <[-1] < (x position)>> or <<(costume [number v]) = [2]> and <(x position) < [0]>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (-1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n    end\n    if <(Health Of Zombie) < [1]> then\n        broadcast (11 B v)\n        broadcast (Smash #3 v)\n        hide\n    end\nend\n\nwhen I receive [level 11 v]\nforever\n    if <(x position) > ([x position v] of [ninja nick v])> then\n        switch costume to (zombie left v)\n        repeat until <not <(x position) > ([x position v] of [ninja nick v])>>\n            change x by (-1)\n        end\n    else\n        switch costume to (zombie right v)\n        repeat until <(x position) > ([x position v] of [ninja nick v])>\n            change x by (1)\n        end\n    end\nend\n\nwhen I receive [level 12 v]\nhide\n\n@Boss Zombie\n\nwhen I receive [backstory v]\nset [boss health v] to [100]\nhide\ngo to x: (0) y: (-30)\n\nwhen I receive [level 15 // boss battle v]\nset [boss health v] to [100]\nshow\nbroadcast (ROAR v)\n\nwhen I receive [death v]\nif <<(Level Number) = [15]> and <(Boss Health) < [91]>> then\n    change [boss health v] by (10)\n    broadcast (Increase By 10 v)\n    wait (0.5) seconds\nend\n\nwhen I receive [level 15 // boss battle v]\nforever\n    if <(Boss Health) < [1]> then\n        broadcast (Dead Boss v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [dead boss v]\nbroadcast (ROAR v)\nrepeat (50)\n    change [brightness v] effect by (2)\nend\nrepeat (50)\n    change [brightness v] effect by (-2)\n    change [ghost v] effect by (2)\nend\nstop [this script v]\n\nwhen I receive [level 16 v]\nhide\n\n@Rock\n\nwhen I start as a clone\ngo to x: (pick random (-170) to (170)) y: (115)\nshow\nset [randfall v] to (pick random (-6) to (-12))\nrepeat until <<touching (ninja nick v)?> or <touching color (#666666)?>>\n    turn right (25) degrees\n    change y by (RandFall)\nend\nif <touching (ninja nick v)?> then\n    change [health v] by ((-5) * ((Defense) - (1)))\n    broadcast (Hit v)\n    hide\nelse\n    hide\n    broadcast (Breaking Hammer v)\nend\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [level 15 // boss battle v]\nrepeat until <(Boss Health) < [1]>\n    wait until <not <(Boss Health) < [1]>>\n    set [done b v] to [false]\n    wait (pick random (1) to (3)) seconds\n    wait until <not <(Boss Health) < [1]>>\n    repeat (pick random (1) to (3))\n        create clone of (_myself_ v)\n        wait (pick random (1) to (3)) seconds\n    end\n    wait until <not <(Boss Health) < [1]>>\n    set [done b v] to [true]\n    wait until <<(Done A) = [true]> and <(Done B) = [true]>>\n    wait until <not <(Boss Health) < [1]>>\n    wait (1) seconds\n    wait until <(Horde Alive) = [0]>\n    wait until <not <(Boss Health) < [1]>>\nend\n\nwhen I receive [level 15 // boss battle v]\nset [rock death v] to [false]\nrepeat until <(Boss Health) < [1]>\n    set [done a v] to [false]\n    wait until <not <(Boss Health) < [1]>>\n    wait (pick random (1) to (3)) seconds\n    wait until <not <(Boss Health) < [1]>>\n    repeat (pick random (1) to (3))\n        create clone of (_myself_ v)\n        wait (pick random (1) to (3)) seconds\n    end\n    wait until <not <(Boss Health) < [1]>>\n    set [done a v] to [true]\n    wait until <<(Done A) = [true]> and <(Done B) = [true]>>\n    wait until <not <(Boss Health) < [1]>>\n    broadcast (Horde v)\n    wait (1) seconds\n    wait until <(Horde Alive) = [0]>\n    wait until <not <(Boss Health) < [1]>>\nend\n\nwhen I start as a clone\nforever\n    if <(Rock Death) = [true]> then\n        delete this clone\n    end\nend\n\nwhen I receive [dead boss v]\nset [rock death v] to [true]\n\n@Boss Bar\n\ndefine Create Inner Bar\ngo to [front v] layer\npen up\ngo to x: (-149) y: (-160)\nset pen size to (10)\nset pen color to (#f68b04)\npen down\ngo to x: (149) y: (-160)\n\ndefine Create Outter Bar\ngo to [front v] layer\npen up\ngo to x: (-150) y: (-160)\nset pen size to (20)\nset pen color to (#f4eecf)\npen down\ngo to x: (150) y: (-160)\n\nwhen I receive [level 15 // boss battle v]\nset [bar colour v] to [0]\ngo to [front v] layer\nerase all\nCreate Outter Bar\nCreate Inner Bar\nSlowly Clear Screen\n\ndefine Slowly Clear Screen\ngo to [front v] layer\npen up\ngo to x: (149) y: (-160)\nset pen size to (10)\nset pen color to (#f4eecf)\npen down\nforever\n    if <(Bar Colour) = [0]> then\n        set pen color to (#f4eecf)\n        go to x: ((149) + (((Boss Health) - (100)) * (2.98))) y: (-160)\n    else\n        set pen color to (#f68b04)\n        go to x: ((149) + (((Boss Health) - (100)) * (2.98))) y: (-160)\n        set [bar colour v] to [0]\n    end\nend\n\nwhen I receive [increase by 10 v]\nset [bar colour v] to [1]\n\nwhen I receive [dead boss v]\npen up\nwait (0.5) seconds\nerase all\n\n@Zombie Horde\n\nwhen I receive [backstory v]\nswitch costume to (zombie left v)\nhide\n\nwhen I receive [horde v]\nset [horde death v] to [false]\nset [horde alive v] to [3]\nset [health of zombie v] to [20]\nset [zombie attack damage v] to [-4]\nrepeat (3)\n    create clone of (_myself_ v)\n    wait (pick random (0.1) to (0.5)) seconds\nend\n\nwhen I start as a clone\nforever\n    if <(x position) > ([x position v] of [ninja nick v])> then\n        switch costume to (zombie left v)\n        repeat until <not <(x position) > ([x position v] of [ninja nick v])>>\n            change x by (-1)\n        end\n    else\n        switch costume to (zombie right v)\n        repeat until <(x position) > ([x position v] of [ninja nick v])>\n            change x by (1)\n        end\n    end\nend\n\nwhen I receive [dead boss v]\nset [horde death v] to [true]\n\nwhen I start as a clone\nshow\ngo to [front v] layer\ngo to x: (pick random (50) to (185)) y: (-111)\nrepeat until <<(Level Number) = [16]> or <(Health Of Zombie) < [1]>>\n    if <touching (ninja nick v)?> then\n        broadcast (Hit v)\n        change [health v] by ((Zombie Attack Damage) * ((Defense) - (1)))\n        wait (0.5) seconds\n    end\n    if <not <touching color (#666666)?>> then\n        change y by (-1)\n    end\n    if <touching (shuriken v)?> then\n        broadcast (Hit v)\n        set [health of zombie v] to ((Health Of Zombie) - ((Attack) * (Multiplier)))\n        if <<<(costume [number v]) = [1]> and <(x position) < [0]>> or <<(costume [number v]) = [2]> and <[-1] < (x position)>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n        if <<<(costume [number v]) = [1]> and <[-1] < (x position)>> or <<(costume [number v]) = [2]> and <(x position) < [0]>>> then\n            if <(costume [number v]) = [1]> then\n                switch costume to (zombie left damaged v)\n            else\n                switch costume to (zombie right damaged v)\n            end\n            repeat (5)\n                change x by (-1)\n            end\n            if <(costume [number v]) = [3]> then\n                switch costume to (zombie left v)\n            else\n                switch costume to (zombie right v)\n            end\n        end\n    end\n    if <(Health Of Zombie) < [1]> then\n        change [boss health v] by (-10)\n        change [horde alive v] by (-1)\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Horde Death) = [true]> then\n        delete this clone\n    end\nend\n\n@Exclaim\n\nwhen I receive [backstory v]\nhide\n\nwhen I receive [exclaim v]\nset [ghost v] effect to (100)\nshow\ngo to x: (-50) y: (-10)\nrepeat (10)\n    change [ghost v] effect by (-10)\n    wait (0.05) seconds\nend\nwait (0.2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (0.05) seconds\nend\nbroadcast (Smash #4 v)\nbroadcast (Drop v)\n\n@Sprite2\n\nwhen I receive [backstory v]\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [end v]\nshow\ngo to x: (27) y: (3)\nrepeat (50)\n    change [ghost v] effect by (-2)\n    wait (0.01) seconds\nend\n\n@Crystal\n\nwhen I receive [backstory v]\nset [drop v] to [false]\nhide\n\nwhen I receive [level 16 v]\ngo to x: (5) y: (-60)\npoint in direction (90)\nshow\nrepeat until <(Drop) = [true]>\n    repeat (10)\n        change size by (1)\n        wait (0.01) seconds\n    end\n    repeat (10)\n        change size by (-1)\n        wait (0.01) seconds\n    end\nend\n\nwhen I receive [drop v]\npoint in direction (90)\nset [drop v] to [true]\nset size to (100) %\nglide (0.6) secs to x: (5) y: (-198)\nhide\n\nwhen I receive [drop v]\nforever\n    turn right (10) degrees\nend\n\n