Mega Man X Scrolling Platformer

Instructions: //Controls\nLeft / Right key - Move\nZ - Fire (hold Z to charge, then release Z for bigger shot)\nX - Jump\nC - Dash\n

@Stage\n\n@Player\n\ndefine Set Costume (#costume)\nif <not <(#costume) = (costume [number v])>> then\n    switch costume to (#costume)\nend\n\nwhen flag clicked\nhide\nbroadcast (Transition In v) and wait\nbroadcast (SetUp v) and wait\nbroadcast (Level Loop v)\nbroadcast (Play v)\nbroadcast (Transition Out v) and wait\nbroadcast (Play BG Music v)\n\nwhen I receive [setup v]\nReset Player\n\ndefine Reset Player\nshow\nset size to (200) %\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (0) y: (-60)\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [scroll x min v] to [0]\nset [scroll y min v] to [0]\nset [scroll x max v] to [3360]\nset [scroll y max v] to [100]\nset [wall slide v] to [0]\nset [wall jump v] to [0]\nset [gravity toggle v] to [1]\nset [moving left v] to [0]\nset [moving right v] to [0]\nset [costume no. v] to [1]\nset [wall jump animation v] to [0]\nset [animation state v] to [0]\nset [dashing v] to [0]\nset [firing v] to [0]\nset [fire duration v] to [0]\nset [charging v] to [0]\nset [@fall v] to [0]\nset [@idle v] to [0]\nset [@idle_fire v] to [0]\nset [@jump v] to [0]\nset [@walk v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nset [@dash v] to [0]\nset [brightness v] effect to (0)\nhide\n\nwhen I receive [play v]\nshow\nforever\n    Platforming Engine [5]\nend\n\ndefine Platforming Engine (speed)\nswitch costume to (hitbox v)\nif <(Firing) = [1]> then\n    if <(Fire Duration) < [1]> then\n        set [fire duration v] to [0]\n        set [firing v] to [0]\n        set [@idle_fire v] to [0]\n    else\n        change [fire duration v] by (-1)\n    end\nend\nif <(fire key) = [1]> then\n    change [charging v] by (1)\n    if <(Charging) > [15]> then\n        change [brightness v] effect by (1)\n    end\n    if <(Charging) = [15]> then\n        start sound [MMX1_SE_00011 v]\n    end\n    if <(Charging) = [58]> then\n        start sound [MMX1_SE_00011_Loop v]\n    end\n    if <(Charging) = [63]> then\n        set [charging v] to [57]\n        change [brightness v] effect by (-6)\n    end\nend\nif <(Gravity Toggle) = [1]> then\n    if <<(speed y) < [4]> or <key (x v) pressed?>> then\n        change [speed y v] by (-1)\n    else\n        change [speed y v] by (-2)\n    end\n    if <(speed y) < [-15]> then\n        set [speed y v] to [-15]\n    end\nend\nchange y by (speed y)\nTouch Ground <(speed y) > [0]>\nif <(Wall Jump) > [0]> then\n    change [wall jump v] by (-1)\n    if <<(Moving Left) = [1]> and <not <(Moving Right) = [1]>>> then\n        if <(Dashing) = [2]> then\n            Walk [-90] ((speed) * (-2))\n        else\n            Walk [-90] ((speed) * (-1))\n        end\n    else\n        if <<(Moving Right) = [1]> and <not <(Moving Left) = [1]>>> then\n            if <(Dashing) = [2]> then\n                Walk [90] ((speed) * (2))\n            else\n                Walk [90] (speed)\n            end\n        end\n    end\nelse\n    if <(Dashing) = [1]> then\n        if <<(Moving Left) = [1]> and <not <(Moving Right) = [1]>>> then\n            Walk [-90] ((speed) * (-2))\n        else\n            if <<(Moving Right) = [1]> and <not <(Moving Left) = [1]>>> then\n                Walk [90] ((speed) * (2))\n            end\n        end\n    else\n        set [moving left v] to [0]\n        set [moving right v] to [0]\n        if <key (left arrow v) pressed?> then\n            if <<(Wall Slide) = [1]> and <(direction) = [90]>> then\n                set [wall slide v] to [0]\n                set [gravity toggle v] to [1]\n                set [falling? v] to [6]\n            end\n            if <(Dashing) = [2]> then\n                Walk [-90] ((speed) * (-2))\n            else\n                Walk [-90] ((speed) * (-1))\n            end\n        else\n            if <key (right arrow v) pressed?> then\n                if <<(Wall Slide) = [1]> and <(direction) = [-90]>> then\n                    set [wall slide v] to [0]\n                    set [gravity toggle v] to [1]\n                    set [falling? v] to [6]\n                end\n                if <(Dashing) = [2]> then\n                    Walk [90] ((speed) * (2))\n                else\n                    Walk [90] (speed)\n                end\n            else\n                if <(Wall Slide) = [1]> then\n                    set [wall slide v] to [0]\n                    set [gravity toggle v] to [1]\n                    set [falling? v] to [6]\n                end\n                set [animation state v] to [0]\n            end\n        end\n    end\nend\nif <key (x v) pressed?> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        start sound [MMX1_SE_00014 v]\n        set [speed y v] to [15]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n        if <(Dashing) = [1]> then\n            set [dashing v] to [2]\n        end\n    end\nelse\n    set [jump key v] to [0]\nend\nif <key (c v) pressed?> then\n    if <<(dash key) = [0]> and <<(falling?) = [0]> and <<(Dashing) = [0]> and <(Wall Slide) = [0]>>>> then\n        start sound [MMX1_SE_00016 v]\n        if <(direction) = [-90]> then\n            set [moving left v] to [1]\n            set [moving right v] to [0]\n        else\n            if <(direction) = [90]> then\n                set [moving right v] to [1]\n                set [moving left v] to [0]\n            end\n        end\n        set [dashing v] to [1]\n        set [dash key v] to [1]\n    end\nelse\n    set [dash key v] to [0]\nend\nif <key (z v) pressed?> then\n    if <(fire key) = [0]> then\n        start sound [MMX1_SE_00009 v]\n        set [@idle_fire v] to [0]\n        set [firing v] to [1]\n        set [fire duration v] to [10]\n        set [fire key v] to [1]\n        set [shot type v] to [1]\n        create clone of (player projectile v)\n    end\nelse\n    set [fire key v] to [0]\n    if <(Charging) > [50]> then\n        start sound [MMX1_SE_00010 v]\n        set [@idle_fire v] to [0]\n        set [firing v] to [1]\n        set [fire duration v] to [10]\n        set [shot type v] to [3]\n        create clone of (player projectile v)\n        set [charging v] to [0]\n        set [brightness v] effect to (0)\n    else\n        if <(Charging) > [15]> then\n            start sound [MMX1_SE_00012 v]\n            set [@idle_fire v] to [0]\n            set [firing v] to [1]\n            set [fire duration v] to [10]\n            set [shot type v] to [2]\n            create clone of (player projectile v)\n            set [charging v] to [0]\n            set [brightness v] effect to (0)\n        else\n            set [charging v] to [0]\n            set [brightness v] effect to (0)\n        end\n    end\nend\nif <(y position) < [-180]> then\n    start sound [MMX1_SE_00018 v]\n    go to x: (0) y: (-60)\n    point in direction (90)\n    set [scroll x v] to [0]\n    set [scroll y v] to [0]\n    set [speed y v] to [0]\n    set [charging v] to [0]\n    set [brightness v] effect to (0)\nend\nAnimation\nSet Costume (Costume NO.)\nScrolling Blocks\n\ndefine Touch Ground <up?>\nif <(Gravity Toggle) = [1]> then\n    change [falling? v] by (1)\nend\nrepeat until <not <touching (level_hit v)?>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        if <(Wall Slide) = [1]> then\n            set [wall slide v] to [0]\n            set [gravity toggle v] to [1]\n        end\n        if <(Dashing) > [1]> then\n            set [dashing v] to [0]\n        end\n        if <(speed y) < [-6]> then\n            start sound [MMX1_SE_00015 v]\n        end\n        set [falling? v] to [0]\n        set [wall jump animation v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching (level_hit v)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<<(falling?) > [10]> and <(Wall Jump) = [0]>> and <<not <(Moving Right) = [1]>> and <not <(Moving Left) = [1]>>>> then\n        set [wall slide v] to [1]\n        set [speed y v] to [0]\n        set [gravity toggle v] to [0]\n        set [falling? v] to [0]\n        set [wall jump animation v] to [0]\n        set [dashing v] to [0]\n        start sound [MMX1_SE_00015 v]\n    end\n    if <<(Wall Slide) = [1]> and <(Wall Jump) = [0]>> then\n        if <(@Wall Cling) > [3]> then\n            set [speed y v] to [-2]\n        end\n        if <<key (x v) pressed?> and <<(Wall Jump) = [0]> and <<(Moving Left) = [0]> and <(Moving Right) = [0]>>>> then\n            if <(direction) = [90]> then\n                point in direction (-90)\n                set [moving left v] to [1]\n                set [moving right v] to [0]\n            else\n                if <(direction) = [-90]> then\n                    point in direction (90)\n                    set [moving right v] to [1]\n                    set [moving left v] to [0]\n                end\n            end\n            if <key (c v) pressed?> then\n                set [dashing v] to [2]\n            end\n            set [speed y v] to [13]\n            set [wall slide v] to [0]\n            set [gravity toggle v] to [1]\n            set [falling? v] to [6]\n            set [wall jump v] to [8]\n            set [wall jump animation v] to [1]\n            set [@wall jump v] to [0]\n            start sound [MMX1_SE_00014 v]\n        end\n    end\n    if <(Dashing) = [1]> then\n        set [dashing v] to [0]\n        set [@dash v] to [0]\n    end\nend\nif <<(Wall Slide) = [1]> and <(slope) = [0]>> then\n    set [wall slide v] to [0]\n    set [gravity toggle v] to [1]\n    set [falling? v] to [6]\nend\nif <(Wall Slide) = [1]> then\n    set [animation state v] to [9]\nelse\n    if <(Dashing) = [1]> then\n        set [animation state v] to [2]\n        if <(falling?) > [5]> then\n            set [dashing v] to [2]\n        end\n    else\n        set [animation state v] to [1]\n    end\nend\nset [@idle_fire v] to [0]\n\ndefine Scrolling Blocks\nchange [scroll x v] by (x position)\nif <(Scroll X) < (Scroll X Min)> then\n    set [scroll x v] to (Scroll X Min)\nelse\n    if <(Scroll X) > (Scroll X Max)> then\n        set [scroll x v] to (Scroll X Max)\n    else\n        set x to (0)\n    end\nend\nchange [scroll y v] by (y position)\nif <(Scroll Y) < (Scroll Y Min)> then\n    set [scroll y v] to (Scroll Y Min)\nelse\n    if <(Scroll Y) > (Scroll Y Max)> then\n        set [scroll y v] to (Scroll Y Max)\n    else\n        set y to (0)\n    end\nend\n\ndefine Animation\nif <(falling?) < [6]> then\n    if <<(Animation State) = [1]> and <(Wall Slide) = [0]>> then\n        set [@idle v] to [0]\n        set [@jump v] to [0]\n        set [@fall v] to [0]\n        set [@wall cling v] to [0]\n        set [@wall jump v] to [0]\n        set [@dash v] to [0]\n        set [@idle_fire v] to [0]\n        change [@walk v] by (1)\n        if <(Firing) = [1]> then\n            if <(@Walk) > [0]> then\n                set [costume no. v] to [31]\n            end\n            if <(@Walk) > [2]> then\n                set [costume no. v] to [31]\n            end\n            if <(@Walk) > [4]> then\n                set [costume no. v] to [32]\n            end\n            if <(@Walk) > [6]> then\n                set [costume no. v] to [33]\n            end\n            if <(@Walk) > [8]> then\n                set [costume no. v] to [34]\n            end\n            if <(@Walk) > [10]> then\n                set [costume no. v] to [35]\n            end\n            if <(@Walk) > [12]> then\n                set [costume no. v] to [36]\n            end\n            if <(@Walk) > [14]> then\n                set [costume no. v] to [37]\n            end\n            if <(@Walk) > [16]> then\n                set [costume no. v] to [38]\n            end\n            if <(@Walk) > [18]> then\n                set [costume no. v] to [39]\n            end\n            if <(@Walk) > [20]> then\n                set [costume no. v] to [40]\n            end\n            if <(@Walk) > [22]> then\n                set [costume no. v] to [31]\n                set [@walk v] to [3]\n            end\n        else\n            if <(@Walk) = [1]> then\n                set [costume no. v] to [4]\n            end\n            if <(@Walk) = [3]> then\n                set [costume no. v] to [5]\n            end\n            if <(@Walk) = [5]> then\n                set [costume no. v] to [6]\n            end\n            if <(@Walk) = [7]> then\n                set [costume no. v] to [7]\n            end\n            if <(@Walk) = [9]> then\n                set [costume no. v] to [8]\n            end\n            if <(@Walk) = [11]> then\n                set [costume no. v] to [9]\n            end\n            if <(@Walk) = [13]> then\n                set [costume no. v] to [10]\n            end\n            if <(@Walk) = [15]> then\n                set [costume no. v] to [11]\n            end\n            if <(@Walk) = [17]> then\n                set [costume no. v] to [12]\n            end\n            if <(@Walk) = [19]> then\n                set [costume no. v] to [13]\n            end\n            if <(@Walk) = [21]> then\n                set [costume no. v] to [14]\n            end\n            if <(@Walk) = [23]> then\n                set [costume no. v] to [5]\n                set [@walk v] to [3]\n            end\n        end\n    else\n        if <(Animation State) = [2]> then\n            set [@fall v] to [0]\n            set [@idle v] to [0]\n            set [@jump v] to [0]\n            set [@walk v] to [0]\n            set [@wall cling v] to [0]\n            set [@wall jump v] to [0]\n            set [@idle_fire v] to [0]\n            change [@dash v] by (1)\n            if <(Firing) = [1]> then\n                if <(@Dash) > [0]> then\n                    set [costume no. v] to [41]\n                end\n                if <(@Dash) > [3]> then\n                    set [costume no. v] to [42]\n                end\n                if <(@Dash) > [15]> then\n                    set [costume no. v] to [41]\n                end\n                if <(@Dash) > [17]> then\n                    set [costume no. v] to [29]\n                    set [dashing v] to [0]\n                end\n            else\n                if <(@Dash) = [1]> then\n                    set [costume no. v] to [15]\n                end\n                if <(@Dash) = [4]> then\n                    set [costume no. v] to [16]\n                end\n                if <(@Dash) = [16]> then\n                    set [costume no. v] to [15]\n                end\n                if <(@Dash) = [18]> then\n                    set [costume no. v] to [1]\n                    set [dashing v] to [0]\n                end\n            end\n        else\n            if <<(Animation State) = [9]> and <(Wall Slide) = [1]>> then\n                set [@fall v] to [0]\n                set [@idle v] to [0]\n                set [@jump v] to [0]\n                set [@walk v] to [0]\n                set [@wall jump v] to [0]\n                set [@dash v] to [0]\n                set [@idle_fire v] to [0]\n                change [@wall cling v] by (1)\n                if <(Firing) = [1]> then\n                    if <(@Wall Cling) > [0]> then\n                        set [costume no. v] to [50]\n                    end\n                    if <(@Wall Cling) > [3]> then\n                        set [costume no. v] to [51]\n                    end\n                    if <(@Wall Cling) > [6]> then\n                        set [costume no. v] to [52]\n                    end\n                else\n                    if <(@Wall Cling) = [1]> then\n                        set [costume no. v] to [24]\n                    end\n                    if <(@Wall Cling) = [4]> then\n                        set [costume no. v] to [25]\n                    end\n                    if <(@Wall Cling) > [6]> then\n                        set [costume no. v] to [26]\n                    end\n                end\n            else\n                if <(Firing) = [1]> then\n                    set [@dash v] to [0]\n                    set [@fall v] to [0]\n                    set [@idle v] to [0]\n                    set [@jump v] to [0]\n                    set [@walk v] to [0]\n                    set [@wall cling v] to [0]\n                    set [@wall jump v] to [0]\n                    change [@idle_fire v] by (1)\n                    if <(@Idle_Fire) = [1]> then\n                        set [costume no. v] to [29]\n                    end\n                    if <(@Idle_Fire) = [3]> then\n                        set [costume no. v] to [30]\n                    end\n                    if <(@Idle_Fire) = [6]> then\n                        set [costume no. v] to [29]\n                    end\n                else\n                    set [@fall v] to [0]\n                    set [@jump v] to [0]\n                    set [@walk v] to [0]\n                    set [@wall cling v] to [0]\n                    set [@wall jump v] to [0]\n                    set [@dash v] to [0]\n                    set [@idle_fire v] to [0]\n                    change [@idle v] by (1)\n                    if <(@Idle) = [1]> then\n                        set [costume no. v] to [1]\n                    end\n                    if <(@Idle) = [80]> then\n                        set [costume no. v] to [2]\n                    end\n                    if <(@Idle) = [82]> then\n                        set [costume no. v] to [3]\n                    end\n                    if <(@Idle) = [84]> then\n                        set [costume no. v] to [2]\n                    end\n                    if <(@Idle) = [86]> then\n                        set [costume no. v] to [1]\n                        set [@idle v] to [1]\n                    end\n                end\n            end\n        end\n    end\nelse\n    if <(Wall Jump Animation) = [1]> then\n        set [@fall v] to [0]\n        set [@idle v] to [0]\n        set [@jump v] to [0]\n        set [@walk v] to [0]\n        set [@wall cling v] to [0]\n        set [@dash v] to [0]\n        set [@idle_fire v] to [0]\n        change [@wall jump v] by (1)\n        if <(Firing) = [1]> then\n            if <(@Wall Jump) > [0]> then\n                set [costume no. v] to [53]\n            end\n            if <(@Wall Jump) > [3]> then\n                set [costume no. v] to [54]\n            end\n            if <(@Wall Jump) > [9]> then\n                set [@jump v] to [5]\n                set [costume no. v] to [45]\n                set [wall jump animation v] to [0]\n            end\n        else\n            if <(@Wall Jump) = [1]> then\n                set [costume no. v] to [27]\n            end\n            if <(@Wall Jump) = [4]> then\n                set [costume no. v] to [28]\n            end\n            if <(@Wall Jump) = [10]> then\n                set [@jump v] to [5]\n                set [costume no. v] to [19]\n                set [wall jump animation v] to [0]\n            end\n        end\n    else\n        if <(speed y) > [0]> then\n            set [@walk v] to [0]\n            set [@idle v] to [0]\n            set [@fall v] to [0]\n            set [@wall cling v] to [0]\n            set [@wall jump v] to [0]\n            set [@dash v] to [0]\n            set [@idle_fire v] to [0]\n            change [@jump v] by (1)\n            if <(Firing) = [1]> then\n                if <(@Jump) > [0]> then\n                    set [costume no. v] to [43]\n                end\n                if <(@Jump) > [2]> then\n                    set [costume no. v] to [44]\n                end\n                if <(@Jump) > [4]> then\n                    set [costume no. v] to [45]\n                end\n            else\n                if <(@Jump) = [1]> then\n                    set [costume no. v] to [17]\n                end\n                if <(@Jump) = [3]> then\n                    set [costume no. v] to [18]\n                end\n                if <(@Jump) = [5]> then\n                    set [costume no. v] to [19]\n                end\n            end\n        else\n            set [@walk v] to [0]\n            set [@idle v] to [0]\n            set [@jump v] to [0]\n            set [@wall cling v] to [0]\n            set [@wall jump v] to [0]\n            set [@dash v] to [0]\n            set [@idle_fire v] to [0]\n            change [@fall v] by (1)\n            if <(Firing) = [1]> then\n                if <(@Fall) > [0]> then\n                    set [costume no. v] to [46]\n                end\n                if <(@Fall) > [2]> then\n                    set [costume no. v] to [47]\n                end\n            else\n                if <(@Fall) = [1]> then\n                    set [costume no. v] to [20]\n                end\n                if <(@Fall) = [3]> then\n                    set [costume no. v] to [21]\n                end\n            end\n        end\n    end\nend\n\n@Level_Art\n\nwhen I receive [setup v]\nshow\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nswitch costume to (vc_1 v)\nCreate\nhide\n\ndefine Create\nFind Costume Number\nrepeat ((Level Costumes) - (1))\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\n    next costume\nend\n\ndefine Find Costume Number\nset [level costumes v] to [1]\nswitch costume to ((1) / (1))\nnext costume\nrepeat until <(costume [number v]) = [1]>\n    change [level costumes v] by (1)\n    next costume\nend\n\nwhen I receive [level loop v]\nforever\n    set x to ((Level_X) - (Scroll X))\n    set y to ((Scroll Y) * (-1))\n    if <([abs v] of ((Level_X) - (Scroll X)) ) > [480]> then\n        hide\n    else\n        show\n    end\nend\n\n@Level_Hit\n\ndefine Create\nwait (1) seconds\nrepeat ((Level Costumes) - (1))\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\n    next costume\nend\n\nwhen I receive [setup v]\nshow\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nswitch costume to (vc_1 v)\nCreate\nhide\n\nwhen I receive [level loop v]\nforever\n    set x to ((Level_X) - (Scroll X))\n    set y to ((Scroll Y) * (-1))\n    if <([abs v] of ((Level_X) - (Scroll X)) ) > [480]> then\n        hide\n    else\n        show\n    end\n    set [ghost v] effect to (100)\nend\n\n@Transition\n\nwhen I receive [transition in v]\nswitch costume to (head0001 v)\nhide\nshow\nstart sound [Disconnect v]\nrepeat (16)\n    next costume\nend\n\nwhen I receive [transition out v]\nswitch costume to (head0017 v)\nstart sound [Connect v]\nrepeat (16)\n    switch costume to ((costume [number v]) - (1))\nend\nhide\n\n@Music\n\nwhen I receive [play bg music v]\nset volume to (30) %\nforever\n    play sound [X3_VoltCatfish v] until done\nend\n\n@Player Projectile\n\nwhen flag clicked\nset [shot type v] to [0]\nset [type v] to [0]\nset [costume no. v] to [1]\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nswitch costume to (x_buster_lv1 v)\nset size to (200) %\nhide\n\nwhen I start as a clone\nset [type v] to (Shot Type)\npoint in direction ([direction v] of [player v])\nif <([wall slide v] of [player v]) = [1]> then\n    if <([direction v] of [player v]) > [0]> then\n        go to x: (([x position v] of [player v]) - (20)) y: (([y position v] of [player v]) + (35))\n        point in direction (-90)\n    end\n    if <([direction v] of [player v]) < [0]> then\n        go to x: (([x position v] of [player v]) + (20)) y: (([y position v] of [player v]) + (35))\n        point in direction (90)\n    end\nelse\n    if <([wall jump v] of [player v]) > [0]> then\n        if <([direction v] of [player v]) > [0]> then\n            go to x: (([x position v] of [player v]) - (20)) y: (([y position v] of [player v]) + (35))\n            point in direction (-90)\n        end\n        if <([direction v] of [player v]) < [0]> then\n            go to x: (([x position v] of [player v]) + (20)) y: (([y position v] of [player v]) + (35))\n            point in direction (90)\n        end\n    else\n        if <([direction v] of [player v]) > [0]> then\n            go to x: (([x position v] of [player v]) + (20)) y: (([y position v] of [player v]) + (35))\n        end\n        if <([direction v] of [player v]) < [0]> then\n            go to x: (([x position v] of [player v]) - (20)) y: (([y position v] of [player v]) + (35))\n        end\n    end\nend\nshow\nforever\n    if <(type) = [1]> then\n        move (14) steps\n        if <touching (level_hit v)?> then\n            start sound [MMX1_SE_00026 v]\n            delete this clone\n        end\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n    end\n    if <(type) = [2]> then\n        move (15) steps\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n    end\n    if <(type) = [3]> then\n        move (16) steps\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n    end\n    Animation\n    Set Costume (Costume NO.)\nend\n\ndefine Set Costume (#costume)\nif <not <(#costume) = (costume [number v])>> then\n    switch costume to (#costume)\nend\n\ndefine Animation\nif <(type) = [2]> then\n    set [@lv3shot v] to [0]\n    change [@lv2shot v] by (1)\n    if <(@LV2Shot) = [1]> then\n        set [costume no. v] to [5]\n    end\n    if <(@LV2Shot) = [3]> then\n        set [costume no. v] to [6]\n    end\n    if <(@LV2Shot) = [5]> then\n        set [costume no. v] to [7]\n    end\n    if <(@LV2Shot) = [7]> then\n        set [costume no. v] to [8]\n    end\n    if <(@LV2Shot) = [9]> then\n        set [costume no. v] to [9]\n    end\n    if <(@LV2Shot) = [11]> then\n        set [costume no. v] to [5]\n        set [@lv2shot v] to [1]\n    end\nelse\n    if <(type) = [3]> then\n        set [@lv2shot v] to [0]\n        change [@lv3shot v] by (1)\n        if <(@LV3Shot) = [1]> then\n            set [costume no. v] to [14]\n        end\n        if <(@LV3Shot) = [3]> then\n            set [costume no. v] to [15]\n        end\n        if <(@LV3Shot) = [5]> then\n            set [costume no. v] to [16]\n        end\n        if <(@LV3Shot) = [7]> then\n            set [costume no. v] to [14]\n            set [@lv3shot v] to [1]\n        end\n    else\n        set [@lv2shot v] to [0]\n        set [@lv3shot v] to [0]\n        set [costume no. v] to [1]\n    end\nend\n\n