Mᴀɢᴍᴀ ... ?   #Platformer #Games
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\nclear graphic effects\nwait until <([costume # v] of [level v]) = [4]>\nswitch backdrop to (backdrop1 v)\nset [ghost v] effect to (10)\nwait until <([costume # v] of [level v]) = [10]>\nclear graphic effects\nswitch backdrop to (backdrop3 v)\nwait until <([costume # v] of [level v]) = [12]>\nclear graphic effects\nswitch backdrop to (backdrop1 v)\nwait until <([costume # v] of [level v]) = [13]>\nclear graphic effects\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [huh v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Next level v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nclear graphic effects\nwait until <([costume # v] of [level v]) = [12]>\n\n@Blank\n\n@Player\n\nwhen I receive [restart v]\nswitch costume to (a0 v)\nif <(lives for player) = [1]> then\n    set [y v] to [0]\n    set [x v] to [0]\n    go to x: (-215) y: (-30)\n    if <touching (level v)?> then\n        change x by (5)\n    end\n    point in direction (90)\n    broadcast (Setup Enemies v)\n    set [y v] to [0]\n    set [x v] to [0]\n    set [lives for player v] to [1]\nelse\n    change [lives for player v] by (-1)\nend\n\nwhen I start as a clone\nclear graphic effects\nset rotation style [all around v]\nrepeat (20)\n    turn right (15) degrees\n    change y by (10)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <touching (water v)?> then\n        change [y v] by (0.7)\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            change [y v] by (1)\n        end\n        if <<key (down arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n            change [y v] by (-1)\n        end\n    end\nend\n\nclear graphic effects\nset rotation style [all around v]\nrepeat (20)\n    turn right (15) degrees\n    change y by (10)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [switch costume v]\nswitch costume to (a0 v)\n\nwait until <not <key (space v) pressed?>>\n\n\n    change [y v] by (-1.5)\nend\n\nwhen I receive [switch weapon v]\nif <not <(Weapon MAX) = [0]>> then\n    if <(Weapon Number) = (Weapon MAX)> then\n        set [weapon number v] to [1]\n    else\n        change [weapon number v] by (1)\n    end\nend\n\nwhen I receive [switch to normal v]\nswitch costume to (a0 v)\n\nwhen I receive [move player v]\nif <not <touching (lava v)?>> then\n    change x by (Move::X)\n    change y by (Move::Y)\nelse\n    broadcast (Restart v)\nend\n\nbroadcast (Next level v)\n\nwhen [r v] key pressed\nbroadcast (Restart v)\n\nwhen I receive [setup enemies v]\nif  then\n    delete this clone\nend\nhide variable [lives v]\nif <([costume # v] of [level v]) = [1]> then\n    Clone self: [] [] to [] []\nend\nif <([costume # v] of [level v]) = [2]> then\nif <([costume # v] of [level v]) = [3]> then\nif <([costume # v] of [level v]) = [4]> then\nif <([costume # v] of [level v]) = [5]> then\nif <([costume # v] of [level v]) = [6]> then\nif <([costume # v] of [level v]) = [7]> then\nif <([costume # v] of [level v]) = [8]> then\nif <([costume # v] of [level v]) = [9]> then\nif <([costume # v] of [level v]) = [10]> then\nif <([costume # v] of [level v]) = [11]> then\nif <([costume # v] of [level v]) = [12]> then\n\ndefine Clone self: (x) (y) to (x) (y)\n\nwhen I receive [#intro done v]\nset [weapon number v] to [1]\nset [weapon max v] to [5]\nbroadcast (W1 v)\nbroadcast (W2 v)\nbroadcast (W3 v)\nbroadcast (W4 v)\nforever\n    if <key (z v) pressed?> then\n        if <not <(Weapon MAX) = [0]>> then\n            if <(Weapon Number) = (Weapon MAX)> then\n                set [weapon number v] to [1]\n            else\n                change [weapon number v] by (1)\n            end\n        end\n    end\n    wait until <not <key (z v) pressed?>>\nend\n\nwhen I receive [#intro done v]\nswitch costume to (hitbox v)\nshow\nforever\n    if <<(x position) > [240]> and <touching (_edge_ v)?>> then\n        broadcast (Next level v)\n    end\n    if <<<(y position) < [-170]> and <touching (_edge_ v)?>> or <touching (lava v)?>> then\n        broadcast (Restart v)\n        create clone of (_myself_ v)\n    end\n    if <touching (bounce v)?> then\n        set [y v] to [20]\n    end\nend\n\nwhen I receive [#intro done v]\nforever\n    play sound [9109kj821kaw.mp3 v] until done\nend\n\nwhen I receive [#intro done v]\nset [lives for player v] to [1]\nbroadcast (Restart v)\nswitch costume to (costume1 v)\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    switch costume to (a0 v)\n    go to [front v] layer\n    if <not <touching (water v)?>> then\n        change [y v] by (-1)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v] by (-1)\n        point in direction (-90)\n    end\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <not <touching (water v)?>>> then\n            set [y v] to [15]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (level v)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (level v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\n    if <touching (level v)?> then\n        broadcast (Restart v)\n    end\n    switch costume to (join [A] (Weapon Number))\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [#intro done v]\nshow\n\nwhen I receive [#intro done v]\nforever\n    if <key (s v) pressed?> then\n        if <not <([costume # v] of [level v]) = [13]>> then\n            broadcast (Next level v)\n        end\n    end\n    wait until <not <key (s v) pressed?>>\n    if <touching (tele v)?> then\n        go to x: (-215) y: (80)\n    end\nend\n\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (-4)\n    change x by ((x) * (-1))\nend\nchange y by (y)\nif <touching (level v)?> then\n    change y by ((y) - ((y) * (2)))\n    set [y v] to [0]\nend\n\n@Level\n\nwhen I receive [next level v]\nclear graphic effects\nnext costume\nbroadcast (Restart v)\n\nwhen I start as a clone\nswitch costume to (costume1 v)\ngo to x: (sx) y: (sy)\nrepeat until <not <([costume # v] of [level v]) = (My Level #)>>\n    Glide (ex) (ey)\n    Glide (sx) (sy)\nend\n\ndefine Glide (x) (y)\nrepeat until <<(round (x position)) = (x)> and <(round (y position)) = (y)>>\n    set [move::x v] to (((x) - (x position)) / (12))\n    set [move::y v] to (((y) - (y position)) / (12))\n    change x by (Move::X)\n    change y by (Move::Y)\n    change y by (3)\n    if <touching (player v)?> then\n        broadcast (Move player v)\n    end\n    change y by (-3)\nend\n\ndelete this clone\n\nwhen I receive [restart v]\ndelete this clone\n\nwhen I receive [setup enemies v]\nif  then\n    delete this clone\nend\nif <([costume # v] of [level v]) = [1]> then\n    Clone at [-48] [-58] to [194] [-58]\nend\nif <([costume # v] of [level v]) = [3]> then\n    Clone at [45] [40] to [143] [-107]\nend\n\ndefine Clone at (sx) (sy) to (ex) (ey)\nset [sx v] to (sx)\nset [sy v] to (sy)\nset [ex v] to (ex)\nset [ey v] to (ey)\nset [my level # v] to (costume [number v])\ncreate clone of (_myself_ v)\n\nwhen I receive [#intro done v]\nshow\nswitch costume to (level 1 v)\ngo to x: (0) y: (00)\n\nwhen flag clicked\nhide\n\n@Clouds\n\nwhen I start as a clone\nswitch costume to (cloud hitbox v)\ngo to x: (240) y: (pick random (10) to (150))\nset [my costume v] to (pick random (1) to (2))\nswitch costume to (My costume)\nset [ghost v] effect to (pick random (50) to (70))\nrepeat (96)\n    switch costume to (cloud hitbox v)\n    change x by (-5)\n    switch costume to (My costume)\nend\ndelete this clone\n\nwhen I receive [#intro done v]\nforever\n    wait (pick random (2) to (4)) seconds\n    create clone of (_myself_ v)\nend\n\n@Deco\n\nbroadcast (Next level v)\n\nwhen I receive [#intro done v]\nshow\nswitch costume to (level 1 v)\nforever\n    go to x: (0) y: (0)\n    go to [back v] layer\n    switch costume to ([costume # v] of [level v])\nend\n\nwhen flag clicked\nhide\n\n@Sprite1\n\ndefine Swing\nshow\nif <([direction v] of [player v]) = [90]> then\n    set size to (150) %\n    point in direction (30)\n    repeat (7)\n        turn right (20) degrees\n        switch costume to (swing v)\n        go to (player v)\n        broadcast (switch costume v)\n    end\nelse\n    set size to (150) %\n    point in direction (150)\n    repeat (7)\n        turn right (-20) degrees\n        switch costume to (swing2 v)\n        go to (player v)\n        broadcast (switch costume v)\n    end\nend\nhide\n\nwhen I start as a clone\nforever\n    show\n    point in direction (90)\n    switch costume to (swing3 v)\n    set size to (200) %\n    repeat (10)\n        change y by (1)\n    end\n    repeat (20)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (1)\n    end\n    go to x: (-45) y: (19)\nend\n\nwhen I receive [w1 v]\nforever\n    if <<(Weapon Number) = [1]> and <key (space v) pressed?>> then\n        Swing\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [flash v]\nif <(Weapon Number) = [1]> then\n    Swing\nend\n\n@Sprite8\n\nwhen flag clicked\nrepeat until <touching (player v)?>\n    go to x: (-120) y: (-30)\n    point in direction (90)\n    switch costume to (thumbnail2 v)\n    switch costume to (explosive throw v)\n    set size to (200) %\n    repeat (10)\n        change y by (1)\n    end\n    repeat (20)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (1)\n    end\nend\n\nwhen I receive [w6 v]\nset [turn v] to [0]\nforever\n    point in direction (Turn)\n    if <<<(Weapon Number) = [6]> and <key (space v) pressed?>> or <key (x v) pressed?>> then\n        create clone of (_myself_ v)\n    end\n    wait until <<not <key (space v) pressed?>> and <not <key (x v) pressed?>>>\nend\n\nwhen flag clicked\ndelete this clone\n\nwhen flag clicked\nhide\nwait until <([costume # v] of [level v]) = [1]>\nwait until <([costume # v] of [level v]) = [6]>\nshow\ngo to x: (-120) y: (-30)\nwait until <touching (player v)?>\nset [weapon number v] to [6]\nset [weapon max v] to [6]\nbroadcast (W6 v)\nforever\n    hide\nend\n\nwhen I start as a clone\nswitch costume to (explosive throw v)\ngo to (player v)\nset size to (130) %\nshow\nset [xv v] to ((([direction v] of [player v]) / (90)) * (7))\nset [yv v] to [3]\nrepeat (30)\n    change x by (xv)\n    change [yv v] by (-1)\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        set [xv v] to ((xv) * (-1))\n    end\n    change y by (yv)\n    if <touching (level v)?> then\n        change y by (4)\n        set [yv v] to ((yv) - ((yv) * (pick random (1) to (2))))\n    end\nend\nset size to (40) %\nrepeat (7)\n    next costume\nend\ndelete this clone\n\nchange y by (yv)\n\nwhen flag clicked\n\n@Enemies\n\nwhen I receive [setup enemies v]\nif  then\n    delete this clone\nend\nhide variable [lives v]\nif <([costume # v] of [level v]) = [1]> then\n    Clone [1] [140] [-12]\nend\nif <([costume # v] of [level v]) = [2]> then\n    Clone [3] [0] [-12]\n    Clone [7] [222] [87]\nend\nif <([costume # v] of [level v]) = [3]> then\n    Clone [9] [-80] [70]\n    Clone [7] [100] [0]\nend\nif <([costume # v] of [level v]) = [4]> then\n    Clone [1] [-74] [-150]\n    Clone [5] [167] [87]\n    Clone [9] [-189] [93]\nend\nif <([costume # v] of [level v]) = [5]> then\n    Clone [1] [240] [86]\n    Clone [7] [116] [-60]\n    Clone [9] [-34] [64]\nend\nif <([costume # v] of [level v]) = [6]> then\n    Clone [7] [170] [-2]\nend\nif <([costume # v] of [level v]) = [7]> then\n    Clone [1] [-70] [-63]\n    Clone [1] [-15] [-63]\n    Clone [1] [90] [-63]\nend\nif <([costume # v] of [level v]) = [8]> then\n    Clone [11] [175] [-10]\n    Clone [1] [0] [-20]\nend\nif <([costume # v] of [level v]) = [9]> then\n    Clone [1] [162] [91]\n    Clone [11] [0] [0]\nend\nif <([costume # v] of [level v]) = [10]> then\n    Clone [9] [150] [-50]\n    Clone [1] [0] [-50]\n    Clone [11] [0] [100]\nend\nif <([costume # v] of [level v]) = [11]> then\n    Clone [11] [-56] [-109]\n    Clone [11] [50] [-109]\n    Clone [3] [70] [50]\n    Clone [1] [-199] [132]\nend\nif <([costume # v] of [level v]) = [12]> then\n\ndefine Clone (type) (x) (y)\ngo to x: (x) y: (y)\nswitch costume to (type)\nset [clone# v] to (type)\ncreate clone of (_myself_ v)\n\nwhen I receive [blue guy switch v]\nif <(costume [number v]) = [1]> then\n    switch costume to (costume3 v)\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [1]> then\n        if <(distance to [player v]) < [115]> then\n            if <(dead) = [0]> then\n                switch costume to (weapon1 v)\n                set [katana rotation v] to ((direction) / (90))\n                create clone of (_myself_ v)\n                switch costume to (costume1 v)\n            end\n        end\n        wait until <[115] < (distance to [player v])>\n    end\nend\n\nwhen I start as a clone\nclear graphic effects\nset size to (100) %\nshow\nset [enemyx v] to [0]\nset [enemyy v] to [0]\nset [dead v] to [0]\ngo to [front v] layer\nif <(costume [number v]) < [13]> then\n    forever\n        switch costume to ((Clone#) + (1))\n        if <<touching (sprite1 v)?> or <<touching (sprite8 v)?> or <[-170] > (y position)>>> then\n            point in direction (90)\n            clear graphic effects\n            set rotation style [all around v]\n            set [dead v] to [1]\n            repeat (20)\n                turn right (15) degrees\n                change y by (10)\n                change [ghost v] effect by (5)\n            end\n            delete this clone\n        end\n        change [enemyy v] by (-1)\n        if <<touching (water v)?> or <touching (lava v)?>> then\n            change [enemyy v] by (2)\n        end\n        if <([x position v] of [player v]) < ((x position) - (50))> then\n            change [enemyx v] by (-0.2)\n            point in direction (-90)\n        end\n        if <((x position) - (-20)) < ([x position v] of [player v])> then\n            change [enemyx v] by (0.2)\n            point in direction (90)\n        end\n        set [enemyx v] to ((Enemyx) * (0.9))\n        change x by (Enemyx)\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (-4)\n            change x by ((Enemyx) * (-1))\n            if <((y position) - (-40)) < ([y position v] of [player v])> then\n                set [enemyy v] to [15]\n                if <([abs v] of (Enemyx) ) = (Enemyx)> then\n                    set [enemyx v] to [-3]\n                else\n                    set [enemyx v] to [3]\n                end\n            else\n                set [enemyx v] to [0]\n            end\n        end\n        change y by (Enemyy)\n        if <touching (level v)?> then\n            change y by ((Enemyy) - ((Enemyy) * (2)))\n            set [enemyy v] to [0]\n        end\n        if <touching (level v)?> then\n            change y by (10)\n        end\n        change y by (-1)\n        if <<((y position) - (-50)) < ([y position v] of [player v])> and <touching (level v)?>> then\n            set [enemyy v] to [14]\n        end\n        change y by (1)\n        switch costume to (Clone#)\n        if <<touching (sprite2 v)?> or <<touching (sprite6 v)?> or <touching (sprite4 v)?>>> then\n            if <not <(costume [number v]) = [9]>> then\n                point in direction (90)\n                clear graphic effects\n                set rotation style [all around v]\n                set [dead v] to [1]\n                repeat (20)\n                    turn right (15) degrees\n                    change y by (10)\n                    change [ghost v] effect by (5)\n                end\n                change [enemies left v] by (-1)\n                delete this clone\n            else\n                if <touching (sprite6 v)?> then\n                    point in direction (90)\n                    clear graphic effects\n                    set rotation style [all around v]\n                    set [dead v] to [1]\n                    repeat (20)\n                        turn right (15) degrees\n                        change y by (10)\n                        change [ghost v] effect by (5)\n                    end\n                    change [enemies left v] by (-1)\n                    delete this clone\n                end\n            end\n        end\n        if <touching (sprite7 v)?> then\n            change [enemyx v] by (((direction) / (-90)) * (10))\n        end\n    end\nelse\n    if <(costume [number v]) = [13]> then\n        set rotation style [all around v]\n        if <(Katana rotation) = [1]> then\n            set size to (150) %\n            point in direction (30)\n            repeat (5)\n                turn right (30) degrees\n                switch costume to (weapon1 v)\n                broadcast (Blue guy switch v)\n                if <touching (player v)?> then\n                    create clone of (player v)\n                    broadcast (Restart v)\n                end\n            end\n        else\n            set size to (150) %\n            point in direction (150)\n            repeat (5)\n                turn right (-30) degrees\n                switch costume to (weapon2 v)\n                broadcast (Blue guy switch v)\n                if <touching (player v)?> then\n                    create clone of (player v)\n                    broadcast (Restart v)\n                end\n            end\n        end\n        delete this clone\n    else\n        if <(costume [number v]) = [15]> then\n            clear graphic effects\n            set rotation style [all around v]\n            point towards (player v)\n            repeat until <<touching (_edge_ v)?> or <touching (level v)?>>\n                move (10) steps\n                if <touching (sprite7 v)?> then\n                    repeat (10)\n                        change [ghost v] effect by (10)\n                    end\n                    change [enemies left v] by (-1)\n                    delete this clone\n                end\n                if <touching (player v)?> then\n                    create clone of (player v)\n                    broadcast (Restart v)\n                end\n            end\n            repeat (10)\n                change [ghost v] effect by (10)\n                if <touching (player v)?> then\n                    create clone of (player v)\n                    broadcast (Restart v)\n                end\n            end\n            delete this clone\n        else\n            if <(costume [number v]) = [16]> then\n                clear graphic effects\n                set rotation style [all around v]\n                point towards (player v)\n                repeat until <<touching (_edge_ v)?> or <touching (level v)?>>\n                    move (15) steps\n                    if <touching (player v)?> then\n                        create clone of (player v)\n                        broadcast (Restart v)\n                    end\n                    if <touching (sprite7 v)?> then\n                        repeat (10)\n                            change [ghost v] effect by (10)\n                        end\n                        delete this clone\n                    end\n                end\n                repeat (10)\n                    change [ghost v] effect by (10)\n                    if <touching (player v)?> then\n                        create clone of (player v)\n                        broadcast (Restart v)\n                    end\n                end\n                delete this clone\n            else\n                if <(costume [number v]) = [17]> then\n                    set [oo v] to ((x position) - ([x position v] of [player v]))\n                    clear graphic effects\n                    set rotation style [all around v]\n                    set size to (60) %\n                    point in direction (0)\n                    if <(((x position) - ([x position v] of [player v])) * (-1)) < [1]> then\n                        switch costume to (costume8 v)\n                        repeat (30)\n                            move (12) steps\n                            turn right (-6) degrees\n                            if <touching (player v)?> then\n                                create clone of (player v)\n                                broadcast (Restart v)\n                            end\n                            if <touching (level v)?> then\n                                repeat (10)\n                                    change [ghost v] effect by (10)\n                                end\n                                delete this clone\n                            end\n                        end\n                        repeat until <touching (level v)?>\n                            change y by (-5)\n                            if <touching (player v)?> then\n                                create clone of (player v)\n                                broadcast (Restart v)\n                            end\n                        end\n                        repeat (10)\n                            change [ghost v] effect by (10)\n                        end\n                        delete this clone\n                    else\n                        switch costume to (costume5 v)\n                        repeat (30)\n                            move (12) steps\n                            turn right (6) degrees\n                            if <touching (player v)?> then\n                                create clone of (player v)\n                                broadcast (Restart v)\n                            end\n                            if <touching (level v)?> then\n                                repeat (10)\n                                    change [ghost v] effect by (10)\n                                end\n                                delete this clone\n                            end\n                        end\n                        repeat until <touching (level v)?>\n                            change y by (-5)\n                            if <touching (player v)?> then\n                                create clone of (player v)\n                                broadcast (Restart v)\n                            end\n                        end\n                        repeat (10)\n                            change [ghost v] effect by (10)\n                        end\n                        delete this clone\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [3]> then\n        if <(dead) = [0]> then\n            switch costume to (weapon3 v)\n            set [katana rotation v] to ((direction) / (90))\n            create clone of (_myself_ v)\n            switch costume to (costume2 v)\n        end\n        wait (1.5) seconds\n    end\nend\n\nwhen I receive [restart v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [5]> then\n        if <(dead) = [0]> then\n            switch costume to (costume7 v)\n            set [katana rotation v] to ((direction) / (90))\n            create clone of (_myself_ v)\n            switch costume to (yelo neja v)\n        end\n        wait (1) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [7]> then\n        if <(dead) = [0]> then\n            switch costume to (costume8 v)\n            set [katana rotation v] to ((direction) / (90))\n            create clone of (_myself_ v)\n            switch costume to (grey v)\n        end\n        wait (2) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [19]> then\n        go to [back v] layer\n        go [forward v] (2) layers\n        if <touching (player v)?> then\n            change [x v] by ((([direction v] of [player v]) / (-90)) * (10))\n        end\n        repeat (1)\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [9]> then\n        if <(dead) = [0]> then\n            switch costume to (cake-a v)\n            create clone of (_myself_ v)\n            switch costume to (prpo v)\n        end\n    end\nend\n\nset [lives for player v] to [5]\n\nbroadcast (Restart v)\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [11]> then\n        if <(dead) = [0]> then\n            switch costume to (costume11 v)\n            set [katana rotation v] to ((direction) / (90))\n            create clone of (_myself_ v)\n            switch costume to (costume9 v)\n        end\n        wait (3) seconds\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [20]> then\n    set size to (130) %\n    show\n    set [xv v] to (((direction) / (90)) * (7))\n    set [yv v] to [0]\n    repeat (30)\n        change x by (xv)\n        change [yv v] by (-1)\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (-4)\n            set [xv v] to ((xv) * (-1))\n        end\n        change y by (yv)\n        if <touching (level v)?> then\n            change y by (4)\n            set [yv v] to ((yv) - ((yv) * (pick random (1) to (2))))\n        end\n    end\n    set size to (40) %\n    repeat (7)\n        next costume\n        if <touching (player v)?> then\n            create clone of (player v)\n            broadcast (Restart v)\n        end\n    end\n    delete this clone\nend\n\n@Sprite4\n\nwhen I receive [w3 v]\nset [turn v] to [0]\nforever\n    point in direction (Turn)\n    if <(Weapon Number) = [3]> then\n        show\n        if <key (space v) pressed?> then\n            repeat until <not <key (space v) pressed?>>\n                change [turn v] by (10)\n                point in direction (Turn)\n            end\n            point in direction (Turn)\n            create clone of (_myself_ v)\n            wait until <not <key (space v) pressed?>>\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ndelete this clone\n\nwhen flag clicked\nhide\nwait until <([costume # v] of [level v]) = [1]>\nforever\n    if <([costume # v] of [level v]) = [4]> then\n        show\n        go to x: (-47) y: (20)\n        stop [this script v]\n    end\nend\n\ndefine Position\nif <([direction v] of [player v]) = [90]> then\n    go to x: (([x position v] of [player v]) + (28)) y: ([y position v] of [player v])\nelse\n    go to x: (([x position v] of [player v]) + (-28)) y: ([y position v] of [player v])\nend\nswitch costume to (thumbnail4 v)\ngo to [front v] layer\nset size to (100) %\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nclear graphic effects\nrepeat until <<touching (level v)?> or <touching (_edge_ v)?>>\n    move (15) steps\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [w3 v]\nforever\n    Position\n    switch costume to (thumbnail2 v)\nend\n\n@Sprite3\n\ndefine Swing\nshow\nif <([direction v] of [player v]) = [90]> then\n    set size to (150) %\n    point in direction (30)\n    repeat (7)\n        turn right (20) degrees\n        switch costume to (swing v)\n        go to (player v)\n        broadcast (switch costume v)\n    end\nelse\n    set size to (150) %\n    point in direction (150)\n    repeat (7)\n        turn right (-20) degrees\n        switch costume to (swing2 v)\n        go to (player v)\n        broadcast (switch costume v)\n    end\nend\nhide\n\nwhen I start as a clone\nforever\n    show\n    point in direction (90)\n    switch costume to (swing3 v)\n    set size to (200) %\n    repeat (10)\n        change y by (1)\n    end\n    repeat (20)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (1)\n    end\n    go to x: (-45) y: (19)\nend\n\nwhen I receive [w1 v]\nforever\n    if <<(Weapon Number) = [1]> and <key (space v) pressed?>> then\n        Swing\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [flash v]\nif <(Weapon Number) = [1]> then\n    Swing\nend\n\n@Sprite2\n\nwhen I receive [w2 v]\nforever\n    if <<(Weapon Number) = [2]> and <key (space v) pressed?>> then\n        create clone of (_myself_ v)\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen flag clicked\ndelete this clone\n\nwhen flag clicked\nforever\n    point in direction (90)\n    switch costume to (costume1 v)\n    set size to (200) %\n    repeat (10)\n        change y by (1)\n    end\n    repeat (20)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (1)\n    end\n    go to x: (-120) y: (0)\nend\n\nwhen I start as a clone\ngo to (player v)\nshow\nset size to (150) %\nclear graphic effects\nif <([direction v] of [player v]) = [90]> then\n    repeat until <<touching (_edge_ v)?> or <touching (level v)?>>\n        change x by (10)\n    end\nelse\n    repeat until <<touching (_edge_ v)?> or <touching (level v)?>>\n        change x by (-10)\n    end\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nshow\n\nwhen I receive [flash v]\nif <(Weapon Number) = [2]> then\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\n\n@Button1\n\nwhen flag clicked\nswitch costume to (造型1 v)\ncreate clone of (_myself_ v)\nswitch costume to (change v)\nforever\n    go to [front v] layer\n    set [ghost v] effect to (20)\n    if <touching (mouse-pointer v)?> then\n        set size to (130) %\n        set [show b1v v] to [1]\n    else\n        set size to (120) %\n        set [show b1v v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    point in direction (90)\n    repeat (10)\n        turn left (1) degrees\n    end\n    repeat (20)\n        turn left (-1) degrees\n    end\n    repeat (10)\n        turn left (1) degrees\n    end\nend\n\nwhen I start as a clone\nforever\n    go to (mouse-pointer v)\n    go to [front v] layer\n    if <(Show B1v) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    set y to (-150)\n    if <([direction v] of [player v]) = [90]> then\n        set x to (205)\n    else\n        set x to (-205)\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Switch weapon v)\nwait until <not <touching (mouse-pointer v)?>>\n\nwhen I receive [#intro done v]\nshow\n\nwhen flag clicked\nhide\n\n@Button2\n\nwhen flag clicked\nswitch costume to (造型1 v)\ncreate clone of (_myself_ v)\nswitch costume to (change v)\nforever\n    go to [front v] layer\n    set [ghost v] effect to (20)\n    if <touching (mouse-pointer v)?> then\n        set [show b2v v] to [1]\n        set size to (130) %\n        if <(Weapon Number) = [3]> then\n            if <mouse down?> then\n                repeat until <not <mouse down?>>\n                    change [turn v] by (10)\n                end\n                create clone of (sprite4 v)\n            end\n        end\n        if <(Weapon Number) = [4]> then\n            if <mouse down?> then\n                create clone of (sprite6 v)\n                wait until <not <mouse down?>>\n            end\n        end\n        if <(Weapon Number) = [6]> then\n            if <mouse down?> then\n                create clone of (sprite8 v)\n                wait until <not <mouse down?>>\n            end\n        end\n    else\n        set size to (120) %\n        set [show b2v v] to [0]\n    end\n    set y to (-150)\n    if <([direction v] of [player v]) = [90]> then\n        set x to (155)\n    else\n        set x to (-155)\n    end\nend\n\nwhen flag clicked\nforever\n    point in direction (90)\n    repeat (10)\n        turn left (1) degrees\n    end\n    repeat (20)\n        turn left (-1) degrees\n    end\n    repeat (10)\n        turn left (1) degrees\n    end\nend\n\nwhen I start as a clone\nforever\n    go to (mouse-pointer v)\n    go to [front v] layer\n    if <(Show b2v) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Flash v)\nwait until <not <touching (mouse-pointer v)?>>\n\nwhen flag clicked\nhide\n\nwhen I receive [#intro done v]\nshow\n\n@Sprite5\n\n@Sprite6\n\nshow\n\nwhen I receive [w4 v]\nset [turn v] to [0]\nforever\n    point in direction (Turn)\n    if <(Weapon Number) = [4]> then\n        if <key (space v) pressed?> then\n            broadcast (switch costume v)\n            create clone of (_myself_ v)\n            wait until <not <key (space v) pressed?>>\n        end\n        hide\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ndelete this clone\n\ndefine Position\nset rotation style [left-right v]\nswitch costume to (costume1 v)\nif <([direction v] of [player v]) = [90]> then\n    point in direction (90)\n    go to x: (([x position v] of [player v]) + (28)) y: ([y position v] of [player v])\nelse\n    go to x: (([x position v] of [player v]) + (-28)) y: ([y position v] of [player v])\n    point in direction (-90)\nend\ngo to [front v] layer\nset size to (60) %\n\nwhen I start as a clone\nshow\nset [me? v] to (([direction v] of [player v]) / (90))\nset rotation style [all around v]\nif <(me?) = [1]> then\n    switch costume to (costume1 v)\nelse\n    switch costume to (thumbnail2 v)\nend\nclear graphic effects\npoint in direction (0)\nrepeat (30)\n    move (11) steps\n    turn right ((me?) * (6)) degrees\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\n    if <touching (level v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\nend\nrepeat until <touching (level v)?>\n    move (10) steps\n    turn right ((me?) * (6)) degrees\n    if <touching (_edge_ v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\n    if <(direction) < [170]> then\n        repeat until <touching (level v)?>\n            move (10) steps\n            turn right ((me?) * (1)) degrees\n            if <touching (_edge_ v)?> then\n                repeat (10)\n                    change [ghost v] effect by (10)\n                end\n                delete this clone\n            end\n        end\n    end\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [w4 v]\nforever\n    Position\nend\n\n@LAVA\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    set [ghost v] effect to (40)\n    go to [back v] layer\n    change y by (tide)\n    switch costume to ([costume # v] of [level v])\nend\n\nwhen flag clicked\nforever\n    set [tide v] to [0]\n    repeat (10)\n        change [tide v] by (0.1)\n    end\n    repeat (20)\n        change [tide v] by (-0.1)\n    end\n    repeat (10)\n        change [tide v] by (0.1)\n    end\nend\n\nset [y v] to [0]\nset [x v] to [0]\n\n@角色1\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [12]> then\n        show\n    else\n        hide\n    end\n    set size to (350) %\nend\n\nwhen flag clicked\nset [effect v] to [0]\nforever\n    set y to ((([cos v] of ((Effect) * (2)) ) * (10)) + (-50))\n    point in direction ((90) + (([cos v] of (Effect) ) * (3)))\n    change [effect v] by (11)\nend\n\n@角色2\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (20)\n    go to (角色1 v)\n    go to [back v] layer\n    turn right (3) degrees\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [12]> then\n        show\n    else\n        hide\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    reset timer\n    hide\nend\n\nwhen [timer v] > (0.01)\nset [ghost v] effect to (100)\nrepeat (10)\n    show\n    change [ghost v] effect by (-10)\n    go to [front v] layer\nend\n\n@WATER\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    set [ghost v] effect to (40)\n    go to [back v] layer\n    change y by (tide)\n    switch costume to ([costume # v] of [level v])\nend\n\nwhen flag clicked\nforever\n    set [tide v] to [0]\n    repeat (10)\n        change [tide v] by (0.1)\n    end\n    repeat (20)\n        change [tide v] by (-0.1)\n    end\n    repeat (10)\n        change [tide v] by (0.1)\n    end\nend\n\n@Intro\n\ndefine Clone number (#)\nswitch costume to (#)\nshow\nif <(#) = [19]> then\n    show\n    switch costume to (costume13 v)\n    go to [front v] layer\n    set size to (50) %\n    clear graphic effects\n    go to x: (0) y: (0)\n    repeat until <(round (y position)) = [150]>\n        change y by (((150) - (y position)) / (4))\n    end\n    repeat until <(round (y position)) = [0]>\n        change y by (((0) - (y position)) / (2))\n    end\n    repeat until <<(round (size)) = [1800]> and <(round (direction)) = [90]>>\n        switch costume to (costume14 v)\n        change size by (((1800) - (size)) / (4))\n        switch costume to (costume13 v)\n    end\n    broadcast (Intro del clones v) and wait\n    broadcast (#Intro Done v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\nif <(#) = [1]> then\n    set rotation style [all around v]\n    point in direction (60)\n    set size to (80) %\n    go to x: (352) y: (60)\n    Smooth glide [0] [20] [90] [85] speed [4]\n    set [@speed v] to [0]\n    repeat (22)\n        change [@speed v] by (-1)\n        change x by (@Speed)\n        change [ghost v] effect by ([abs v] of ((@Speed) / (2)) )\n    end\n    set [@speed v] to [12]\n    wait (1) seconds\n    clear graphic effects\n    set rotation style [left-right v]\n    set size to (85) %\n    point in direction (-90)\n    go to x: (-326) y: (20)\n    repeat (26)\n        change [@speed v] by (1)\n        change x by (@Speed)\n    end\n    delete this clone\nend\nif <(#) = [2]> then\n    set rotation style [all around v]\n    point in direction (60)\n    set size to (80) %\n    go to x: (352) y: (60)\n    Smooth glide [0] [20] [90] [85] speed [4]\n    set [@speed v] to [0]\n    switch costume to (pi2 v)\n    set [clone# v] to [5]\n    repeat (2)\n        change [clone# v] by (1)\n        create clone of (_myself_ v)\n    end\n    set [clone# v] to [14]\n    repeat (2)\n        change [clone# v] by (1)\n        create clone of (_myself_ v)\n    end\n    point in direction (90)\n    repeat (11)\n        change [@speed v] by (-1)\n        change y by (@Speed)\n        change size by (([abs v] of (@Speed) ) / (0.7))\n    end\nend\nif <(#) = [3]> then\n    set size to (100) %\n    point in direction (90)\n    go to x: (0) y: (0)\n    go to [front v] layer\nend\nif <(#) = [4]> then\n    point in direction (90)\n    set size to (100) %\n    go to x: (0) y: (0)\n    go to [back v] layer\nend\nif <(#) = [6]> then\n    go to x: (0) y: (20)\n    point in direction (-90)\n    set rotation style [all around v]\n    set size to (85) %\n    clear graphic effects\n    set [@speed v] to [0]\n    go to [front v] layer\n    forever\n        change [@speed v] by (1)\n        move ((@Speed) * (2)) steps\n        turn right (() - (@Speed)) degrees\n        change [ghost v] effect by ((@Speed) / (2))\n        change size by ((@Speed) / (3))\n    end\nend\nif <(#) = [7]> then\n    go to x: (0) y: (20)\n    point in direction (90)\n    set rotation style [all around v]\n    set size to (85) %\n    clear graphic effects\n    set [@speed v] to [0]\n    go to [front v] layer\n    forever\n        change [@speed v] by (1)\n        move ((@Speed) * (2)) steps\n        turn right (@Speed) degrees\n        change size by ((@Speed) / (3))\n        change [ghost v] effect by ((@Speed) / (2))\n    end\nend\nif <(#) = [8]> then\n    go to x: (-180) y: (20)\nend\nif <(#) = [9]> then\n    go to x: (-120) y: (20)\nend\nif <(#) = [10]> then\n    go to x: (-60) y: (20)\nend\nif <(#) = [11]> then\n    go to x: (0) y: (20)\nend\nif <(#) = [12]> then\n    go to x: (60) y: (20)\nend\nif <(#) = [13]> then\n    go to x: (120) y: (20)\nend\nif <(#) = [14]> then\n    go to x: (180) y: (20)\nend\nif <<(#) > [7]> and <[15] > (#)>> then\n    set size to (85) %\n    point in direction (90)\nend\nif <(#) = [15]> then\n    go to x: (-124) y: (0)\n    Smooth glide [0] [0] [90] [90] speed [4]\nend\nif <(#) = [16]> then\n    go to x: (124) y: (0)\n    Smooth glide [0] [0] [90] [90] speed [4]\nend\nif <<(#) > [7]> and <[17] > (#)>> then\n    set [@speed v] to [0]\n    forever\n        if <[15] > (#)> then\n            set y to ((([cos v] of ((@Speed) * (2)) ) * (10)) + (20))\n        else\n            set y to ((([cos v] of ((@Speed) * (2)) ) * (10)) + (0))\n        end\n        point in direction ((90) + (([cos v] of (@Speed) ) * (3)))\n        change [@speed v] by (11)\n    end\nend\nif <(#) = [17]> then\n    go to [back v] layer\n    go [forward v] (1) layers\n    point in direction (90)\n    go to x: (-240) y: (180)\n    set [ghost v] effect to (50)\n    set [@speed v] to [0]\n    forever\n        set rotation style [all around v]\n        set [@speed v] to [0]\n        repeat (25)\n            change [@speed v] by (0.25)\n            turn right (@Speed) degrees\n        end\n        set [@speed v] to [0]\n        repeat (25)\n            change [@speed v] by (0.25)\n            turn left (@Speed) degrees\n        end\n    end\nend\nif <(#) = [18]> then\n    go to [back v] layer\n    go [forward v] (1) layers\n    point in direction (90)\n    go to x: (240) y: (180)\n    set [ghost v] effect to (50)\n    forever\n        set rotation style [all around v]\n        set [@speed v] to [0]\n        repeat (25)\n            change [@speed v] by (0.25)\n            turn left (@Speed) degrees\n        end\n        set [@speed v] to [0]\n        repeat (25)\n            change [@speed v] by (0.25)\n            turn right (@Speed) degrees\n        end\n    end\nend\n\ndefine Create clones\nset [clone# v] to [0]\nrepeat (4)\n    change [clone# v] by (1)\n    create clone of (_myself_ v)\nend\nset [clone# v] to [17]\ncreate clone of (_myself_ v)\nset [clone# v] to [18]\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nCreate clones\n\nwhen I start as a clone\nClone number (Clone#)\n\ndefine Smooth glide (x) (y) (dir) (size) speed ()\nrepeat until <<<(round (x position)) = (x)> and <(round (y position)) = (y)>> and <<(round (direction)) = (dir)> and <(round (size)) = (size)>>>\n    change x by (((x) - (x position)) / ())\n    change y by (((y) - (y position)) / ())\n    turn right (((dir) - (direction)) / (() / (0.5))) degrees\n    change size by (((size) - (size)) / ())\nend\n\nwait until <(x position) > [-150]>\nset [clone# v] to [8]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone#) = [1]> then\n    wait (1.782) seconds\n    wait until <(x position) > [-150]>\n    set [clone# v] to [8]\n    create clone of (_myself_ v)\n    wait until <(x position) > [-100]>\n    set [clone# v] to [9]\n    create clone of (_myself_ v)\n    wait until <(x position) > [-50]>\n    set [clone# v] to [10]\n    create clone of (_myself_ v)\n    wait until <(x position) > [0]>\n    set [clone# v] to [11]\n    create clone of (_myself_ v)\n    wait until <(x position) > [50]>\n    set [clone# v] to [12]\n    create clone of (_myself_ v)\n    wait until <(x position) > [100]>\n    set [clone# v] to [13]\n    create clone of (_myself_ v)\n    wait until <(x position) > [150]>\n    set [clone# v] to [14]\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nwait (5) seconds\n\nwhen flag clicked\nstart sound [Intro Music v]\nset volume to (100) %\nwait (5) seconds\nset [clone# v] to [19]\ncreate clone of (_myself_ v)\nwait (.3) seconds\nrepeat (50)\n    change volume by (-2)\nend\nstop all sounds\n\nwhen I receive [intro del clones v]\nif <not <(Clone#) = [19]>> then\n    delete this clone\nend\n\n@Sprite7\n\nwhen I receive [w5 v]\nset [turn v] to [0]\nforever\n    point in direction (Turn)\n    if <(Weapon Number) = [5]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ndelete this clone\n\nwhen flag clicked\nhide\n\ndefine Position\nset rotation style [left-right v]\nswitch costume to (costume1 v)\nif <([direction v] of [player v]) = [90]> then\n    point in direction (90)\n    go to x: (([x position v] of [player v]) + (28)) y: ([y position v] of [player v])\nelse\n    go to x: (([x position v] of [player v]) + (-28)) y: ([y position v] of [player v])\n    point in direction (-90)\nend\nset size to (150) %\n\nwhen I receive [w5 v]\nforever\n    Position\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [#intro done v]\nshow\nbroadcast (W5 v)\n\n@Tele\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [10]> then\n        show\n    else\n        hide\n    end\nend\n\n