The Ninja 2

Instructions: Yep, it's finally out!  I usually don't make sequels to projects this soon, but considering the first one got 2500 loves, I decided to.  :P\n\nThe Ninja:  http://scratch.mit.edu/projects/22620682/\nThe Ninja 3: https://scratch.mit.edu/projects/36760896/\nThe Ninja 4: https://scratch.mit.edu/projects/154866875/\nThe Ninja 5: https://scratch.mit.edu/projects/211625762/\n\nThe controls are explained in the project but a few are explained in the first game.  :)\n\nAlso, I fixed a lot of glitches and added sound effects to things but there's still a glitch with the piranha fish that I'm trying to fix.  :/

@Stage\n\nwhen flag clicked\nset [ninja stars v] to [0]\nset [level v] to [1]\nswitch backdrop to (backdrop2 v)\nbroadcast (level change v)\n\nwhen I receive [level change v]\nerase all\nswitch backdrop to (backdrop2 v)\nset [powerups gone v] to [1]\nwait (0.05) seconds\nset [powerups gone v] to [0]\nswitch backdrop to ((Level) + (1))\n\nwhen [r v] key pressed\nbroadcast (level change v)\n\nwhen [a v] key pressed\nchange [level v] by (1)\nbroadcast (level change v)\n\nwhen flag clicked\nforever\n    if <(powerups gone) = [1]> then\n        set [ninja stars v] to [0]\n        set [targets hit v] to [0]\n        delete (all) of [ninjas y v]\n        delete (all) of [ninjas x v]\n    end\nend\n\nwhen [s v] key pressed\nchange [level v] by (-1)\nbroadcast (level change v)\n\n@Sprite1\n\nwhen flag clicked\npoint in direction (90)\nset rotation style [left-right v]\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <<(x position) > [238]> and <touching (_edge_ v)?>> then\n        change [level v] by (1)\n        broadcast (level change v) and wait\n    end\n    if <<(y position) < [-173]> and <touching (_edge_ v)?>> then\n        broadcast (level change v) and wait\n    end\n    if <not <touching color (#00cccc)?>> then\n        change [yv v] by (-0.5)\n        if <key (right arrow v) pressed?> then\n            point in direction (90)\n            change [xv v] by (0.8)\n        end\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n            change [xv v] by (-0.8)\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?> then\n            if <not <touching color (#00cccc)?>> then\n                set [yv v] to [10]\n            end\n        end\n    end\n    change y by (1)\n    if <touching color (#663b00)?> then\n        broadcast (level change v)\n    end\nend\n\nswitch backdrop to ((backdrop [number v]) + (1))\n\nwhen backdrop switches to [backdrop3 v]\ngo to x: (-219) y: (-103)\n\nwhen backdrop switches to [backdrop4 v]\ngo to x: (-219) y: (-103)\n\nwhen backdrop switches to [backdrop5 v]\ngo to x: (-217) y: (-118)\n\nwhen backdrop switches to [backdrop6 v]\ngo to x: (-217) y: (6)\n\nwhen backdrop switches to [backdrop7 v]\ngo to x: (-208) y: (-103)\n\nwhen backdrop switches to [backdrop8 v]\ngo to x: (-208) y: (110)\n\nwhen backdrop switches to [backdrop9 v]\ngo to x: (-221) y: (-119)\n\nwhen backdrop switches to [backdrop10 v]\ngo to x: (-222) y: (-85)\n\nwhen flag clicked\nforever\n    if <touching color (#00cccc)?> then\n        if <color (#001966) is touching (#00cccc)?> then\n            change [yv v] by (0.07)\n        else\n            set [yv v] to ((Yv) * (0.9))\n            set [yv v] to ((Yv) * (0.9))\n            set [yv v] to ((Yv) * (0.9))\n            set [yv v] to ((Yv) * (0.9))\n            if <key (up arrow v) pressed?> then\n                start sound [recording1 v]\n                set [yv v] to [4]\n                wait (1) seconds\n            end\n        end\n        if <key (up arrow v) pressed?> then\n            change [yv v] by (0.3)\n        end\n        if <key (down arrow v) pressed?> then\n            change [yv v] by (-0.3)\n        end\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n            change [xv v] by (-0.3)\n        end\n        if <key (right arrow v) pressed?> then\n            point in direction (90)\n            change [xv v] by (0.3)\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop11 v]\ngo to x: (-219) y: (91)\n\nwhen backdrop switches to [backdrop12 v]\ngo to x: (-212) y: (-102)\n\nwhen backdrop switches to [backdrop13 v]\ngo to x: (-218) y: (-130)\n\nwhen backdrop switches to [backdrop14 v]\ngo to x: (-225) y: (92)\n\nwhen backdrop switches to [backdrop15 v]\ngo to x: (-216) y: (-129)\n\nwhen backdrop switches to [backdrop16 v]\ngo to x: (-219) y: (126)\n\nwhen I receive [blow upward v]\nset [yv v] to [0]\nchange y by (3)\nif <touching color (#000000)?> then\n    change y by (-4)\nend\n\nwhen I receive [mini blow v]\nset [yv v] to [0]\nchange y by (fan power)\n\nwhen backdrop switches to [backdrop17 v]\ngo to x: (-220) y: (-120)\n\nwhen backdrop switches to [backdrop18 v]\ngo to x: (-223) y: (88)\n\nwhen backdrop switches to [backdrop19 v]\ngo to x: (-222) y: (-23)\n\nwhen backdrop switches to [backdrop20 v]\ngo to x: (-213) y: (-108)\n\nwhen backdrop switches to [backdrop21 v]\ngo to x: (-220) y: (68)\n\nwhen backdrop switches to [backdrop22 v]\ngo to x: (-225) y: (-121)\n\nwhen backdrop switches to [backdrop23 v]\ngo to x: (-222) y: (49)\n\nwhen backdrop switches to [backdrop24 v]\ngo to x: (-222) y: (49)\n\nwhen backdrop switches to [backdrop25 v]\ngo to x: (-224) y: (-87)\n\nchange y by (3)\nif <touching color (#000000)?> then\n    change y by (-4)\nend\n\nwhen backdrop switches to [backdrop26 v]\ngo to x: (-220) y: (109)\n\nwhen backdrop switches to [backdrop27 v]\ngo to x: (-224) y: (-121)\n\nwhen backdrop switches to [backdrop28 v]\ngo to x: (-215) y: (77)\n\nwhen backdrop switches to [backdrop29 v]\ngo to x: (-221) y: (-122)\n\nwhen backdrop switches to [backdrop30 v]\ngo to x: (-218) y: (-126)\n\nwhen backdrop switches to [backdrop1 v]\ngo to x: (-222) y: (-75)\n\nwhen I receive [level change v]\nset [xv v] to [0]\nset [yv v] to [0]\n\n@Sprite2\n\nwhen flag clicked\nforever\n    play sound [Ninja music GREAT! v] until done\nend\n\nplay sound [ninja music v] until done\n\n@Sprite3\n\nwhen flag clicked\nset [ninja star thrown v] to [0]\nhide\n\nwhen I start as a clone\nclear graphic effects\nshow\nforever\n    if <(powerups gone) = [1]> then\n        delete this clone\n    end\n    if <touching (sprite1 v)?> then\n        start sound [recording1 v]\n        change [ninja stars v] by (1)\n        repeat (30)\n            change y by (2)\n            change [ghost v] effect by (3)\n            turn right (20) degrees\n        end\n        delete this clone\n    end\nend\n\nclear graphic effects\n\nwhen backdrop switches to [backdrop7 v]\ngo to x: (-169) y: (73)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop8 v]\ngo to x: (50) y: (95)\ncreate clone of (_myself_ v)\ngo to x: (0) y: (95)\ncreate clone of (_myself_ v)\ngo to x: (-50) y: (95)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop11 v]\ngo to x: (51) y: (101)\ncreate clone of (_myself_ v)\ngo to x: (102) y: (101)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop12 v]\ngo to x: (-113) y: (74)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop21 v]\ngo to x: (-123) y: (69)\ncreate clone of (_myself_ v)\ngo to x: (-152) y: (69)\ncreate clone of (_myself_ v)\ngo to x: (96) y: (67)\ncreate clone of (_myself_ v)\n\nset [ninja star thrown v] to [0]\n\nwhen I start as a clone\nshow\nforever\n    repeat (30)\n        change y by (0.2)\n        turn right (5) degrees\n    end\n    repeat (30)\n        change y by (-0.2)\n        turn right (5) degrees\n    end\nend\n\nset [ninja star thrown v] to [0]\n\nset [ninja star thrown v] to [1]\n\nwhen backdrop switches to [backdrop26 v]\ngo to x: (-195) y: (-144)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop1 v]\ngo to x: (-70) y: (-77)\ncreate clone of (_myself_ v)\ngo to x: (-5) y: (-77)\ncreate clone of (_myself_ v)\n\nwhen I receive [level change v]\ndelete this clone\n\n@Sprite11\n\nwhen flag clicked\nhide\n\nstart sound [recording1 v]\nset size to (70) %\n\nwhen backdrop switches to [backdrop7 v]\ngo to x: (-158) y: (-169)\nshow\nset [show ninja stars v] to [1]\nforever\n    go to [front v] layer\n    if <(length of (ninja stars)) = [2]> then\n        switch costume to ((letter (1) of (ninja stars)) + (1))\n    else\n        switch costume to (costume10 v)\n    end\n    if <(show ninja stars) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nchange [ninja stars v] by (1)\n\n@Sprite4\n\nwhen flag clicked\nhide\n\nhide\nshow\n\nwhen backdrop switches to [backdrop7 v]\nclear graphic effects\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nforever\n    if <(show ninja stars) = [1]> then\n        switch costume to (costume1 v)\n    else\n        if <(show ninja stars) = [2]> then\n            switch costume to (costume3 v)\n        else\n            switch costume to (costume2 v)\n        end\n    end\nend\n\n@Sprite5\n\nwhen flag clicked\nset [sword gotten v] to [0]\nhide\n\nwhen backdrop switches to [backdrop7 v]\nclear graphic effects\ngo to x: (-147) y: (-169)\nshow\nforever\n    go to [front v] layer\n    if <(length of (ninja stars)) = [2]> then\n        switch costume to ((letter (2) of (ninja stars)) + (1))\n    else\n        switch costume to ((letter (1) of (ninja stars)) + (1))\n    end\n    if <(show ninja stars) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(sword gotten) = [1]> then\n        if <key (z v) pressed?> then\n            if <(spear gotten) = [1]> then\n                if <(show ninja stars) = [1]> then\n                    set [show ninja stars v] to [2]\n                else\n                    if <(show ninja stars) = [2]> then\n                        set [show ninja stars v] to [0]\n                    else\n                        set [show ninja stars v] to [1]\n                    end\n                end\n            else\n                if <(show ninja stars) = [1]> then\n                    set [show ninja stars v] to [0]\n                else\n                    set [show ninja stars v] to [1]\n                end\n            end\n        end\n        wait until <not <key (z v) pressed?>>\n    end\nend\n\nset [show ninja stars v] to [1]\n\nset [spear gotten v] to [1]\n\n@Sprite6\n\nwhen flag clicked\nhide\n\n@Sprite7\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        if <(ninja stars) > [0]> then\n            if <(show ninja stars) = [1]> then\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 flag clicked\nhide\n\nwhen I start as a clone\nset [ninja star thrown v] to [1]\nstart sound [recording2 v]\npoint in direction (90)\ngo to (sprite1 v)\nclear graphic effects\nshow\nif <([direction v] of [sprite1 v]) = [90]> then\n    change x by (10)\n    repeat until <<touching color (#000000)?> or <touching (_edge_ v)?>>\n        turn right (20) degrees\n        change x by (8)\n    end\n    change x by (5)\nelse\n    change x by (-10)\n    repeat until <<touching color (#000000)?> or <touching (_edge_ v)?>>\n        turn right (-20) degrees\n        change x by (-8)\n    end\n    change x by (-5)\nend\nif <touching (_edge_ v)?> then\n    delete this clone\nend\nwait (0.1) seconds\nset [ninja star thrown v] to [0]\nwait (0.5) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\n    if <not <touching color (#000000)?>> then\n        change y by (-4)\n    end\nend\ndelete this clone\n\nwhen I receive [level change v]\ndelete this clone\n\n@Sprite8\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <(powerups gone) = [1]> then\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nshow\nswitch costume to (costume2 v)\nwait until <touching (sprite7 v)?>\nstart sound [recording3 v]\nchange [targets hit v] by (1)\nrepeat (6)\n    next costume\n    wait (0.02) seconds\nend\nhide\n\nwhen backdrop switches to [backdrop8 v]\ngo to x: (-213) y: (28)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop21 v]\ngo to x: (220) y: (-6)\ncreate clone of (_myself_ v)\ngo to x: (197) y: (-128)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\n\nshow\nswitch costume to (costume2 v)\nrepeat until <touching color (#1c1c1c)?>\n    if <touching color (#1c1c1c)?> then\n        if <not <(ninja star thrown) = [1]>> then\n            start sound [recording3 v]\n            change [targets hit v] by (1)\n            repeat (6)\n                next costume\n                wait (0.02) seconds\n            end\n            hide\n        end\n    end\nend\nstart sound [recording3 v]\nchange [targets hit v] by (1)\nrepeat (6)\n    next costume\n    wait (0.02) seconds\nend\nhide\n\nwhen backdrop switches to [backdrop26 v]\ngo to x: (226) y: (125)\ncreate clone of (_myself_ v)\n\n@Sprite9\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [backdrop8 v]\nset [targets hit v] to [0]\nclear graphic effects\nswitch costume to (costume1 v)\ngo [backward v] (100000) layers\nshow\nwait until <(targets hit) = [1]>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen backdrop switches to [backdrop9 v]\nhide\n\nwhen backdrop switches to [backdrop12 v]\nset [targets hit v] to [0]\nclear graphic effects\nswitch costume to (costume2 v)\ngo [backward v] (100000) layers\nshow\nwait until <(targets hit) = [1]>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen backdrop switches to [backdrop21 v]\nset [targets hit v] to [0]\nclear graphic effects\nswitch costume to (costume3 v)\ngo [backward v] (100000) layers\nshow\nwait until <(targets hit) = [3]>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen backdrop switches to [backdrop13 v]\nhide\n\nwhen backdrop switches to [backdrop26 v]\nset [targets hit v] to [0]\nclear graphic effects\nswitch costume to (costume4 v)\ngo [backward v] (100000) layers\nshow\nwait until <(targets hit) = [1]>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen backdrop switches to [backdrop22 v]\nhide\n\nwhen backdrop switches to [backdrop27 v]\nhide\n\nwhen backdrop switches to [backdrop11 v]\nhide\n\nwhen backdrop switches to [backdrop20 v]\nhide\n\nwhen backdrop switches to [backdrop25 v]\nhide\n\nwhen backdrop switches to [backdrop7 v]\nhide\n\n@Sprite10\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <(powerups gone) = [1]> then\n        delete this clone\n    end\nend\n\nwait (0.1) seconds\n\nwhen backdrop switches to [backdrop12 v]\ngo to x: (-120) y: (3)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop21 v]\ngo to x: (-225) y: (18)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    repeat (40)\n        change y by (-2)\n    end\n    repeat (40)\n        change y by (2)\n    end\nend\n\nwhen I start as a clone\nshow\nswitch costume to (costume2 v)\nrepeat until <touching (sprite7 v)?>\nend\nstart sound [recording3 v]\nchange [targets hit v] by (1)\nrepeat (6)\n    next costume\n    wait (0.02) seconds\nend\nhide\n\nif <touching color (#1c1c1c)?> then\n    if  then\n        start sound [recording3 v]\n        change [targets hit v] by (1)\n        repeat (6)\n            next costume\n            wait (0.02) seconds\n        end\n        hide\n    end\nend\n\n@Sprite12\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nclear graphic effects\nset size to (100) %\nshow\npoint in direction (90)\nforever\n    set rotation style [left-right v]\n    if <(distance to [sprite1 v]) < [100]> then\n        point towards (sprite1 v)\n        move (2) steps\n    else\n        turn right (pick random (1) to (-2)) degrees\n        move (0.5) steps\n    end\n    if <touching (sprite1 v)?> then\n        broadcast (level change v)\n    end\n    if <touching color (#000000)?> then\n        move (-2.1) steps\n    end\n    if <not <touching color (#00cccc)?>> then\n        change y by (-2.1)\n    end\nend\n\nwait (0.2) seconds\n\nswitch costume to (costume2 v)\n\nhide\nplay sound [recording2 v] until done\n\nwhen backdrop switches to [backdrop14 v]\ngo to x: (-91) y: (38)\ncreate clone of (_myself_ v)\ngo to x: (-43) y: (19)\ncreate clone of (_myself_ v)\ngo to x: (110) y: (17)\ncreate clone of (_myself_ v)\ngo to x: (-146) y: (24)\ncreate clone of (_myself_ v)\ngo to x: (14) y: (40)\ncreate clone of (_myself_ v)\ngo to x: (93) y: (35)\ncreate clone of (_myself_ v)\ngo to x: (52) y: (27)\ncreate clone of (_myself_ v)\ngo to x: (-16) y: (-34)\ncreate clone of (_myself_ v)\ngo to x: (-186) y: (39)\ncreate clone of (_myself_ v)\ngo to x: (101) y: (-66)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <(powerups gone) = [1]> then\n        delete this clone\n    end\n    if <touching color (#090909)?> then\n        start sound [recording2 v]\n        repeat (20)\n            set rotation style [all around v]\n            change size by (-5)\n            turn right (15) degrees\n            change [ghost v] effect by (5)\n        end\n        delete this clone\n    end\n    if <touching color (#666666)?> then\n        hide\n        play sound [recording2 v] until done\n        delete this clone\n    end\nend\n\nwhen backdrop switches to [backdrop11 v]\ngo to x: (83) y: (-88)\ncreate clone of (_myself_ v)\ngo to x: (179) y: (-14)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop12 v]\ngo to x: (25) y: (-125)\ncreate clone of (_myself_ v)\ngo to x: (122) y: (-103)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop25 v]\ngo to x: (105) y: (-139)\ncreate clone of (_myself_ v)\ngo to x: (125) y: (-88)\ncreate clone of (_myself_ v)\ngo to x: (112) y: (-3)\ncreate clone of (_myself_ v)\ngo to x: (1) y: (35)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop30 v]\ngo to x: (179) y: (30)\ncreate clone of (_myself_ v)\ngo to x: (-207) y: (51)\ncreate clone of (_myself_ v)\ngo to x: (123) y: (13)\ncreate clone of (_myself_ v)\ngo to x: (-87) y: (18)\ncreate clone of (_myself_ v)\ngo to x: (-48) y: (51)\ncreate clone of (_myself_ v)\ngo to x: (38) y: (33)\ncreate clone of (_myself_ v)\n\n@Sprite13\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nchange [ninjas out v] by (1)\nadd (y position) to [ninjas y v]\nadd (x position) to [ninjas x v]\nset rotation style [left-right v]\nclear graphic effects\nshow\nforever\n    point towards (sprite1 v)\n    if <(powerups gone) = [1]> then\n        delete this clone\n    end\n    if <touching color (#410000)?> then\n        delete (1) of [ninjas y v]\n        delete (1) of [ninjas x v]\n        change [ninjas out v] by (-1)\n        start sound [recording2 v]\n        delete this clone\n    end\nend\n\nwhen backdrop switches to [backdrop10 v]\ngo to x: (-62) y: (-129)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop14 v]\ngo to x: (146) y: (-142)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop16 v]\ngo to x: (-159) y: (-130)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop20 v]\ngo to x: (183) y: (48)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop21 v]\ngo to x: (157) y: (-137)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop26 v]\ngo to x: (-38) y: (-38)\ncreate clone of (_myself_ v)\ngo to x: (-148) y: (-152)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop27 v]\ngo to x: (93) y: (-26)\ncreate clone of (_myself_ v)\ngo to x: (158) y: (-142)\ncreate clone of (_myself_ v)\n\ngo to x: (9) y: (67)\n\nwhen backdrop switches to [backdrop30 v]\ngo to x: (153) y: (-127)\ncreate clone of (_myself_ v)\n\n@Sprite14\n\nwhen flag clicked\nset size to (100) %\nswitch costume to (costume1 v)\nhide\nforever\n    if <(length of [ninjas y v]) > [0]> then\n        set [which ninja? v] to [1]\n        repeat (length of [ninjas y v])\n            set x to (item (which ninja?) of [ninjas x v])\n            set y to (item (which ninja?) of [ninjas y v])\n            create clone of (_myself_ v)\n            change [which ninja? v] by (1)\n        end\n        wait (1) seconds\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume1 v)\npoint towards (sprite1 v)\nclear graphic effects\nshow\nrepeat until <<<touching color (#000000)?> or <touching (_edge_ v)?>> or <<touching (sprite17 v)?> or <touching (sprite22 v)?>>>\n    move (4) steps\n    if <touching (sprite1 v)?> then\n        broadcast (level change v)\n    end\nend\nif <touching (_edge_ v)?> then\n    delete this clone\nend\nif <<touching (sprite17 v)?> or <touching (sprite22 v)?>> then\n    turn right (180) degrees\n    switch costume to (costume2 v)\n    repeat (4)\n        move (4) steps\n    end\n    repeat until <<touching color (#7f7f7f)?> or <touching (_edge_ v)?>>\n        move (4) steps\n    end\n    move (8) steps\n    wait (0.5) seconds\n    repeat (50)\n        change [ghost v] effect by (2)\n        if <not <touching color (#000000)?>> then\n            change y by (-4)\n            point in direction (180)\n        end\n    end\n    delete this clone\nelse\n    move (8) steps\n    wait (0.5) seconds\n    repeat (50)\n        change [ghost v] effect by (2)\n        if <not <touching color (#000000)?>> then\n            change y by (-4)\n            point in direction (180)\n        end\n    end\n    delete this clone\nend\n\nif <touching color (#7f7f7f)?> then\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    if <(powerups gone) = [1]> then\n        delete this clone\n    end\nend\n\n@Sprite15\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\nset x to (0)\nset y to (0)\n\n@Sprite16\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [backdrop9 v]\ngo to x: (-55) y: (63)\nclear graphic effects\nshow\nforever\n    repeat (30)\n        change y by (0.2)\n    end\n    repeat (30)\n        change y by (-0.2)\n    end\nend\n\nwhen backdrop switches to [backdrop9 v]\nwait until <touching (sprite1 v)?>\nrepeat (30)\n    change y by (2)\n    change [ghost v] effect by (3)\nend\nset [sword gotten v] to [1]\nhide\n\nwhen backdrop switches to [backdrop10 v]\nstop [other scripts in sprite v]\nset [sword gotten v] to [1]\nhide\n\nwhen backdrop switches to [backdrop15 v]\nstop [other scripts in sprite v]\nhide\n\nchange [brightness v] effect by (3)\n\n@Sprite17\n\nturn right (36) degrees\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nwait (0.01) seconds\ndelete this clone\n\nwhen flag clicked\nswitch costume to (costume3 v)\nhide\nforever\n    if <(sword gotten) = [1]> then\n        if <(show ninja stars) = [0]> then\n            if <key (space v) pressed?> then\n                start sound [recording2 v]\n                set size to (100) %\n                show\n                point in direction ([direction v] of [sprite1 v])\n                go to (sprite1 v)\n                turn left (180) degrees\n                repeat (15)\n                    go to (sprite1 v)\n                    turn right (24) degrees\n                end\n                hide\n                wait (0.5) seconds\n            end\n        end\n    end\nend\n\nturn right (24) degrees\n\nturn right (24) degrees\ncreate clone of (_myself_ v)\n\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\n\n@Sprite18\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nswitch costume to (costume1 v)\nclear graphic effects\nforever\n    change y by (1)\n    if <touching (sprite1 v)?> then\n        wait (0.3) seconds\n        start sound (pick random (2) to (3))\n        repeat (10)\n            change y by (-2)\n            change [ghost v] effect by (10)\n            next costume\n            if <(powerups gone) = [1]> then\n                delete this clone\n            end\n        end\n        delete this clone\n    end\n    change y by (-1)\nend\n\nwhen backdrop switches to [backdrop13 v]\ngo to x: (143) y: (-13)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <(powerups gone) = [1]> then\n        delete this clone\n    end\nend\n\nwhen backdrop switches to [backdrop14 v]\ngo to x: (-9) y: (74)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop21 v]\ngo to x: (-14) y: (93)\ncreate clone of (_myself_ v)\n\n@Sprite19\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nclear graphic effects\nshow\nforever\n    next costume\n    if <(powerups gone) = [1]> then\n        delete this clone\n    end\n    next costume\nend\n\nwhen backdrop switches to [backdrop17 v]\ngo to x: (-40) y: (-159)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <<([x position v] of [sprite1 v]) < ((x position) + (20))> and <([x position v] of [sprite1 v]) > ((x position) - (20))>> then\n        broadcast (blow upward v)\n    end\nend\n\nwhen backdrop switches to [backdrop19 v]\ngo to x: (-92) y: (-160)\ncreate clone of (_myself_ v)\ngo to x: (-30) y: (-160)\ncreate clone of (_myself_ v)\ngo to x: (30) y: (-160)\ncreate clone of (_myself_ v)\ngo to x: (94) y: (-160)\ncreate clone of (_myself_ v)\ngo to x: (158) y: (-160)\ncreate clone of (_myself_ v)\ngo to x: (220) y: (-160)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop25 v]\ngo to x: (-93) y: (-123)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop27 v]\ngo to x: (-129) y: (-160)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [backdrop1 v]\ngo to x: (154) y: (-109)\ncreate clone of (_myself_ v)\n\n@Sprite20\n\nwhen flag clicked\nset size to (80) %\nhide\n\nwhen I start as a clone\nclear graphic effects\nshow\nforever\n    next costume\n    if <(powerups gone) = [1]> then\n        delete this clone\n    end\n    next costume\nend\n\nwhen I start as a clone\nforever\n    if <<<([x position v] of [sprite1 v]) < ((x position) + (15))> and <([x position v] of [sprite1 v]) > ((x position) - (15))>> and <([y position v] of [sprite1 v]) < ((y position) + (170))>> then\n        set [fan power v] to (((200) - (distance to [sprite1 v])) / (50))\n        broadcast (mini blow v)\n    end\nend\n\nwhen backdrop switches to [backdrop18 v]\ngo to x: (13) y: (-167)\ncreate clone of (_myself_ v)\n\n@Sprite21\n\nwhen backdrop switches to [backdrop24 v]\ngo to x: (-78) y: (60)\nclear graphic effects\nshow\nforever\n    repeat (30)\n        change y by (0.2)\n    end\n    repeat (30)\n        change y by (-0.2)\n    end\nend\n\nwhen backdrop switches to [backdrop24 v]\nwait until <touching (sprite1 v)?>\nrepeat (30)\n    change y by (2)\n    change [ghost v] effect by (3)\nend\nset [spear gotten v] to [1]\nhide\n\nwhen backdrop switches to [backdrop10 v]\nstop [other scripts in sprite v]\nset [sword gotten v] to [1]\nhide\n\nwhen backdrop switches to [backdrop15 v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nset [spear gotten v] to [0]\nhide\n\n@Sprite22\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\nforever\n    if <(spear gotten) = [1]> then\n        if <(show ninja stars) = [2]> then\n            if <key (space v) pressed?> then\n                start sound [recording2 v]\n                set size to (100) %\n                point in direction ([direction v] of [sprite1 v])\n                go to (sprite1 v)\n                show\n                if <([direction v] of [sprite1 v]) = [90]> then\n                    go to x: (([x position v] of [sprite1 v]) + (10)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (30)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (50)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (55)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (50)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (30)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (10)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to (sprite1 v)\n                else\n                    go to x: (([x position v] of [sprite1 v]) + (-10)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (-30)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (-50)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (-55)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (-50)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (-30)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to x: (([x position v] of [sprite1 v]) + (-10)) y: ([y position v] of [sprite1 v])\n                    wait (0.01) seconds\n                    go to (sprite1 v)\n                end\n                hide\n                wait (0.5) seconds\n            end\n        end\n    end\nend\n\n