The Ninja 4
@Stage\n\nset volume to (0) %\n\nwhen I receive [refresh level v]\nset [number en ninj setter v] to [0]\nset [number of targets v] to [0]\nset [ninja stars v] to [0]\nset [arrows v] to []\nset [mini spears v] to [0]\nset [spears v] to [5]\nset [delete clones v] to [1]\nwait (0.005) seconds\nset [delete clones v] to [0]\nswitch backdrop to ((Level) + (1))\n\nwhen [9 v] key pressed\nif <key (0 v) pressed?> then\n    fasdf\n    broadcast (Refresh Level v)\nend\n\nwhen [o v] key pressed\nchange [level v] by (1)\nbroadcast (Refresh Level v) and wait\nwait until <not <key (o v) pressed?>>\n\nwhen [i v] key pressed\nbroadcast (Allow grapple v)\nbroadcast (Got Bow v)\nbroadcast (Got katana v)\nwait (0.02) seconds\nset [weapons unlocked v] to [4]\nset [arrows v] to [4000]\nset [ninja stars v] to [4000]\n\nset [arrows v] to [0]\n\nwhen [r v] key pressed\nbroadcast (Refresh Level v) and wait\nwait until <not <key (r v) pressed?>>\n\nwhen I receive [refresh level v]\nbroadcast (Delete all clones!! v)\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in stage v]\nstop all sounds\nforever\n    play sound [aup thing v] until done\nend\n\nset [weapons unlocked v] to [4]\n\nwhen I receive [start v]\nset volume to (100) %\nset [level v] to [1]\nhide variable [boss hp v]\nhide variable [hp v]\nbroadcast (Refresh Level v)\nforever\n    play sound [the ninja reg v] until done\nend\n\nwhen [p v] key pressed\nchange [level v] by (-1)\nbroadcast (Refresh Level v) and wait\nwait until <not <key (p v) pressed?>>\n\ndefine fasdf\nset [scroll # for stage v] to [0]\nrepeat (500)\n    change [scroll # for stage v] by (1)\n    if <(item (scroll # for stage) of [air plat level v]) = (Level)> then\n        delete (scroll # for stage) of [air plat level v]\n        delete (scroll # for stage) of [air plat x v]\n        delete (scroll # for stage) of [air plat y v]\n        delete (scroll # for stage) of [air plat type v]\n        change [scroll # for stage v] by (-1)\n    end\n    if <(item (scroll # for stage) of [target level v]) = (Level)> then\n        delete (scroll # for stage) of [target level v]\n        delete (scroll # for stage) of [target x v]\n        delete (scroll # for stage) of [target y v]\n        delete (scroll # for stage) of [target type v]\n        change [scroll # for stage v] by (-1)\n    end\n    if <(item (scroll # for stage) of [platform level v]) = (Level)> then\n        delete (scroll # for stage) of [platform level v]\n        delete (scroll # for stage) of [platform x v]\n        delete (scroll # for stage) of [platform y v]\n        delete (scroll # for stage) of [platform type v]\n        change [scroll # for stage v] by (-1)\n    end\n    if <(item (scroll # for stage) of [enemy ninja level v]) = (Level)> then\n        delete (scroll # for stage) of [enemy ninja level v]\n        delete (scroll # for stage) of [enemy ninja x v]\n        delete (scroll # for stage) of [enemy ninja y v]\n        delete (scroll # for stage) of [enemy ninja type v]\n        change [scroll # for stage v] by (-1)\n    end\n    if <(item (scroll # for stage) of [fish level v]) = (Level)> then\n        delete (scroll # for stage) of [fish level v]\n        delete (scroll # for stage) of [fish x v]\n        delete (scroll # for stage) of [fish y v]\n        change [scroll # for stage v] by (-1)\n    end\n    if <(item (scroll # for stage) of [star level v]) = (Level)> then\n        delete (scroll # for stage) of [star level v]\n        delete (scroll # for stage) of [star x v]\n        delete (scroll # for stage) of [star y v]\n        change [scroll # for stage v] by (-1)\n    end\n    if <(item (scroll # for stage) of [arrow level v]) = (Level)> then\n        delete (scroll # for stage) of [arrow level v]\n        delete (scroll # for stage) of [arrow x v]\n        delete (scroll # for stage) of [arrow y v]\n        change [scroll # for stage v] by (-1)\n    end\nend\n\n@The ninja\n\nwhen [y v] key pressed\nif <key (t v) pressed?> then\n    if <(length of [start y v]) > ((Level) - (1))> then\n        replace item (Level) of [start x v] with (mouse x)\n        replace item (Level) of [start y v] with (mouse y)\n    else\n        add (mouse x) to [start x v]\n        add (mouse y) to [start y v]\n    end\n    broadcast (refresh level v)\nend\n\nwhen I receive [ninja move down v]\nchange y by (-3)\n\nwhen I receive [ninja move up v]\nchange y by (3)\n\nwhen I receive [move with water platform v]\nchange x by (Water platform touching Xv)\n\nwhen I receive [start v]\nset size to (100) %\nset [able to jump v] to [1]\nset [weapons unlocked v] to [0]\nshow\nwait (0.5) seconds\nforever\n    set [nusdna nblkc dfv lkjasdvb lkajdsfvlkjb v] to (direction)\n    if <(Weapon selected) = [4]> then\n        point in direction (nusdna nblkc dfv lkjasdvb lkajdsfvLKJB)\n        switch costume to (the ninja3 v)\n        if <<touching color (#000000)?> or <(y position) < [-173]>> then\n            switch costume to (the ninja2 v)\n            point in direction (90)\n        end\n    else\n        switch costume to (the ninja2 v)\n        point in direction (90)\n    end\n    if <(y position) < [-173]> then\n        broadcast (refresh level v) and wait\n    end\n    if <<(x position) > [235]> or <<(Weapon selected) = [4]> and <(x position) > [230]>>> then\n        change [level v] by (1)\n        broadcast (refresh level v) and wait\n    end\n    if <not <(Kama Controlled) = [1]>> then\n        change [yv v] by (-0.5)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        if <not <(Kama Controlled) = [1]>> then\n            change [xv v] by (0.7)\n        end\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        if <not <(Kama Controlled) = [1]>> then\n            change [xv v] by (-0.7)\n        end\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change x by ((Xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            change x by (1)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Yv)\n    if <touching color (#000000)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <(Able to Jump) = [1]> then\n                set [yv v] to [10]\n            end\n        end\n    end\n    if <touching color (#63d571)?> then\n        broadcast (refresh level v) and wait\n    end\n    change y by (1)\n    point in direction (nusdna nblkc dfv lkjasdvb lkajdsfvLKJB)\n    switch costume to (the ninja v)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (-90)\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <color (#ffe9cc) is touching (#82c8ff)?> then\n        change [yv v] by (0.4)\n        change y by (-1)\n        if <touching color (#000000)?> then\n            set [yv v] to [0]\n        end\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <touching color (#000000)?> then\n                set [yv v] to [7]\n            else\n                change [yv v] by (0.6)\n            end\n        end\n        change y by (1)\n        set [yv v] to ((Yv) * (0.9))\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            change [xv v] by (-0.1)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            change [yv v] by (0.1)\n        end\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            change [yv v] by (-0.4)\n        end\n    end\nend\n\nwhen I receive [start v]\nforever\n    wait until <color (#ffe9cc) is touching (#82c8ff)?>\n    wait until <<not <color (#ffe9cc) is touching (#82c8ff)?>> and <not <touching (katana v)?>>>\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        start sound [recording1 v]\n        set [yv v] to [7]\n    end\nend\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\nswitch costume to (the ninja3 v)\n\nwhen I receive [refresh level v]\nhide\nwait (0.05) seconds\ngo to x: (item (Level) of [start x v]) y: (item (Level) of [start y v])\nset [yv v] to [0]\nset [xv v] to [0]\nshow\n\n@Moving platform\n\nwhen flag clicked\nhide\n\nwhen [c v] key pressed\nif <key (0 v) pressed?> then\n    broadcast (Delete all clones!! v)\n    repeat until <not <key (c v) pressed?>>\n        go to (mouse-pointer v)\n        show\n        point in direction (90)\n        set [ghost v] effect to (50)\n        if <key (v v) pressed?> then\n            next costume\n            wait (0.1) seconds\n        end\n        if <mouse down?> then\n            add (Level) to [air plat level v]\n            add (x position) to [air plat x v]\n            add (y position) to [air plat y v]\n            add (costume [number v]) to [air plat type v]\n            wait until <not <mouse down?>>\n        end\n    end\n    clear graphic effects\n    hide\nend\n\nwhen I receive [refresh level v]\nwait (0.01) seconds\nhurry app\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    show\n    forever\n        repeat (20)\n            change y by (-3)\n            if <touching color (#000000)?> then\n                change y by (3)\n            end\n            change y by (6)\n            if <touching (the ninja v)?> then\n                broadcast (Ninja Move down v)\n            end\n            change y by (-6)\n            change y by (-6)\n            if <touching (grappling hook v)?> then\n                broadcast (Grapple Move Down v)\n            end\n            change y by (6)\n        end\n        wait (0.5) seconds\n        repeat (20)\n            change y by (3)\n            if <touching color (#000000)?> then\n                change y by (-3)\n            end\n            change y by (6)\n            if <touching (the ninja v)?> then\n                broadcast (Ninja move up v)\n            end\n            change y by (-6)\n            change y by (-6)\n            if <touching (grappling hook v)?> then\n                broadcast (Grapple Move Up v)\n            end\n            change y by (6)\n        end\n        wait (0.5) seconds\n    end\nend\n\nset [yv v] to [3]\n\ndefine hurry app\nwait (0) seconds\nset size to (100) %\npoint in direction (90)\nif <[air plat level v] contains (Level)?> then\n    set [scroll # v] to [1]\n    repeat (length of [air plat level v])\n        if <(item (Scroll #) of [air plat level v]) = (Level)> then\n            switch costume to (item (Scroll #) of [air plat type v])\n            go to x: (item (Scroll #) of [air plat x v]) y: (item (Scroll #) of [air plat y v])\n            create clone of (_myself_ v)\n        end\n        change [scroll # v] by (1)\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    show\n    forever\n        change x by (4)\n        repeat until <touching color (#000000)?>\n            change y by (-3)\n            if <touching (grappling hook v)?> then\n                broadcast (Grapple move right v)\n            end\n            change y by (3)\n            change x by (4)\n            change y by (3)\n            if <touching (the ninja v)?> then\n                set [xv v] to [4.5]\n            end\n            change y by (-3)\n            if <touching (the ninja v)?> then\n            end\n        end\n        wait (0.5) seconds\n        change x by (-4)\n        repeat until <touching color (#000000)?>\n            change y by (-3)\n            if <touching (grappling hook v)?> then\n                broadcast (Grapple move left v)\n            end\n            change y by (3)\n            change x by (-4)\n            change y by (3)\n            if <touching (the ninja v)?> then\n                set [xv v] to [-4.5]\n            end\n            change y by (-3)\n            if <touching (the ninja v)?> then\n            end\n        end\n        wait (0.5) seconds\n    end\nend\n\nset [xv v] to [7]\n\nset [xv v] to [-7]\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\nwhen I start as a clone\nwait until <(delete clones) = [1]>\ndelete this clone\n\n@Shurikens/knives\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    set [indiv star bad 4 u?? v] to [0]\n    set rotation style [left-right v]\n    go to (the ninja v)\n    point in direction ([direction v] of [the ninja v])\n    move (5) steps\n    change y by (-4)\n    clear graphic effects\n    show\n    set rotation style [all around v]\n    start sound [ninja katana v]\n    set [ninja star xv v] to ((direction) / (9))\n    repeat until <<<touching color (#000000)?> or > or <touching (_edge_ v)?>>\n        change x by (ninja star Xv)\n        turn right (25) degrees\n    end\n    if <touching (_edge_ v)?> then\n        delete this clone\n    else\n        wait (0.05) seconds\n        if <<touching color (#000000)?> or <touching color (#7f7f7f)?>> then\n            change x by ((ninja star Xv) / (-2))\n            if <<touching color (#000000)?> or <touching color (#7f7f7f)?>> then\n                change x by ((ninja star Xv) / (-2))\n                if <<touching color (#000000)?> or <touching color (#7f7f7f)?>> then\n                    change x by ((ninja star Xv) / (-2))\n                end\n            end\n            change x by ((ninja star Xv) / (2))\n            wait (0.1) seconds\n            set [ninja star yv v] to [0]\n            repeat (50)\n                if <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>> then\n                    change [ninja star yv v] by (-0.5)\n                    change y by (ninja star Yv)\n                end\n                change [ghost v] effect by (2)\n            end\n        end\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    forever\n        if <touching color (#b5c2c9)?> then\n            set [ninja star xv v] to ((ninja star Xv) * (-1))\n            wait until <not <touching color (#b5c2c9)?>>\n            wait (0.1) seconds\n            set [indiv star bad 4 u?? v] to [1]\n        end\n        if <<(indiv star BAD 4 U??) = [1]> and <touching (katana v)?>> then\n            set [ninja star xv v] to ((ninja star Xv) * (-1))\n            set [indiv star bad 4 u?? v] to [0]\n            wait until <not <touching (katana v)?>>\n            wait (0.1) seconds\n        end\n        if <<(indiv star BAD 4 U??) = [1]> and <touching (the ninja v)?>> then\n            broadcast (Refresh Level v)\n        end\n    end\nend\n\nwhen I receive [refresh level v]\nwait (0.01) seconds\nhurry\n\nwhen I start as a clone\nwait until <(delete clones) = [1]>\ndelete this clone\n\nwhen [6 v] key pressed\nif <key (0 v) pressed?> then\n    broadcast (Delete all clones!! v)\n    repeat until <not <key (6 v) pressed?>>\n        go to (mouse-pointer v)\n        show\n        point in direction (90)\n        set [ghost v] effect to (50)\n        if <mouse down?> then\n            add (Level) to [star level v]\n            add (x position) to [star x v]\n            add (y position) to [star y v]\n            wait until <not <mouse down?>>\n        end\n    end\n    clear graphic effects\n    hide\nend\n\nwhen I receive [delete all clones!! v]\ndelete this clone\n\ndefine hurry\nwait (0) seconds\nset size to (100) %\npoint in direction (90)\nif <[star level v] contains (Level)?> then\n    set [scroll # v] to [1]\n    repeat (length of [star level v])\n        if <(item (Scroll #) of [star level v]) = (Level)> then\n            switch costume to (hover v)\n            go to x: (item (Scroll #) of [star x v]) y: (item (Scroll #) of [star y v])\n            create clone of (_myself_ v)\n        end\n        change [scroll # v] by (1)\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    set [gotten v] to [1]\n    wait until <not <touching (the ninja v)?>>\n    set rotation style [all around v]\n    point in direction (90)\n    clear graphic effects\n    show\n    forever\n        repeat (20)\n            turn right (5) degrees\n            change y by (0.2)\n            if <touching (the ninja v)?> then\n                change [ninja stars v] by (1)\n                set rotation style [all around v]\n                start sound [recording1 v]\n                repeat (10)\n                    change y by (3)\n                    change [ghost v] effect by (10)\n                    turn right (20) degrees\n                end\n                set [gotten v] to [0]\n                delete this clone\n            end\n        end\n        repeat (20)\n            turn right (5) degrees\n            change y by (-0.2)\n            if <touching (the ninja v)?> then\n                change [ninja stars v] by (1)\n                set rotation style [all around v]\n                start sound [recording1 v]\n                repeat (10)\n                    change y by (3)\n                    change [ghost v] effect by (10)\n                    turn right (20) degrees\n                end\n                set [gotten v] to [0]\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nhide\nforever\n    if <key (space v) pressed?> then\n        if <(Weapon selected) = [1]> then\n            if <(Ninja stars) > [0]> then\n                switch costume to (shoot v)\n                create clone of (_myself_ v)\n                change [ninja stars v] by (-1)\n                wait until <not <key (space v) pressed?>>\n            end\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\n@Walls\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nhide\n\nwhen backdrop switches to [backdrop6 v]\nswitch costume to (costume1 v)\ngoes away\n\ndefine goes away\nset [ghost v] effect to (100)\nclear graphic effects\nshow\nwait until <(Number of Targets) > [0]>\nwait until <(Number of Targets) < [1]>\nrepeat (5)\n    change [ghost v] effect by (20)\nend\nwait until <(delete clones) = [1]>\n\nwhen backdrop switches to [backdrop8 v]\nswitch costume to (costume2 v)\ngoes away\n\nwhen I receive [refresh level v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [backdrop10 v]\nswitch costume to (costume3 v)\ngoes away\n\nwhen backdrop switches to [backdrop21 v]\nswitch costume to (costume4 v)\ngoes away\n\nwhen backdrop switches to [backdrop27 v]\nswitch costume to (costume5 v)\ngoes away\n\nwhen backdrop switches to [backdrop30 v]\nswitch costume to (costume6 v)\ngoes away\n\nwhen backdrop switches to [backdrop33 v]\nswitch costume to (costume7 v)\ngets formed\n\ndefine gets formed\nclear graphic effects\nset [ghost v] effect to (100)\nshow\nwait until <(Number of Targets) > [0]>\nwait until <(Number of Targets) < [1]>\nrepeat (5)\n    change [ghost v] effect by (-20)\nend\nwait until <(delete clones) = [1]>\n\nbroadcast (Refresh Level v)\n\nwhen backdrop switches to [backdrop38 v]\nswitch costume to (costume8 v)\ngoes away\n\nwhen backdrop switches to [backdrop40 v]\nswitch costume to (costume9 v)\ngoes away\n\nwhen backdrop switches to [backdrop42 v]\nswitch costume to (costume11 v)\ngoes away\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\n@Targets\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nchange [number of targets v] by (1)\nshow\nwait until <<<touching color (#20270c)?> or <<<touching color (#525945)?> or <<touching color (#373937)?> or <touching color (#2d321a)?>>> or <<touching color (#b1b0a7)?> or <touching color (#b0acb4)?>>>> and <not <touching (katana v)?>>>\nstart sound [recording3 v]\nif <(costume [number v]) = [5]> then\n    next costume\nend\nrepeat (3)\n    next costume\n    wait (0.05) seconds\nend\nhide\nchange [number of targets v] by (-1)\ndelete this clone\n\nwhen I receive [delete all clones!! v]\ndelete this clone\n\nwhen I start as a clone\nwait until <(delete clones) = [1]>\ndelete this clone\n\nwhen I receive [refresh level v]\nwait (0.01) seconds\nhyrry\n\ndefine hyrry\nwait (0) seconds\nset size to (100) %\npoint in direction (90)\nif <[target level v] contains (Level)?> then\n    set [scroll # v] to [1]\n    repeat (length of [target level v])\n        if <(item (Scroll #) of [target level v]) = (Level)> then\n            switch costume to (item (Scroll #) of [target type v])\n            go to x: (item (Scroll #) of [target x v]) y: (item (Scroll #) of [target y v])\n            create clone of (_myself_ v)\n        end\n        change [scroll # v] by (1)\n    end\nend\n\nwhen [b v] key pressed\nif <key (0 v) pressed?> then\n    broadcast (Delete all clones!! v)\n    repeat until <not <key (b v) pressed?>>\n        go to (mouse-pointer v)\n        show\n        point in direction (90)\n        set [ghost v] effect to (50)\n        if <key (x v) pressed?> then\n            next costume\n            wait (0.1) seconds\n        end\n        if <mouse down?> then\n            add (Level) to [target level v]\n            add (x position) to [target x v]\n            add (y position) to [target y v]\n            add (costume [number v]) to [target type v]\n            wait until <not <mouse down?>>\n        end\n    end\n    clear graphic effects\n    hide\nend\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\nrepeat (50)\n    change x by (1)\n    if  then\n        stop [this script v]\n    end\nend\n\n@Weapon\n\nwhen flag clicked\nset [weapon selected v] to [1]\nset [weapons unlocked v] to [0]\nhide\n\nwhen backdrop switches to [backdrop5 v]\nset [ninja stars v] to [0]\nswitch costume to ((Ninja stars) + (1))\nshow\nset [weapons unlocked v] to [1]\nforever\n    if <(Weapon selected) = [2]> then\n        switch costume to (costume10 v)\n    end\n    if <(Weapon selected) = [1]> then\n        switch costume to ((Ninja stars) + (1))\n    end\n    if <(Weapon selected) = [3]> then\n        switch costume to (costume12 v)\n    end\n    if <(Weapon selected) = [4]> then\n        switch costume to ((Arrows) + (13))\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <<key (z v) pressed?> or <key (m v) pressed?>> then\n        change [weapon selected v] by (1)\n        if <(Weapon selected) > (Weapons Unlocked)> then\n            set [weapon selected v] to [1]\n        end\n        if <(Weapon selected) = [2]> then\n            broadcast (GRGRGRGRGRGLAKSDMNF:LKNSD:LVCN v)\n        end\n        wait until <not <<key (z v) pressed?> or <key (m v) pressed?>>>\n    end\n    if <key (1 v) pressed?> then\n        if <(Weapons Unlocked) > [0]> then\n            set [weapon selected v] to [1]\n        end\n        wait until <not <key (1 v) pressed?>>\n    end\n    if <key (2 v) pressed?> then\n        if <(Weapons Unlocked) > [1]> then\n            set [weapon selected v] to [2]\n            broadcast (GRGRGRGRGRGLAKSDMNF:LKNSD:LVCN v)\n        end\n        wait until <not <key (2 v) pressed?>>\n    end\n    if <key (3 v) pressed?> then\n        if <(Weapons Unlocked) > [2]> then\n            set [weapon selected v] to [3]\n        end\n        wait until <not <key (3 v) pressed?>>\n    end\n    if <key (4 v) pressed?> then\n        if <(Weapons Unlocked) > [3]> then\n            set [weapon selected v] to [4]\n        end\n        wait until <not <key (4 v) pressed?>>\n    end\n    if <key (5 v) pressed?> then\n        if <(Weapons Unlocked) > [4]> then\n            set [weapon selected v] to [5]\n        end\n        wait until <not <key (5 v) pressed?>>\n    end\nend\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\n@katana\n\nwhen I receive [got katana v]\nset [weapons unlocked v] to [2]\nset [weapon selected v] to [2]\nhide\nset [currently sword swinging v] to [0]\nforever\n    if <(Weapon selected) = [2]> then\n        if <key (space v) pressed?> then\n            go to (the ninja v)\n            point in direction ([direction v] of [the ninja v])\n            clear graphic effects\n            set size to (100) %\n            change y by (20)\n            show\n            start sound [ninja katana v]\n            if <(direction) > [10]> then\n                point in direction (90)\n                switch costume to (swing v)\n                set [currently sword swinging v] to [1]\n                repeat (10)\n                    turn right (30) degrees\n                    go to (the ninja v)\n                end\n                set [currently sword swinging v] to [0]\n                hide\n                wait until <not <key (space v) pressed?>>\n            else\n                point in direction (90)\n                switch costume to (swing2 v)\n                set [currently sword swinging v] to [1]\n                repeat (10)\n                    turn right (-30) degrees\n                    go to (the ninja v)\n                end\n                set [currently sword swinging v] to [0]\n                hide\n                wait until <not <key (space v) pressed?>>\n            end\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop12 v]\nset [weapons unlocked v] to [1]\nset [weapon selected v] to [1]\nstop [other scripts in sprite v]\nswitch costume to (hover v)\nshow\ngo to x: (-1) y: (-36)\nclear graphic effects\npoint in direction (90)\nset size to (100) %\nforever\n    repeat (20)\n        if <touching (the ninja v)?> then\n            broadcast (Got katana v)\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            stop [this script v]\n        end\n        change y by (0.25)\n    end\n    repeat (20)\n        if <touching (the ninja v)?> then\n            broadcast (Got katana v)\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            stop [this script v]\n        end\n        change y by (-0.25)\n    end\nend\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\nforever\nend\n\nturn left (15) degrees\n\nwhen flag clicked\nhide\n\n@Grappling Hook\n\ndefine detect ground\nset [grapple distance/tiem v] to [0]\nrepeat until <<touching color (#000000)?> or <touching (_edge_ v)?>>\n    change y by (6)\n    change [grapple distance/tiem v] by (2)\nend\n\nwhen backdrop switches to [backdrop14 v]\nstop [other scripts in sprite v]\nset [weapons unlocked v] to [2]\nif <(Weapon selected) = [3]> then\n    set [weapon selected v] to [1]\nend\n\ndefine bruh just grapple\npen up\ngo to (the ninja v)\npen down\ngo to x: (That grapple X) y: (That Grapple Y)\n\nwhen I receive [allow grapple v]\nhide\nerase all\nforever\n    if <key (space v) pressed?> then\n        if <(Weapon selected) = [3]> then\n            set [grapple got moved v] to [0]\n            set [grapple yyy got moved v] to [0]\n            set pen size to (2)\n            set pen color to (#c88330)\n            set pen shade to (25)\n            pen up\n            erase all\n            set size to (60) %\n            set [grappled v] to [0]\n            show\n            go to (the ninja v)\n            detect ground\n            if <<touching (_edge_ v)?> or <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>>> then\n            else\n                switch costume to (costume2 v)\n                freakin work >:/\n                set [that grapple y v] to (y position)\n                set [that grapple x v] to (x position)\n                pen up\n                erase all\n                go to (the ninja v)\n                pen down\n                set [grapple amount got there v] to [0]\n                go to (the ninja v)\n                switch costume to (costume1 v)\n                repeat until <(y position) > ((That Grapple Y) - (30))>\n                    pen up\n                    erase all\n                    go to x: (That grapple X) y: (That Grapple Y)\n                    point towards (the ninja v)\n                    turn right (180) degrees\n                    go to (the ninja v)\n                    pen down\n                    change [grapple amount got there v] by (30)\n                    if <touching color (#82c8ff)?> then\n                        change [grapple amount got there v] by (-10)\n                    end\n                    move (Grapple amount got there) steps\n                    point in direction (90)\n                end\n                change y by (30)\n                freakin work >:/\n                set [that grapple x v] to (x position)\n                set [that grapple y v] to (y position)\n                switch costume to (costume2 v)\n                if <<touching color (#000000)?> or <touching color (#7f7f7f)?>> then\n                    set [grappled v] to [1]\n                    switch costume to (costume2 v)\n                    wait until <<not <key (space v) pressed?>> or <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>>>\n                    wait until <<<<key (space v) pressed?> and <(Weapon selected) = [3]>> or <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>>> or <(delete clones) = [1]>>\n                    set [yv v] to [3]\n                else\n                end\n            end\n            set [grappled v] to [0]\n            hide\n            erase all\n            wait until <not <key (space v) pressed?>>\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop18 v]\nset [weapons unlocked v] to [2]\nset [weapon selected v] to [2]\nstop [other scripts in sprite v]\nswitch costume to (hover v)\nshow\ngo to x: (-1) y: (-70)\nclear graphic effects\npoint in direction (90)\nset size to (100) %\nforever\n    repeat (20)\n        if <touching (the ninja v)?> then\n            broadcast (Allow grapple v)\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            stop [this script v]\n        end\n        change y by (0.25)\n    end\n    repeat (20)\n        if <touching (the ninja v)?> then\n            broadcast (Allow grapple v)\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            stop [this script v]\n        end\n        change y by (-0.25)\n    end\nend\n\nwhen flag clicked\nhide\nerase all\n\nwhen I receive [allow grapple v]\nset [weapons unlocked v] to [3]\nset [weapon selected v] to [3]\nwait (0.6) seconds\nclear graphic effects\nerase all\n\nwhen I receive [grapple move down v]\nchange y by (-3)\nchange [grapple yyy got moved v] by (-3)\nchange [yv v] by (-3)\n\nwhen I receive [grpal arldy v]\nrepeat until <<not <(Grappled) = [1]>> or <(BOSSISGRPLIN'BRUH) = [0]>>\n    bruh just grapple\nend\n\nwhen I receive [grapple move right v]\nchange [grapple got moved v] by (4)\n\nwhen I receive [grapple move left v]\nchange [grapple got moved v] by (-4)\n\nwhen I receive [grapple move up v]\nchange [grapple yyy got moved v] by (3)\nchange [yv v] by (3)\nchange y by (3)\n\nswitch costume to (costume1 v)\n\nchange y by (10)\n\nrepeat (3)\nend\n\nswitch costume to (costume2 v)\n\nswitch costume to (costume2 v)\n\nwhen I receive [allow grapple v]\nforever\n    if <(Grappled) = [1]> then\n        erase all\n        set [xv v] to ((Xv) + (((x position) - ([x position v] of [the ninja v])) / (50)))\n        if <(Xv) > [15]> then\n            set [xv v] to [15]\n        end\n        if <(Xv) < [-15]> then\n            set [xv v] to [-15]\n        end\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [yv v] to [4]\n        else\n            if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n                set [yv v] to [-4]\n            else\n                set [yv v] to [0.5]\n            end\n        end\n        pen up\n        go to (the ninja v)\n        pen down\n        go to x: ((That grapple X) + (Grapple got moved)) y: ((That Grapple Y) + (Grapple YYY got moved))\n        if <([y position v] of [the ninja v]) > ((y position) - (10))> then\n            change [yv v] by ((((y position) - (10)) - ([y position v] of [the ninja v])) / (3))\n        end\n    else\n    end\nend\n\nwhen I receive [refresh level v]\nset [grapple got moved v] to [0]\nset [grapple yyy got moved v] to [0]\nset [grapple amount got there v] to [0]\nset [grappled v] to [0]\nerase all\npen up\nhide\n\nhide\n\nswitch costume to (for sensing *eyeroll* v)\nif <not <<<<key (space v) pressed?> and <(Weapon selected) = [3]>> or <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>>> or <(delete clones) = [1]>>> then\n    switch costume to (costume2 v)\nelse\nend\n\nswitch costume to (for sensing *eyeroll* v)\n\nswitch costume to (for sensing *eyeroll* v)\nif <not <<not <key (space v) pressed?>> or <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>>>> then\nend\n\nchange y by (5)\n\nchange y by (-5)\nrepeat until <<<touching color (#000000)?> or <touching color (#7f7f7f)?>> or <touching (_edge_ v)?>>\n    change y by (1)\nend\n\nmove (10) steps\n\nmove (Grapple amount got there) steps\n\ndefine freakin work >:/\nchange y by (-30)\nrepeat until <<<touching color (#000000)?> or <touching color (#7f7f7f)?>> or <touching (_edge_ v)?>>\n    change y by (3)\nend\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\n@Floating Logs\n\nwhen I start as a clone\nforever\n    change y by (2)\n    if <touching (the ninja v)?> then\n        if <<(y position) < (([y position v] of [the ninja v]) - (8))> and <<(x position) > (([x position v] of [the ninja v]) - (25))> and <(x position) < (([x position v] of [the ninja v]) + (25))>>> then\n            change y by (-2)\n            if <([abs v] of (Xv) ) > ([abs v] of (Indiv Xv) )> then\n                set [indiv xv v] to ((Xv) + ((([x position v] of [the ninja v]) - (x position)) / (8)))\n            end\n            set [indiv yv v] to ((Yv) * (0.1))\n            set [yv v] to (indiv Yv)\n            set [xv v] to ((Indiv Xv) * (0.3))\n            repeat until <not <touching (the ninja v)?>>\n                set [yv v] to ((indiv Yv) + (0.5))\n                change y by (-2)\n                if <touching (the ninja v)?> then\n                    set [yv v] to [1.5]\n                end\n                change y by (2)\n                if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                    set [yv v] to [10]\n                end\n                change y by (10)\n                set [water platform touching xv v] to (Indiv Xv)\n                broadcast (Move with water platform v)\n                if <touching (the ninja v)?> then\n                    change y by (-10)\n                end\n            end\n        else\n            change y by (-2)\n            set [yv v] to (((Yv) * (-0.5)) - (1))\n            set [indiv yv v] to ((Yv) * (-1))\n            set [xv v] to ((([x position v] of [the ninja v]) - (x position)) / (10))\n            set [indiv xv v] to ((Xv) * (-1))\n        end\n    else\n        change y by (-2)\n    end\nend\n\nwhen I start as a clone\nset [indiv yv v] to [0]\nshow\nforever\n    change y by (0)\n    if <<touching color (#82c8ff)?> or <touching color (#63d571)?>> then\n        set [indiv yv v] to ((indiv Yv) * (0.7))\n        change y by (5)\n        if <<touching color (#82c8ff)?> or <touching color (#63d571)?>> then\n            change [indiv yv v] by (1)\n        else\n        end\n        change y by (-5)\n    else\n        change [indiv yv v] by (-0.5)\n        set [indiv xv v] to ((Indiv Xv) * (0.8))\n        if <(indiv Yv) < [-9]> then\n            set [indiv yv v] to [-9]\n        end\n    end\n    change y by (0)\n    change y by (indiv Yv)\n    if <touching color (#000000)?> then\n        change y by ((indiv Yv) * (-1))\n        set [indiv yv v] to [0]\n        set [indiv xv v] to ((Indiv Xv) * (0.92))\n    end\n    change x by (Indiv Xv)\n    if <touching color (#000000)?> then\n        change x by ((Indiv Xv) * (-1))\n        set [indiv xv v] to ((Indiv Xv) * (-0.2))\n    end\n    set [indiv xv v] to ((Indiv Xv) * (0.99))\n    if <(y position) < [-179]> then\n        delete this clone\n    end\nend\n\nwhen I receive [delete all clones!! v]\ndelete this clone\n\nwhen [j v] key pressed\nif <key (0 v) pressed?> then\n    broadcast (Delete all clones!! v)\n    repeat until <not <key (j v) pressed?>>\n        go to (mouse-pointer v)\n        show\n        point in direction (90)\n        set [ghost v] effect to (50)\n        if <key (k v) pressed?> then\n            next costume\n            wait (0.1) seconds\n        end\n        if <mouse down?> then\n            add (Level) to [platform level v]\n            add (x position) to [platform x v]\n            add (y position) to [platform y v]\n            add (costume [number v]) to [platform type v]\n            wait until <not <mouse down?>>\n        end\n    end\n    clear graphic effects\n    hide\nend\n\ndefine hurry\nwait (0) seconds\nset size to (100) %\npoint in direction (90)\nif <[platform level v] contains (Level)?> then\n    set [scroll # v] to [1]\n    repeat (length of [platform level v])\n        if <(item (Scroll #) of [platform level v]) = (Level)> then\n            switch costume to (costume1 v)\n            go to x: (item (Scroll #) of [platform x v]) y: (item (Scroll #) of [platform y v])\n            create clone of (_myself_ v)\n        end\n        change [scroll # v] by (1)\n    end\nend\n\nwhen I receive [refresh level v]\nwait (0.01) seconds\nhurry\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nhide\n\n@Enemy Ninjas\n\nif <(pick random (1) to (40)) = [1]> then\n    turn right (180) degrees\nend\n\nif <(Indiv sword dir.) < [-210]> then\n    set [indiv sword dir. v] to [-90]\nend\n\nwait (pick random (0.1) to (0.2)) seconds\n\nif <(distance to [the ninja v]) < [70]> then\n\nwait (0.6) seconds\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    forever\n        switch costume to (funnel face xd v)\n        if <<<touching color (#b0acb4)?> or <touching color (#b1b0a7)?>> or <<(indiv purple able to swing because of player.) = [1]> and <(distance to [the ninja v]) < [70]>>> then\n            if <(direction) < [90]> then\n                set [indiv sword dir. v] to [89]\n            else\n                set [indiv sword dir. v] to [90]\n            end\n            set [indiv xv v] to [0]\n            start sound [enmy ninja katana v]\n            repeat (10)\n                if <(Indiv sword dir.) < [90]> then\n                    set [indiv sword dir. v] to ((Indiv sword dir.) + (-30))\n                    switch costume to (p enemy sword2 v)\n                    create clone of (_myself_ v)\n                    switch costume to (purple enemy v)\n                else\n                    set [indiv sword dir. v] to ((Indiv sword dir.) + (30))\n                    switch costume to (p enemy sword v)\n                    create clone of (_myself_ v)\n                    switch costume to (purple enemy v)\n                end\n                if <(Indiv sword dir.) > [390]> then\n                    set [indiv sword dir. v] to [90]\n                end\n            end\n            set [indiv purple able to swing because of player. v] to [0]\n        else\n            switch costume to (purple enemy v)\n        end\n        if <(indiv purple able to swing because of player.) < [1]> then\n            change [indiv purple able to swing because of player. v] by (0.05)\n        else\n            set [indiv purple able to swing because of player. v] to [1]\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    set rotation style [left-right v]\n    show\n    set [indiv yv v] to [0]\n    set [indiv xv v] to [0]\n    set [indiv purple able to swing because of player. v] to [1]\n    forever\n        change [indiv yv v] by (-0.5)\n        set [indiv xv v] to ((Indiv Xv) * (0.9))\n        if <([abs v] of ((x position) - ([x position v] of [the ninja v])) ) < [30]> then\n            set [indiv xv v] to ((Indiv Xv) * (0.35))\n        end\n        change x by (Indiv Xv)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (1)\n                            if <touching color (#000000)?> then\n                                change x by ((Indiv Xv) * (-1))\n                                change x by (-1)\n                                change y by (-5)\n                                change x by (1)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (Indiv Yv)\n        if <touching color (#000000)?> then\n            change y by ((Indiv Yv) * (-1))\n            set [indiv yv v] to [0]\n        end\n        if <([x position v] of [the ninja v]) < (x position)> then\n            change [indiv xv v] by (-0.2)\n            if <not <(distance to [the ninja v]) < [150]>> then\n                change [indiv xv v] by (-0.2)\n            end\n            if <not <(distance to [the ninja v]) < [100]>> then\n                change [indiv xv v] by (-0.1)\n            end\n        end\n        if <([x position v] of [the ninja v]) > (x position)> then\n            change [indiv xv v] by (0.2)\n            if <not <(distance to [the ninja v]) < [150]>> then\n                change [indiv xv v] by (0.3)\n            end\n            if <not <(distance to [the ninja v]) < [100]>> then\n                change [indiv xv v] by (0.1)\n            end\n        end\n        if <not <([abs v] of ((x position) - ([x position v] of [the ninja v])) ) < [30]>> then\n            point towards (the ninja v)\n            if <(direction) > [0]> then\n                point in direction (90)\n            else\n                point in direction (-90)\n            end\n            change x by (Indiv Xv)\n            if <<(([y position v] of [the ninja v]) - (50)) > (y position)> or <<touching color (#000000)?> and <([abs v] of (Indiv Xv) ) > [4]>>> then\n                change x by ((Indiv Xv) * (-1))\n                change y by (-2)\n                if <touching color (#000000)?> then\n                    set [indiv yv v] to [9]\n                end\n                change y by (2)\n                change x by (Indiv Xv)\n            end\n            change x by ((Indiv Xv) * (-1))\n        end\n    end\nend\n\nwhen I receive [refresh level v]\nwait (0.01) seconds\nhurrys\n\nwhen [g v] key pressed\nif <key (0 v) pressed?> then\n    broadcast (delete all clones!! v)\n    repeat until <not <key (g v) pressed?>>\n        go to (mouse-pointer v)\n        show\n        point in direction (90)\n        set [ghost v] effect to (50)\n        if <key (h v) pressed?> then\n            next costume\n            wait (0.1) seconds\n        end\n        if <mouse down?> then\n            add (Level) to [enemy ninja level v]\n            add (x position) to [enemy ninja x v]\n            add (y position) to [enemy ninja y v]\n            add (costume [number v]) to [enemy ninja type v]\n            wait until <not <mouse down?>>\n        end\n    end\n    clear graphic effects\n    hide\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    wait (pick random (0) to (0.9)) seconds\n    forever\n        wait (pick random (1.5) to (1.5)) seconds\n        if <<(size) = [100]> and <<not <([abs v] of ((x position) - ([x position v] of [the ninja v])) ) < ([abs v] of ((y position) - ([y position v] of [the ninja v])) )>> or <([y position v] of [the ninja v]) > ((y position) + (40))>>> then\n            switch costume to (enemy star v)\n            create clone of (_myself_ v)\n            switch costume to (gray enemy v)\n        end\n    end\nend\n\n\n\nswitch costume to (gray enemy v)\n\nwhen I start as a clone\nif <(costume [number v]) = [4]> then\n    show\n    switch costume to (enemy star v)\n    set size to (100) %\n    clear graphic effects\n    go to [front v] layer\n    set rotation style [all around v]\n    point towards (the ninja v)\n    set [indiv yv v] to (([cos v] of (direction) ) * (6))\n    set [indiv xv v] to (([sin v] of (direction) ) * (6))\n    forever\n        change x by (Indiv Xv)\n        change y by (Indiv Yv)\n        turn right (25) degrees\n        if <<touching (the ninja v)?> and <(costume [number v]) = [4]>> then\n            broadcast (refresh level v) and wait\n        end\n        if <<touching (_edge_ v)?> or <<touching color (#000000)?> or <<(costume [number v]) = [4]> and <<touching color (#b1b0a7)?> or <touching color (#b0acb4)?>>>>> then\n            if <touching (_edge_ v)?> then\n                delete this clone\n            else\n                change x by ((Indiv Xv) * (1))\n                change y by ((Indiv Yv) * (1))\n            end\n            wait (0.05) seconds\n            set [indiv yv v] to [0]\n            repeat (10)\n                change [ghost v] effect by (10)\n                if <not <touching color (#000000)?>> then\n                    change [indiv yv v] by (-0.5)\n                end\n                change y by (Indiv Yv)\n            end\n            delete this clone\n        end\n        if <<touching (katana v)?> and <(costume [number v]) = [4]>> then\n            set [indiv xv v] to ((Indiv Xv) * (-1))\n            set [indiv yv v] to ((Indiv Yv) * (-1))\n            switch costume to (enemy star reflected v)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    set rotation style [left-right v]\n    forever\n        repeat (pick random (5) to (0))\n            point towards (the ninja v)\n            if <(distance to [the ninja v]) < [90]> then\n                change [indiv xv v] by (([sin v] of ((direction) * (-1)) ) * (3))\n                if <(Indiv Xv) > [2.5]> then\n                    set [indiv xv v] to [2.5]\n                end\n                if <(Indiv Xv) < [-2.5]> then\n                    set [indiv xv v] to [-2.5]\n                end\n                change x by ((Indiv Xv) * (3))\n                change y by (-5)\n                if <not <touching color (#000000)?>> then\n                    change x by ((Indiv Xv) * (-3))\n                    set [indiv xv v] to ((Indiv Xv) * (-0.5))\n                else\n                    change x by ((Indiv Xv) * (-3))\n                end\n                change y by (5)\n            end\n            if <(pick random (1) to (50)) = [1]> then\n                move (55) steps\n                if <touching color (#b1b0a7)?> then\n                    change y by (-5)\n                    move (-55) steps\n                    if <<touching color (#000000)?> or <touching color (#7f7f7f)?>> then\n                        set [indiv yv v] to [7]\n                    end\n                    move (55) steps\n                    change y by (5)\n                end\n                move (-55) steps\n            end\n        end\n        if <(direction) < [0]> then\n            point in direction (-90)\n        else\n            point in direction (90)\n        end\n        if <(pick random (0) to (round (((0.1) * (distance to [the ninja v])) + (0)))) = [0]> then\n            repeat (pick random (4) to (20))\n                change x by (30)\n                change y by (-3)\n                if <touching color (#000000)?> then\n                    change y by (6)\n                    if <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>> then\n                        change [indiv xv v] by (0.6)\n                    end\n                    change y by (-6)\n                else\n                    set [indiv xv v] to [0]\n                end\n                if <<touching color (#b1b0a7)?> and <(pick random (20) to (1)) = [1]>> then\n                    set [indiv yv v] to [7]\n                end\n                change x by (-30)\n                change y by (3)\n            end\n        end\n        if <(pick random (0) to (round (((0.1) * (distance to [the ninja v])) + (0)))) = [0]> then\n            repeat (pick random (4) to (20))\n                change x by (-30)\n                change y by (-3)\n                if <touching color (#000000)?> then\n                    change y by (6)\n                    if <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>> then\n                        change [indiv xv v] by (-0.6)\n                    end\n                    change y by (-6)\n                else\n                    set [indiv xv v] to [0]\n                end\n                if <<touching color (#b1b0a7)?> and <(pick random (20) to (1)) = [1]>> then\n                    set [indiv yv v] to [7]\n                end\n                change x by (30)\n                change y by (3)\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    show\n    set [indiv yv v] to [0]\n    set [indiv xv v] to [0]\n    forever\n        change [indiv yv v] by (-0.5)\n        set [indiv xv v] to ((Indiv Xv) * (0.8))\n        change x by (Indiv Xv)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (1)\n                            if <touching color (#000000)?> then\n                                change x by ((Indiv Xv) * (-1))\n                                change x by (-1)\n                                change y by (-5)\n                                change x by (1)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (Indiv Yv)\n        if <touching color (#000000)?> then\n            change y by ((Indiv Yv) * (-1))\n            set [indiv yv v] to [0]\n        end\n        if <(y position) < [-180]> then\n            delete this clone\n        end\n    end\nend\n\nmove ((direction) / (-3)) steps\nchange y by (-3)\nif <touching color (#000000)?> then\n    change y by (6)\n    if <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>> then\n        change [indiv xv v] by (-0.6)\n    end\n    change y by (-6)\nelse\n    change x by ((Indiv Xv) * (-5))\n    set [indiv xv v] to [0]\nend\nif <<touching color (#b1b0a7)?> and <(pick random (20) to (1)) = [1]>> then\n    set [indiv yv v] to [7]\nend\nmove ((direction) / (3)) steps\nchange y by (3)\n\nmove ((direction) / (3)) steps\nchange y by (-3)\nif <touching color (#000000)?> then\n    change y by (6)\n    if <not <<touching color (#000000)?> or <touching color (#7f7f7f)?>>> then\n        change [indiv xv v] by (0.6)\n    end\n    change y by (-6)\nelse\n    change x by ((Indiv Xv) * (-5))\n    set [indiv xv v] to [0]\nend\nif <<touching color (#b1b0a7)?> and <(pick random (20) to (1)) = [1]>> then\n    set [indiv yv v] to [7]\nend\nmove ((direction) / (-3)) steps\nchange y by (3)\n\nchange x by ((Indiv Xv) * (-5))\n\nchange x by ((Indiv Xv) * (-5))\n\ndefine hurrys\nwait (0) seconds\nset size to (100) %\npoint in direction (90)\nif <[enemy ninja level v] contains (Level)?> then\n    set [scroll # v] to [1]\n    repeat (length of [enemy ninja level v])\n        if <(item (Scroll #) of [enemy ninja level v]) = (Level)> then\n            switch costume to (item (Scroll #) of [enemy ninja type v])\n            go to x: (item (Scroll #) of [enemy ninja x v]) y: (item (Scroll #) of [enemy ninja y v])\n            create clone of (_myself_ v)\n        end\n        change [scroll # v] by (1)\n    end\nend\n\nwhen I start as a clone\nif <<(costume [number v]) = [6]> or <(costume [number v]) = [7]>> then\n    set rotation style [all around v]\n    point in direction (Indiv sword dir.)\n    wait (0) seconds\n    if <<touching (the ninja v)?> and <not <(Currently Sword Swinging) = [1]>>> then\n        broadcast (refresh level v)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <<(costume [number v]) = [1]> or <(costume [number v]) = [2]>> then\n    forever\n        if <<touching (katana v)?> or <<touching color (#525945)?> or <<touching color (#2b2e2b)?> or <<touching color (#2d321a)?> or <touching color (#20270c)?>>>>> then\n            start sound [killd v]\n            repeat (5)\n                change [ghost v] effect by (20)\n                change size by (-16)\n            end\n            delete this clone\n        end\n        if <(y position) < [-175]> then\n            delete this clone\n        end\n    end\nend\n\nset size to (100) %\n\nwhen flag clicked\nhide\n\nwhen I receive [delete all clones!! v]\ndelete this clone\n\nwait (0) seconds\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\n@Bow\n\nchange y by (Indiv arrow Yv)\n\nset [indiv arrow yv v] to ((Indiv arrow Yv) * (0.7))\n\nset size to (110) %\n\nif <(Yv) = [10]> then\n    set [yv v] to [0]\nend\n\nwhen flag clicked\nhide\n\nchange x by ((Xv) * (-1))\nchange y by ((Yv) * (-1))\nchange x by (Xv)\nchange y by (Yv)\n\nwhen I receive [got bow v]\nset [weapons unlocked v] to [4]\nset [weapon selected v] to [4]\nset [arrows v] to [1]\nhide\nforever\n    if <(Weapon selected) = [4]> then\n        show\n        just go... ugh\n        if <(Arrows) > [0]> then\n            switch costume to (yes arrow no pullback v)\n        else\n            set rotation style [left-right v]\n            switch costume to (no arrow v)\n        end\n        if <<key (space v) pressed?> and <(Arrows) > [0]>> then\n            set [able to jump v] to [0]\n            set [bow power v] to [0]\n            repeat until <not <key (space v) pressed?>>\n                if <(costume [number v]) < [5]> then\n                    next costume\n                else\n                end\n                if <(Yv) = [10]> then\n                    set [yv v] to [0]\n                end\n                just go... ugh\n                set [xv v] to ((Xv) * (0.83))\n                change [bow power v] by (pick random (2) to (1.9))\n                set [bow power v] to ((Bow Power) * (0.9))\n                set rotation style [all around v]\n                if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                    turn right ((direction) / (-5)) degrees\n                end\n                if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n                    turn right ((direction) / (5)) degrees\n                end\n            end\n            change [arrows v] by (-1)\n            create clone of (_myself_ v)\n            switch costume to (no arrow v)\n            repeat until <<not <key (up arrow v) pressed?>> or <key (space v) pressed?>>\n                just go... ugh\n            end\n            if <not <key (space v) pressed?>> then\n                set [able to jump v] to [1]\n            end\n        end\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) < [8]> then\n    clear graphic effects\n    set [indiv arrow power v] to ((Bow Power) * (3))\n    if <(Indiv arrow power) > [29]> then\n        switch costume to (arrow sanic fast v)\n    else\n        switch costume to (arrow v)\n    end\n    set [indiv arrow yv v] to [0]\n    turn right ((direction) / (-36)) degrees\n    move ((Indiv arrow power) / (2)) steps\n    repeat until <<<touching color (#000000)?> or <touching color (#7f7f7f)?>> or <touching (_edge_ v)?>>\n        move (Indiv arrow power) steps\n        if <<(costume [number v]) = [10]> and <(Indiv arrow power) < [30]>> then\n            switch costume to (arrow v)\n        end\n        if <<not <([abs v] of (direction) ) > [170]>> or <([abs v] of (Indiv arrow power) ) < [1]>> then\n            turn right (((direction) / (90)) * (Indiv arrow Yv)) degrees\n            set [indiv arrow yv v] to ((Indiv arrow Yv) * (0.8))\n        else\n            change y by ((Indiv arrow Yv) * (-1))\n            set [indiv arrow yv v] to ((Indiv arrow Yv) * (0.8))\n        end\n        change [indiv arrow yv v] by ((1) / ((Indiv arrow power) / (8)))\n        if <<touching color (#57d58e)?> or <touching color (#82c8ff)?>> then\n            if <not <([abs v] of (Indiv arrow power) ) < [2]>> then\n                set [indiv arrow power v] to ((Indiv arrow power) * (0.9))\n            end\n            set [indiv arrow yv v] to ((Indiv arrow Yv) * (0.2))\n        end\n        if <<touching color (#1a2443)?> or <<touching color (#4c3a99)?> or <touching color (#211943)?>>> then\n            set [indiv arrow power v] to ((Indiv arrow power) * (0.5))\n        end\n    end\n    if <<touching color (#000000)?> or <touching color (#7f7f7f)?>> then\n        move (5) steps\n        wait (0.01) seconds\n        switch costume to (arrow in ground v)\n        position correctly for once\n        wait (1) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n    else\n        repeat ((25) / (([abs v] of (Indiv arrow Yv) ) + ([abs v] of (Indiv arrow power) )))\n            move (Indiv arrow power) steps\n            change y by ((Indiv arrow Yv) * (-1))\n        end\n    end\n    delete this clone\nend\n\ndefine just go... ugh\nif <<(round ((y position) + (4))) = (round ([y position v] of [the ninja v]))> and <(round (x position)) = (round ([x position v] of [the ninja v]))>> then\n    set [you are so stupid what the actual heckles v] to [0]\nelse\n    set [you are so stupid what the actual heckles v] to [1]\nend\ngo to (the ninja v)\nif <(YOU ARE SO STUPID WHAT THE ACTUAL HECKLES) = [1]> then\nend\nchange y by (-4)\npoint in direction ([direction v] of [the ninja v])\n\nwhen backdrop switches to [backdrop25 v]\nset [weapons unlocked v] to [3]\nset [weapon selected v] to [3]\nstop [other scripts in sprite v]\nwait (0.01) seconds\nswitch costume to (hover v)\ncreate clone of (_myself_ v)\n\nwhen I receive [delete all clones!! v]\ndelete this clone\n\nwhen I receive [refresh level v]\nwait (0.01) seconds\nhyrry\n\nwhen [7 v] key pressed\nif <key (0 v) pressed?> then\n    broadcast (Delete all clones!! v)\n    repeat until <not <key (7 v) pressed?>>\n        go to (mouse-pointer v)\n        switch costume to (arrowhov v)\n        show\n        point in direction (90)\n        set [ghost v] effect to (50)\n        if <mouse down?> then\n            add (Level) to [arrow level v]\n            add (x position) to [arrow x v]\n            add (y position) to [arrow y v]\n            wait until <not <mouse down?>>\n        end\n    end\n    clear graphic effects\n    hide\nend\n\ndefine hyrry\nwait (0) seconds\nset size to (100) %\npoint in direction (90)\nif <[arrow level v] contains (Level)?> then\n    set [scroll # v] to [1]\n    repeat (length of [arrow level v])\n        if <(item (Scroll #) of [arrow level v]) = (Level)> then\n            switch costume to (arrowhov v)\n            go to x: (item (Scroll #) of [arrow x v]) y: (item (Scroll #) of [arrow y v])\n            create clone of (_myself_ v)\n        end\n        change [scroll # v] by (1)\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [8]> then\n    switch costume to (hover v)\n    show\n    go to x: (0) y: (83)\n    clear graphic effects\n    point in direction (90)\n    set size to (100) %\n    forever\n        repeat (20)\n            if <touching (the ninja v)?> then\n                broadcast (Got Bow v)\n                repeat (10)\n                    change [ghost v] effect by (10)\n                end\n                delete this clone\n            end\n            change y by (0.25)\n        end\n        repeat (20)\n            if <touching (the ninja v)?> then\n                broadcast (Got Bow v)\n                repeat (10)\n                    change [ghost v] effect by (10)\n                end\n                delete this clone\n            end\n            change y by (-0.25)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [9]> then\n    wait until <not <touching (the ninja v)?>>\n    set rotation style [all around v]\n    point in direction (90)\n    clear graphic effects\n    show\n    forever\n        repeat (20)\n            change y by (0.2)\n            if <touching (the ninja v)?> then\n                change [arrows v] by (1)\n                set rotation style [all around v]\n                start sound [pick up v]\n                repeat (10)\n                    change y by (3)\n                    change [ghost v] effect by (10)\n                end\n                delete this clone\n            end\n        end\n        repeat (20)\n            change y by (-0.2)\n            if <touching (the ninja v)?> then\n                change [arrows v] by (1)\n                set rotation style [all around v]\n                start sound [pick up v]\n                repeat (10)\n                    change y by (3)\n                    change [ghost v] effect by (10)\n                end\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\ndefine position correctly for once\nrepeat (4)\n    if <<touching color (#000000)?> or <touching color (#7f7f7f)?>> then\n        move (-7) steps\n    end\nend\nmove (15) steps\n\n@Piranha feeeesh\n\ndefine Die little fishie >:)\nstart sound [killd v]\nstop [other scripts in sprite v]\nset rotation style [all around v]\nrepeat (10)\n    change [ghost v] effect by (10)\n    turn right (36) degrees\nend\ndelete this clone\n\nwhen I start as a clone\nset [indiv yv v] to [0]\nset [indiv xv v] to [0]\nset ["direction" ;\) ;\) v] to [90]\nset rotation style [left-right v]\nforever\n    if <(Indiv Xv) > [4]> then\n        set [indiv xv v] to [4]\n    end\n    if <(Indiv Xv) < [-4]> then\n        set [indiv xv v] to [-4]\n    end\n    if <(Indiv Yv) > [4]> then\n        set [indiv yv v] to [4]\n    end\n    if <(Indiv Yv) < [-4]> then\n        set [indiv yv v] to [-4]\n    end\n    if <("direction" ;\) ;\)) < [-180]> then\n        set ["direction" ;\) ;\) v] to [180]\n    end\n    if <("direction" ;\) ;\)) > [180]> then\n        set ["direction" ;\) ;\) v] to [-180]\n    end\n    if <<(direction) > [0]> and <("direction" ;\) ;\)) < [0]>> then\n        point in direction (-90)\n    end\n    if <<(direction) < [0]> and <("direction" ;\) ;\)) > [0]>> then\n        point in direction (90)\n    end\n    change [indiv yv v] by (-0.5)\n    change y by (Indiv Yv)\n    if <<touching color (#000000)?> or <touching color (#7f7f7f)?>> then\n        set [indiv yv v] to ((Indiv Yv) * (-1))\n        change y by (Indiv Yv)\n    end\n    if <color (#908880) is touching (#82c8ff)?> then\n        set [indiv xv v] to ((Indiv Xv) * (0.9))\n        set [indiv yv v] to ((Indiv Yv) * (0.9))\n        change [indiv yv v] by (0.5)\n    end\n    change x by (Indiv Xv)\n    if <<touching color (#000000)?> or <touching color (#7f7f7f)?>> then\n        set [indiv xv v] to ((Indiv Xv) * (-1))\n        change x by (Indiv Xv)\n        set ["direction" ;\) ;\) v] to (("direction" ;\) ;\)) * (-1))\n    end\n    change x by ((Indiv Xv) * (6))\n    change y by ((Indiv Yv) * (6))\n    if <<<<touching color (#000000)?> or <touching color (#7f7f7f)?>> or <touching (_edge_ v)?>> or <touching color (#484b49)?>> then\n        change x by ((Indiv Xv) * (-6))\n        change y by ((Indiv Yv) * (-6))\n        set [indiv xv v] to ((Indiv Xv) * (0.7))\n        set [indiv yv v] to ((Indiv Yv) * (0.7))\n        change ["direction" ;\) ;\) v] by (20)\n    else\n        change x by ((Indiv Xv) * (-6))\n        change y by ((Indiv Yv) * (-6))\n    end\n    if <(distance to [the ninja v]) < [100]> then\n        switch costume to (ahh scary v)\n        point towards (the ninja v)\n        set ["direction" ;\) ;\) v] to (direction)\n        if <touching color (#82c8ff)?> then\n            change [indiv xv v] by (([sin v] of (direction) ) * (0.5))\n            change [indiv yv v] by (([cos v] of (direction) ) * (0.5))\n        end\n    else\n        switch costume to (normal v)\n    end\n    if <touching (the ninja v)?> then\n        broadcast (Refresh Level v)\n    end\n    if <<<touching (katana v)?> or <<<touching color (#525945)?> or <<touching color (#2d321a)?> or <touching color (#20270c)?>>> or <touching color (#b1b0a7)?>>> or <touching color (#b5c2c9)?>> then\n        Die little fishie >:)\n    end\n    if <touching color (#484b49)?> then\n        get the frick out of the other fish you\n    end\nend\n\ndelete (all) of [fish x v]\ndelete (all) of [fish y v]\ndelete (all) of [fish level v]\n\nwhen I receive [delete all clones!! v]\ndelete this clone\n\nwhen I receive [refresh level v]\nwait (0.01) seconds\nhurry\n\nrepeat (3)\n    set ["direction" ;\) ;\) v] to [0]\n    create clone of (_myself_ v)\nend\n\ndefine hurry\nwait (0) seconds\nset size to (100) %\npoint in direction (90)\nif <[fish level v] contains (Level)?> then\n    set [scroll # v] to [1]\n    repeat (length of [fish level v])\n        if <(item (Scroll #) of [fish level v]) = (Level)> then\n            go to x: (item (Scroll #) of [fish x v]) y: (item (Scroll #) of [fish y v])\n            create clone of (_myself_ v)\n        end\n        change [scroll # v] by (1)\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    wait (pick random (0.1) to (1)) seconds\n    repeat (pick random (0) to (25))\n        if <(distance to [the ninja v]) > [100]> then\n            change ["direction" ;\) ;\) v] by (pick random (5) to (1))\n            point in direction ("direction" ;\) ;\))\n            if <touching color (#82c8ff)?> then\n                change [indiv xv v] by (([sin v] of (direction) ) * (0.5))\n                change [indiv yv v] by (([cos v] of (direction) ) * (0.5))\n            end\n        end\n    end\n    wait (pick random (0.1) to (1)) seconds\n    repeat (pick random (0) to (25))\n        if <(distance to [the ninja v]) > [100]> then\n            change ["direction" ;\) ;\) v] by (pick random (-5) to (-1))\n            point in direction ("direction" ;\) ;\))\n            if <touching color (#82c8ff)?> then\n                change [indiv xv v] by (([sin v] of (direction) ) * (0.5))\n                change [indiv yv v] by (([cos v] of (direction) ) * (0.5))\n            end\n        end\n    end\nend\n\nchange [indiv yv v] by (0.5)\n\ndefine get the frick out of the other fish you\nrepeat until <not <touching color (#484b49)?>>\n    move (-5) steps\nend\nrepeat (3)\n    move (-5) steps\nend\n\nwhen backdrop switches to [backdrop37 v]\nstop [other scripts in sprite v]\nhide\n\nwhen [f v] key pressed\nif <key (0 v) pressed?> then\n    broadcast (Delete all clones!! v)\n    repeat until <not <key (f v) pressed?>>\n        go to (mouse-pointer v)\n        show\n        point in direction (90)\n        set [ghost v] effect to (50)\n        if <mouse down?> then\n            add (Level) to [fish level v]\n            add (x position) to [fish x v]\n            add (y position) to [fish y v]\n            wait until <not <mouse down?>>\n        end\n    end\n    clear graphic effects\n    hide\nend\n\n@Intro/outro/thumbnail\n\nwhen flag clicked\nerase all\nclear graphic effects\nset [0 intro xv v] to [50]\nset [0 intro yv v] to [15]\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\nshow\nswitch costume to (3051823_60x60 v)\ngo to x: (pick random (-200) to (200)) y: (-180)\nset size to (100) %\nrepeat (75)\n    go to [front v] layer\n    change x by (0 intro Xv)\n    change y by (0 intro Yv)\n    change [0 intro yv v] by (((50) - (y position)) / (10))\n    set [0 intro yv v] to ((0 intro Yv) * (0.8))\n    change [0 intro xv v] by (((0) - (x position)) / (10))\n    set [0 intro xv v] to ((0 intro Xv) * (0.8))\n    change size by ((([abs v] of (0 intro Yv) ) + ([abs v] of (0 intro Xv) )) / (5))\nend\nbroadcast (START v)\ngo to [front v] layer\n\nchange [brightness v] effect by (-5)\n\nwhen I receive [start v]\nwait (0) seconds\nwait (0.5) seconds\nhide\nswitch costume to (costume2 v)\n\nwhen I receive [start v]\nrepeat (5)\n    change [brightness v] effect by (20)\nend\nrepeat (5)\n    change [ghost v] effect by (20)\nend\ndelete this clone\n\nwhen I start as a clone\nif <(costume [number v]) < [3]> then\n    switch costume to (costume1 v)\n    set size to (105) %\n    forever\n        go to x: (0) y: (0)\n        show\n    end\nend\n\nchange [ghost v] effect by (5)\n\nset [level v] to [41]\n\nwhen backdrop switches to [backdrop37 v]\ndelete this clone\n\nturn left (15) degrees\n\nwait (0.3) seconds\n\nwhen backdrop switches to [backdrop37 v]\nwait (0.01) seconds\nhide\nswitch costume to (thumbnail v)\nset size to (100) %\nset x to (0)\nset y to (0)\ngo to [front v] layer\nclear graphic effects\nswitch costume to (thumbnail2 v)\ncreate clone of (_myself_ v)\nswitch costume to (sword v)\ncreate clone of (_myself_ v)\nwait (0.3) seconds\nswitch costume to (grapples to grapples v)\ncreate clone of (_myself_ v)\nwait (0.3) seconds\nswitch costume to (bow v)\ncreate clone of (_myself_ v)\nwait (0.3) seconds\ngo to x: (-113) y: (125)\nswitch costume to (star v)\ncreate clone of (_myself_ v)\ngo to x: (113) y: (125)\nswitch costume to (star v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nif <<(costume [number v]) > [4]> and <(costume [number v]) < [8]>> then\n    set [0 intro xv v] to ((timer) / (3))\n    set [0 intro yv v] to [0]\n    set [indiv dir v v] to [9.8]\n    point in direction (0)\n    set rotation style [all around v]\n    set [ghost v] effect to (100)\n    show\n    forever\n        set [indiv dir v v] to ((Indiv Dir V) * (0.9))\n        change [0 intro yv v] by (8)\n        turn right (Indiv Dir V) degrees\n        change [ghost v] effect by (-5)\n        if <not <(costume [number v]) = [6]>> then\n            set y to (([sin v] of ((0 intro Yv) + (0 intro Xv)) ) * (5))\n        end\n    end\nend\nif <(costume [number v]) = [8]> then\n    point in direction (-90)\n    set rotation style [all around v]\n    set [ghost v] effect to (100)\n    show\n    forever\n        change [ghost v] effect by (-5)\n        turn right (10) degrees\n    end\nend\n\nshow\nswitch costume to (thumbnail v)\nset size to (100) %\nset x to (0)\nset y to (0)\ngo to [front v] layer\nclear graphic effects\n\n
At long last, here it is!  The Ninja 4!  :D\n\nI said I'd make this when The Ninja reached 10,000 loves.  Well, now it has, so I followed through with my promise!  \n\nHopefully you enjoy this one as much as the others!  If you haven't played them yet, here are the links!\nThe Ninja: https://scratch.mit.edu/projects/22620682/\nThe Ninja 2: https://scratch.mit.edu/projects/23559041/\nThe Ninja 3: https://scratch.mit.edu/projects/36760896/\nThe Ninja 5: https://scratch.mit.edu/projects/211625762/