Updated Mega Man Scrolling Platformer Engine
@Stage\n\nwhen flag clicked\nset [music v] to [5]\nset volume to (100) %\nforever\n    play sound (Music) until done\nend\n\nwhen flag clicked\nbroadcast (SetUp v)\n\nwhen I receive [oh no a tank squad v]\nrepeat (10)\n    change volume by (-10)\nend\nset [music v] to [3]\nstop all sounds\nrepeat (10)\n    change volume by (10)\nend\n\nwhen I receive [die v]\nrepeat (10)\n    change volume by (-10)\nend\nwait (3) seconds\nset [music v] to [2]\nset volume to (100) %\nstop all sounds\nbroadcast (SetUp v)\nbroadcast (READY v)\nif <(Megaman Costume) = [2]> then\n    set volume to (0) %\n    wait (4) seconds\n    set volume to (100) %\nelse\n    wait (1) seconds\nend\nbroadcast (Teleportin v)\n\nwhen I receive [defeated tank sqaud v]\nset volume to (0) %\nwait (1) seconds\nset [music v] to [2]\nset [checkpoint # v] to [2]\nstop all sounds\nset volume to (100) %\nset [scroll x max v] to [2481]\n\nwhen I receive [transition up v]\nbroadcast (Disable Movement v)\nrepeat (43)\n    change [scroll y max v] by (10)\n    change [scroll y min v] by (10)\n    broadcast (Player_MoveDown v)\nend\nbroadcast (Enable Movement v)\nif <(Checkpoint #) = [2]> then\n    set [checkpoint # v] to [3]\n    set [scroll x max v] to [2481]\n    set [scroll x min v] to [2481]\nelse\n    if <(Checkpoint #) = [5]> then\n        set [checkpoint # v] to [6]\n        set [scroll x max v] to [5570]\n        set [scroll x min v] to [5570]\n    end\nend\n\nwhen I receive [transition down v]\nbroadcast (Disable Movement v)\nrepeat (43)\n    change [scroll y max v] by (-10)\n    change [scroll y min v] by (-10)\n    broadcast (Player_MoveUp v)\nend\nbroadcast (Enable Movement v)\n\nwhen I receive [bossgatetransition v]\nbroadcast (Disable Movement v)\nrepeat (48)\n    change [scroll x max v] by (10)\n    change [scroll x min v] by (10)\n    broadcast (Player_MoveLeft v)\nend\nbroadcast (Enable Movement v)\n\nwhen I receive [trinitro man fight v]\nset [checkpoint # v] to [4]\nrepeat (2)\n    broadcast (Player_MoveUp v)\nend\nset [scroll y max v] to [1690]\nset [scroll y min v] to [1690]\nrepeat (10)\n    change volume by (-10)\nend\nset [music v] to [3]\nstop all sounds\nrepeat (10)\n    change volume by (10)\nend\n\nwhen flag clicked\nset [scroll x max v] to [0]\nset [scroll x min v] to [0]\nset [scroll y max v] to [0]\nset [scroll y min v] to [0]\ndelete all of [activated bossgates v]\nadd [0] to [activated bossgates v]\n\nwhen I receive [bossdie v]\nrepeat (10)\n    change volume by (-10)\nend\nif <(Checkpoint #) = [4]> then\n    wait (1) seconds\n    set [music v] to [2]\n    stop all sounds\n    set volume to (100) %\n    repeat (10)\n        change volume by (10)\n    end\n    broadcast (Enable Movement v)\n    replace item (1) of [activated bossgates v] with [1]\nend\n\nwhen I receive [last boss fight v]\nset [checkpoint # v] to [7]\nrepeat (10)\n    change volume by (-10)\nend\nset [music v] to [4]\nstop all sounds\nrepeat (10)\n    change volume by (10)\nend\n\nwhen I receive [take dmg v]\nset [dmg thingy v] to [1]\ncreate clone of (ready v)\nwait (.02) seconds\nset [dmg thingy v] to [2]\ncreate clone of (ready v)\nwait (.02) seconds\nset [dmg thingy v] to [3]\ncreate clone of (ready v)\nwait (.02) seconds\nset [dmg thingy v] to [4]\ncreate clone of (ready v)\nwait (.02) seconds\n\nwhen I receive [start v]\nrepeat (10)\n    change volume by (-10)\nend\nwait (1.8) seconds\nif <(Megaman Costume) = [2]> then\n    wait (3) seconds\nend\nrepeat (10)\n    change volume by (10)\nend\n\n@hitbox\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        set [using gun? v] to [1]\n    else\n        set [using gun? v] to [0]\n    end\nend\n\nwhen I receive [teleportin v]\nset [falling? v] to [0]\nforever\n    wait until <(falling?) > [3]>\n    wait until <(falling?) < [2]>\n    start sound [Mega Man 5 SFX \(5\) v]\nend\n\nwhen I receive [take dmg v]\nstart sound [Mega Man 5 SFX \(6\) v]\nset [takingdmg v] to [1]\nwait (.6) seconds\nset [takingdmg v] to [0]\n\nwhen flag clicked\nset [sliding?2 v] to [0]\n\nwhen flag clicked\nforever\n    if <(SLIDING?2) = [1]> then\n        switch costume to (idle4 v)\n    else\n        switch costume to (idle3 v)\n    end\nend\n\nwhen flag clicked\nset [sliding?2 v] to [0]\n\nwhen I receive [kill v]\nset [canmove? v] to [0]\n\nwhen I receive [slide v]\nif <(falling?) < [3]> then\n    reset timer\n    create clone of (hpbar v)\n    repeat until <<(timer) > [.5]> and <(STAY SLIDING) = [0]>>\n        if <(Megaman Costume) = [3]> then\n            set [slide time2 v] to [0]\n            set [sliding?2 v] to [1]\n            if <(direction) = [90]> then\n                if <(falling?) < [3]> then\n                    if <(CanMove?) = [1]> then\n                        change [speed x v] by (.5)\n                        Walk (direction) (speed x)\n                    end\n                end\n            else\n                if <(falling?) < [3]> then\n                    if <(CanMove?) = [1]> then\n                        change [speed x v] by (-.5)\n                        Walk (direction) (speed x)\n                    end\n                end\n            end\n        else\n            set [slide time2 v] to [0]\n            set [sliding?2 v] to [1]\n            if <(direction) = [90]> then\n                if <(falling?) < [3]> then\n                    Walk (direction) [5]\n                end\n            else\n                if <(falling?) < [3]> then\n                    Walk (direction) [-5]\n                end\n            end\n        end\n    end\nend\nset [sliding?2 v] to [0]\nwait (.25) seconds\nset [slide time2 v] to [1]\n\nwhen I receive [die v]\nset [canmove? v] to [0]\n\nwhen I receive [die v]\nrepeat (10)\n    set [canmove? v] to [0]\nend\n\nwhen I receive [bossdie v]\nset [canmove? v] to [0]\n\nwhen I receive [bossdie v]\nrepeat (50)\n    set [canmove? v] to [0]\nend\n\nwhen flag clicked\nset [slide time2 v] to [1]\n\nwhen I receive [stuncheck v]\nif <(falling?) < [2]> then\n    broadcast (STUNNED v)\nend\n\nwhen I receive [stunned v]\nset [canmove? v] to [0]\nwait (2) seconds\nset [canmove? v] to [1]\n\nwhen I receive [hitboxsnap v]\ngo to (mega man/protoman/bass v)\nchange y by (15)\n\ndefine Tick <<> <^> <>> <v>\nif <(CanMove?) = [1]> then\n    if <(Collide with ladder) = [1]> then\n        set x to (((LADDER_SNP) - (Scroll X)) + (12))\n        set [scroll x v] to (LADDER_SNP)\n        if <<not <mouse down?>> and <not <key (space v) pressed?>>> then\n            if <^> then\n                change y by (6)\n            end\n            if <v> then\n                if <mouse down?> then\n                    change y by (6)\n                else\n                    change y by (-6)\n                end\n            end\n        end\n    else\n        if <<not <<>> and <not <>>>> then\n            set [speed x v] to [0]\n        end\n        if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse y) > (y position)>>>> then\n            if <(TrebleBoostTimer) > [0]> then\n                change [speed y v] by (.5)\n                if <(speed y) > [5]> then\n                    set [speed y v] to [5]\n                end\n            end\n            if <not <(TrebleBoostTimer) > [0]>> then\n                if <(Antigravity?) = [1]> then\n                    change [speed y v] by (-.16)\n                    change y by (speed y)\n                else\n                    change [speed y v] by (-.5)\n                    change y by (speed y)\n                end\n            end\n        else\n            if <(Antigravity?) = [1]> then\n                change [speed y v] by (-.16)\n                change y by (speed y)\n            else\n                change [speed y v] by (-.5)\n                change y by (speed y)\n            end\n        end\n        Touch Ground <(speed y) > [0]>\n        if <<> then\n            if <(getting ouched ?) = [0]> then\n                if <(Megaman Costume) = [3]> then\n                    point in direction (-90)\n                    if <<<<not <key (space v) pressed?>> and <not <mouse down?>>> or <not <(falling?) < [3]>>> or <(TrebleBoostTimer) > [0]>> then\n                        change [speed x v] by (-6)\n                        if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n                            if <(slide time2) = [1]> then\n                                broadcast (slide v)\n                            end\n                        end\n                    end\n                else\n                    change [speed x v] by (-6)\n                    point in direction (-90)\n                    if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n                        if <(slide time2) = [1]> then\n                            broadcast (slide v)\n                        end\n                    end\n                end\n            end\n        end\n        if <>> then\n            if <(getting ouched ?) = [0]> then\n                if <(Megaman Costume) = [3]> then\n                    point in direction (90)\n                    if <<<<not <key (space v) pressed?>> and <not <mouse down?>>> or <not <(falling?) < [3]>>> or <(TrebleBoostTimer) > [0]>> then\n                        change [speed x v] by (6)\n                        if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n                            if <(slide time2) = [1]> then\n                                broadcast (slide v)\n                            end\n                        end\n                    end\n                else\n                    change [speed x v] by (6)\n                    point in direction (90)\n                    if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n                        if <(slide time2) = [1]> then\n                            broadcast (slide v)\n                        end\n                    end\n                end\n            end\n        end\n        if <<(Ice Physics?) = [1]> and <(falling?) < [3]>> then\n            set [speed x v] to ((speed x) * (.6))\n        else\n            set [speed x v] to ((speed x) * (.5))\n        end\n        change y by (speed y)\n        Walk (direction) (speed x)\n        Touch Ground <(speed y) > [0]>\n        if <<^> and <(falling?) < [3]>> then\n            if <(getting ouched ?) = [0]> then\n                if <(Megaman Costume) = [3]> then\n                    if <<<<not <key (space v) pressed?>> and <not <mouse down?>>> and <(Megaman Costume) = [3]>> or <(TrebleBoostTimer) > [0]>> then\n                        set [speed y v] to [6]\n                    end\n                else\n                    set [speed y v] to [6]\n                end\n            end\n        end\n        if <<<key (s v) pressed?> or <key (down arrow v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse y) < (y position)>>>> then\n            change [speed y v] by (-1)\n        end\n        if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse y) > (y position)>>>> then\n            if <(getting ouched ?) = [0]> then\n                if <(falling?) < [3]> then\n                    if <(JUMP KEY) = [1]> then\n                        if <(Megaman Costume) = [3]> then\n                            if <<<not <key (space v) pressed?>> and <not <mouse down?>>> and <(Megaman Costume) = [3]>> then\n                                set [speed y v] to [7]\n                            end\n                        else\n                            set [speed y v] to [7]\n                        end\n                    end\n                end\n            end\n        else\n            change [speed y v] by (-.7)\n        end\n    end\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 (ground v)?>> and <<not <touching (misc objects v)?>> and <(Collide with ladder) = [0]>>>>\n    change [slope v] by (1)\n    change y by (1)\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\nend\n\nwhen flag clicked\nswitch costume to (idle v)\nset size to (200) %\nset size to (100) %\nset [falling v] to [0]\nset [speed y v] to [0]\nset [canmove? v] to [0]\nset [dead: v] to [0]\nset [health v] to [1]\ngo to x: (0) y: (-120)\nhide\nforever\n    if <<(CanMove?) = [1]> and <(TRANSITION2) = [0]>> then\n        Tick <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>> <(JUMP KEY) = [1]> <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> <<<key (s v) pressed?> or <key (down arrow v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse y) < (y position)>>>>\n    end\nend\n\nwhen flag clicked\nset volume to (60) %\nset [canmove? v] to [0]\nset [frame v] to [0]\n\nwhen flag clicked\nset rotation style [left-right v]\nset [speed v] to [3]\n\nwhen flag clicked\nset size to (200) %\nset [speed v] to [1]\nforever\n    if <key (left arrow v) pressed?> then\n        set [speed v] to [-3]\n    end\n    if <key (right arrow v) pressed?> then\n        set [speed v] to [-3]\n    end\nend\n\nwhen I receive [die v]\nset [speed v] to [1]\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <<not <touching (ground v)?>> and <not <<touching (misc objects v)?> and <(Collide with ladder) = [0]>>>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\nwhen I receive [die v]\nset [canmove? v] to [0]\n\nwhen I receive [knockback v]\nset [knock v] to [15]\nif <(direction) = [90]> then\n    repeat (6)\n        change [knock v] by (-2.5)\n        Walk [90] ((knock) * (-1))\n    end\nelse\n    repeat (6)\n        change [knock v] by (-2.5)\n        Walk [-90] (knock)\n    end\nend\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\nwhen flag clicked\nforever\n    Scrolling Blocks\nend\n\nwhen I receive [teleportin v]\nset [a v] to [0]\nhide\nwait (.1) seconds\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [speed y v] to [1]\nset [canmove? v] to [0]\ngo to [front v] layer\ngo to x: (0) y: (150)\nchange y by (300)\nif <(Megaman Costume) = [2]> then\n    wait (2) seconds\nelse\n    wait (1) seconds\nend\nset [ghost v] effect to (100)\nshow\nif <(Section At) = ((LevelLength) + (-1))> then\n    repeat (14)\n        change y by (-20)\n    end\nelse\n    repeat (8)\n        change y by (-20)\n    end\nend\nrepeat until <touching (ground v)?>\n    change y by (-20)\nend\nset x to (0)\nchange y by (-15)\nfindground\nstart sound [Mega Man 5 SFX \(21\) v]\nset [a v] to [1]\nset [canmove? v] to [1]\n\nwhen flag clicked\nset [checkpoint # v] to [0]\nset [fightstart? v] to [0]\n\nwhen I receive [transition effect v]\nrepeat (15)\n    reset timer\nend\n\nwhen I receive [rush_jump v]\nset [speed y v] to [15]\n\nwhen I receive [battle begin v]\nset [canmove? v] to [0]\nwait (2) seconds\nset [canmove? v] to [1]\n\nwhen I receive [ready v]\nset [canmove? v] to [0]\nhide\n\nwhen I receive [fwd_10 v]\nWalk (direction) [10]\n\nwhen I receive [bck_10 v]\nWalk (direction) [-10]\n\nwhen I receive [teleportin v]\nset [jump key v] to [0]\nforever\n    set [jump key v] to [0]\n    wait until <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(y position) < (mouse y)>>>>\n    set [jump key v] to [1]\n    wait until <not <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(y position) < (mouse y)>>>>>\nend\n\nwait (.05) seconds\nset [jump key v] to [0]\n\nwhen I receive [teleportin v]\nforever\n    if <(CanMove?) = [1]> then\n        Walk (direction) ((TrackXspeed) * (.2))\n    end\nend\n\nwhen I receive [teleportin v]\nset [ladder climb alternate v] to [1]\nforever\n    if <<(JUMP KEY) = [1]> or <<<key (s v) pressed?> or <key (down arrow v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse y) < (y position)>>>>> then\n        if <(Ladder Climb Alternate) = [1]> then\n            set [ladder climb alternate v] to [2]\n        else\n            set [ladder climb alternate v] to [1]\n        end\n        wait (.2) seconds\n    end\nend\n\nwhen I receive [player_moveup v]\nchange y by (8)\n\nwhen I receive [player_movedown v]\nchange y by (-8)\n\nwhen I receive [disable movement v]\nset [canmove? v] to [0]\n\nwhen I receive [enable movement v]\nset [canmove? v] to [1]\n\nwhen I receive [teleportin v]\nforever\n    wait (1) seconds\n    wait until <<(y position) < [-155]> or <(y position) > [190]>>\n    if <(y position) > [190]> then\n        if <(CanMove?) = [1]> then\n            if <<(Collide with ladder) = [1]> and <(JUMP KEY) = [1]>> then\n                broadcast (Transition Up v)\n                wait (2) seconds\n            end\n        end\n    end\n    if <(y position) < [-155]> then\n        if <(CanMove?) = [1]> then\n            if <(Collide with ladder) = [1]> then\n                if <<<key (s v) pressed?> or <key (down arrow v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse y) < (y position)>>>> then\n                    broadcast (Transition Down v)\n                    wait (2) seconds\n                end\n            else\n                set [health v] to [15]\n                set [sliding?2 v] to [0]\n            end\n        end\n    end\nend\n\nwhen I receive [player_moveleft v]\nchange x by (-10)\n\nwhen I receive [teleportin v]\nforever\n    if <(Scroll X) = [2961]> then\n        if <(x position) < [-190]> then\n            set x to (-190)\n        end\n        if <<(item (1) of [activated bossgates v]) = [0]> and <(x position) > [185]>> then\n            set x to (185)\n        end\n    end\n    if <(Scroll X) = [3441]> then\n        if <(x position) < [-190]> then\n            set x to (-190)\n        end\n    end\n    if <(Scroll X) = [6050]> then\n        if <(x position) < [-197]> then\n            set x to (-197)\n        end\n    end\nend\n\ndefine findground\nrepeat until <not <touching (ground v)?>>\n    change y by (1)\nend\n\n@mega man/protoman/bass\n\nwhen I receive [you win v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\nset [health v] to [1]\nset [health v] to [1]\n\nwhen flag clicked\n\nwhen I receive [die v]\nset [speed v] to [1]\nset [canmove? v] to [0]\n\nwhen I start as a clone\nset rotation style [left-right v]\ngo to [front v] layer\nshow\nif <(HEALTH) > [14]> then\n    set size to (250) %\n    switch costume to (death v)\n    wait (.1) seconds\n    switch costume to (death2 v)\n    wait (.1) seconds\n    switch costume to (death3 v)\n    wait (.1) seconds\nelse\n    if <(Megaman Costume) = [3]> then\n        start sound [Mega Man 5 SFX \(4\) v]\n        switch costume to (bassshot v)\n    else\n        if  then\n            if <(hold) = [42]> then\n                turn left (10) degrees\n            else\n                if <(hold) = [41]> then\n                    turn right (10) degrees\n                end\n            end\n            if <(hold) = [60]> then\n                forever\n                    switch costume to (shot1 v)\n                    wait (.05) seconds\n                    next costume\n                    wait (.05) seconds\n                    next costume\n                    wait (.05) seconds\n                    next costume\n                    wait (.05) seconds\n                end\n            else\n                start sound [Mega Man 5 SFX \(4\) v]\n                switch costume to (laser v)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [sliding? v] to [0]\nforever\n    if <<(CanMove?) = [1]> and <<key (space v) pressed?> or <mouse down?>>> then\n        if <(SLIDING?) = [0]> then\n            if <(Megaman Costume) = [3]> then\n                if <(TrebleBoostTimer) > [0]> then\n                    if <([direction v] of [hitbox v]) = [90]> then\n                        point in direction (45)\n                        set [hold v] to [0]\n                        create clone of (_myself_ v)\n                        point in direction (135)\n                        set [hold v] to [0]\n                        create clone of (_myself_ v)\n                    else\n                        point in direction (-45)\n                        set [hold v] to [0]\n                        create clone of (_myself_ v)\n                        point in direction (-135)\n                        set [hold v] to [0]\n                        create clone of (_myself_ v)\n                    end\n                    point in direction ([direction v] of [hitbox v])\n                    set [hold v] to [0]\n                    create clone of (_myself_ v)\n                    wait (.2) seconds\n                    wait until <<not <key (space v) pressed?>> and <not <mouse down?>>>\n                else\n                    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n                            point in direction (45)\n                            change x by (10)\n                        else\n                            if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n                                point in direction (-45)\n                                change x by (-10)\n                            else\n                                point in direction (0)\n                            end\n                        end\n                    else\n                        change y by (3)\n                        if <(Collide with ladder) = [0]> then\n                            point in direction ([direction v] of [hitbox v])\n                        end\n                    end\n                    if <(direction) = [0]> then\n                        change x by (10)\n                    end\n                    set [hold v] to [0]\n                    create clone of (_myself_ v)\n                    wait (.05) seconds\n                end\n            else\n                if <(Megaman Costume) = [2]> then\n                    set [hold v] to [0]\n                    create clone of (_myself_ v)\n                    repeat until <<(hold) > [39]> or <<not <key (space v) pressed?>> and <not <mouse down?>>>>\n                        change [hold v] by (1)\n                    end\n                    if <(hold) > [39]> then\n                        repeat until <<not <key (space v) pressed?>> and <not <mouse down?>>>\n                            start sound [Mega Man 5 SFX \(12\) v]\n                            set [brightness v] effect to (80)\n                            wait (.1) seconds\n                            set [brightness v] effect to (0)\n                            wait (.1) seconds\n                        end\n                        set [hold v] to [60]\n                        if <(SLIDING?) = [0]> then\n                            if <not <(HEALTH) > [14]>> then\n                                create clone of (_myself_ v)\n                                start sound [Mega Man 5 SFX \(21\) v]\n                            end\n                        end\n                    else\n                        wait until <<not <key (space v) pressed?>> and <not <mouse down?>>>\n                    end\n                else\n                    set [hold v] to [0]\n                    change y by (5)\n                    create clone of (_myself_ v)\n                    wait until <<not <key (space v) pressed?>> and <not <mouse down?>>>\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nset [speed v] to [3]\n\nwhen flag clicked\nforever\n    if <<key (space v) pressed?> or <mouse down?>> then\n        set [animations: using gun?2 v] to [1]\n    else\n        set [animations: using gun?2 v] to [0]\n    end\nend\n\ndefine Do (what?)\nif <<(CanMove?) = [1]> and <(SLIDING?) = [0]>> then\n    if <(what?) = [Walk]> then\n        if <not <(dead:) = [1]>> then\n            if <(Megaman Costume) = [3]> then\n                if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                    if <(SLIDING?) = [0]> then\n                        switch costume to (bass3 v)\n                        wait (.1) seconds\n                    end\n                end\n                if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                    if <(SLIDING?) = [0]> then\n                        switch costume to (bass4 v)\n                        wait (.1) seconds\n                    end\n                end\n                if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                    if <(SLIDING?) = [0]> then\n                        switch costume to (bass5 v)\n                        wait (.1) seconds\n                    end\n                end\n                if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                    if <(SLIDING?) = [0]> then\n                        switch costume to (bass4 v)\n                        wait (.1) seconds\n                    end\n                end\n            else\n                if <(Megaman Costume) = [2]> then\n                    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                        if <(animations: using gun?2) = [1]> then\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (prorungun2 v)\n                            end\n                        else\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (prorun1 v)\n                            end\n                        end\n                        if <(SLIDING?) = [0]> then\n                            wait (.1) seconds\n                        end\n                    end\n                    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                        if <(animations: using gun?2) = [1]> then\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (prorungun1 v)\n                            end\n                        else\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (prorun2 v)\n                            end\n                        end\n                        if <(SLIDING?) = [0]> then\n                            wait (.1) seconds\n                        end\n                    end\n                    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                        if <(animations: using gun?2) = [1]> then\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (prorungun3 v)\n                            end\n                        else\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (prorun3 v)\n                            end\n                        end\n                        if <(SLIDING?) = [0]> then\n                            wait (.1) seconds\n                        end\n                    end\n                    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                        if <(animations: using gun?2) = [1]> then\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (prorungun1 v)\n                            end\n                        else\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (prorun2 v)\n                            end\n                        end\n                        if <(SLIDING?) = [0]> then\n                            wait (.1) seconds\n                        end\n                    end\n                else\n                    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                        if <(animations: using gun?2) = [1]> then\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (gunrun1 v)\n                            end\n                        else\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (run1 v)\n                            end\n                        end\n                        if <(SLIDING?) = [0]> then\n                            wait (.1) seconds\n                        end\n                    end\n                    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                        if <(animations: using gun?2) = [1]> then\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (gunrun2 v)\n                            end\n                        else\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (run2 v)\n                            end\n                        end\n                        if <(SLIDING?) = [0]> then\n                            wait (.1) seconds\n                        end\n                    end\n                    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                        if <(animations: using gun?2) = [1]> then\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (gunrun3 v)\n                            end\n                        else\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (run3 v)\n                            end\n                        end\n                        if <(SLIDING?) = [0]> then\n                            wait (.1) seconds\n                        end\n                    end\n                    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                        if <(animations: using gun?2) = [1]> then\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (gunrun4 v)\n                            end\n                        else\n                            if <(SLIDING?) = [0]> then\n                                switch costume to (run4 v)\n                            end\n                        end\n                        if <(SLIDING?) = [0]> then\n                            wait (.1) seconds\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\n    if <(Megaman Costume) = [3]> then\n        if <(getting ouched ?) = [1]> then\n            switch costume to (bassouch v)\n        else\n            if <(SLIDING?) = [1]> then\n                switch costume to (bassdash v)\n            else\n                if <(CanMove?) = [1]> then\n                    if <([falling? v] of [hitbox v]) > [3]> then\n                        if <(animations: using gun?2) = [1]> then\n                    else\n                        if <<<not <key (space v) pressed?>> and <not <mouse down?>>> and <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>>> then\n                            if <(SLIDING?) = [0]> then\n                                Do [Walk]\n                            end\n                        else\n                            if <(animations: using gun?2) = [1]> then\n                                if <(SLIDING?) = [0]> then\n                                    if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                                        if <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>> then\n                                            switch costume to (bassshootdiagonal v)\n                                        else\n                                            switch costume to (bassshootup v)\n                                        end\n                                    else\n                                        switch costume to (bassidlegun v)\n                                    end\n                                end\n                            else\n                                if <(SLIDING?) = [0]> then\n                                    switch costume to (bass2 v)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    else\n        if <(Megaman Costume) = [2]> then\n            if <(getting ouched ?) = [1]> then\n                switch costume to (proouch v)\n            else\n                if <(SLIDING?) = [1]> then\n                    switch costume to (proslide v)\n                else\n                    if <(CanMove?) = [1]> then\n                        if <([falling? v] of [hitbox v]) > [3]> then\n                            if <(animations: using gun?2) = [1]> then\n                                if <(SLIDING?) = [0]> then\n                                    switch costume to (projumpgun v)\n                                end\n                            else\n                                if <(SLIDING?) = [0]> then\n                                    switch costume to (projump v)\n                                end\n                            end\n                        else\n                            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                                if <(SLIDING?) = [0]> then\n                                    Do [Walk]\n                                end\n                            else\n                                if <<(JUMP KEY) = [0]> or <<not <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>> or <key (up arrow v) pressed?>>>> and <(Holding?) = [0]>>> then\n                                    if <(animations: using gun?2) = [1]> then\n                                        if <(SLIDING?) = [0]> then\n                                            switch costume to (proidlegun v)\n                                        end\n                                    else\n                                        if <(SLIDING?) = [0]> then\n                                            switch costume to (proidle v)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            if <(getting ouched ?) = [1]> then\n                switch costume to (takedmg v)\n            else\n                if <(SLIDING?) = [1]> then\n                    switch costume to (swipe v)\n                else\n                    if <(CanMove?) = [1]> then\n                        if <([falling? v] of [hitbox v]) > [3]> then\n                            if <(animations: using gun?2) = [1]> then\n                                if <(SLIDING?) = [0]> then\n                                    switch costume to (jumpgun v)\n                                end\n                            else\n                                if <(SLIDING?) = [0]> then\n                                    switch costume to (jump v)\n                                end\n                            end\n                        else\n                            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>>> then\n                                if <(SLIDING?) = [0]> then\n                                    Do [Walk]\n                                end\n                            else\n                                if <<(JUMP KEY) = [0]> or <<not <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> or <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>> or <key (up arrow v) pressed?>>>> and <(Holding?) = [0]>>> then\n                                    if <(animations: using gun?2) = [1]> then\n                                        if <(SLIDING?) = [0]> then\n                                            switch costume to (idlegun v)\n                                        end\n                                    else\n                                        if <(SLIDING?) = [0]> then\n                                            switch costume to (idle v)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <not <(HEALTH) > [14]>> then\n    move (15) steps\n    repeat until <<(x position) < [-230]> or <(x position) > [230]>>\n        move (20) steps\n    end\n    delete this clone\nend\nif <(HEALTH) > [14]> then\n    set size to (100) %\n    repeat until <touching (_edge_ v)?>\n        move (5) steps\n    end\n    delete this clone\nend\n\ndefine death\nif <(clone) = [0]> then\n    hide\n    start sound [Mega Man 5 SFX \(7\) v]\n    switch costume to (death v)\n    point in direction (0)\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    point in direction (90)\nend\n\nwhen I start as a clone\nforever\n    show\nend\n\nwhen flag clicked\nset volume to (100) %\nswitch costume to (idle v)\nset size to (200) %\nclear graphic effects\nset [falling v] to [0]\nset [speed y v] to [0]\nset [canmove? v] to [0]\nset [holding? v] to [0]\nset [dead: v] to [0]\nset [health v] to [1]\ngo to x: (0) y: (-120)\npoint in direction (90)\nset volume to (100) %\n\nwhen I receive [die v]\nset [canmove? v] to [0]\nhide\ndeath\nwait (1) seconds\nswitch costume to (idle v)\n\nwhen I receive [take dmg v]\nstart sound [Mega Man 5 SFX \(6\) v]\nset [takingdmg v] to [1]\nset [canmove? v] to [0]\nset [getting ouched ? v] to [1]\nrepeat (4)\n    set [ghost v] effect to (100)\n    wait (.05) seconds\n    set [ghost v] effect to (0)\n    wait (.05) seconds\nend\nset [getting ouched ? v] to [0]\nset [canmove? v] to [1]\nset [takingdmg v] to [0]\nrepeat (4)\n    set [ghost v] effect to (100)\n    wait (.05) seconds\n    set [ghost v] effect to (0)\n    wait (.05) seconds\nend\n\nwhen flag clicked\nset [getting ouched ? v] to [0]\nset [takingdmg v] to [0]\n\nwhen I receive [blink v]\nif <(clone?) = [0]> then\n    repeat (3)\n        set [ghost v] effect to (100)\n        wait (.05) seconds\n        set [ghost v] effect to (0)\n        wait (.05) seconds\n    end\nend\n\nwhen I receive [teleportin v]\nif <(clone?) = [0]> then\n    hide\n    set [canmove? v] to [0]\n    go to [front v] layer\n    if <(Megaman Costume) = [3]> then\n        switch costume to (basstele1 v)\n        wait (1) seconds\n    else\n        if <(Megaman Costume) = [2]> then\n            switch costume to (break2 v)\n            wait (2) seconds\n        else\n            switch costume to (break v)\n            wait (1) seconds\n        end\n    end\n    go to x: (0) y: (899)\n    show\n    if <(Section At) = ((LevelLength) + (-1))> then\n        repeat (20)\n            change y by (-20)\n        end\n    else\n        repeat (10)\n            change y by (-20)\n        end\n    end\n    repeat until <touching (ground v)?>\n        change y by (-20)\n    end\n    start sound [Mega Man 5 SFX \(2\)2 v]\n    if <(Megaman Costume) = [3]> then\n        switch costume to (basstele2 v)\n    else\n        if <(Megaman Costume) = [2]> then\n            switch costume to (protele v)\n        else\n            switch costume to (tele2 v)\n        end\n    end\n    wait (.1) seconds\n    change [scroll x v] by (0)\n    set [canmove? v] to [1]\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [teleportin v]\nclear graphic effects\n\nwhen I receive [bossdie v]\nif <(Checkpoint #) = [4]> then\n\nwhen I start as a clone\nclear graphic effects\n\nwhen I receive [teleportin v]\nrepeat (10)\n    clear graphic effects\nend\n\nwhen I receive [battle begin v]\nset [canmove? v] to [1]\nset rotation style [left-right v]\n\nwhen flag clicked\nforever\n    if <(Megaman Costume) = [3]> then\n        if <(Collide with ladder) = [1]> then\n            if <<mouse down?> or <key (space v) pressed?>> then\n                if <(direction) = [0]> then\n                    switch costume to (bassladderup1 v)\n                else\n                    if <<<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                        switch costume to (bassladderdiagonal1 v)\n                    else\n                        switch costume to (bassladderfire v)\n                    end\n                end\n            else\n                if <(Ladder Climb Alternate) = [1]> then\n                    switch costume to (bassclimb1 v)\n                else\n                    switch costume to (bassclimb2 v)\n                end\n            end\n        else\n            if <(TrebleBoostTimer) > [0]> then\n                if <(TrebleBoostTimer) = [5]> then\n                    switch costume to (basstreble1 v)\n                else\n                    if <(TrebleBoostTimer) = [4]> then\n                        switch costume to (basstreble2 v)\n                    else\n                        if <<mouse down?> or <key (space v) pressed?>> then\n                            if <((round ((timer) * (10))) mod (2)) = [1]> then\n                                switch costume to (basstreble5 v)\n                            else\n                                switch costume to (basstreble6 v)\n                            end\n                        else\n                            if <((round ((timer) * (10))) mod (2)) = [1]> then\n                                switch costume to (basstreble3 v)\n                            else\n                                switch costume to (basstreble4 v)\n                            end\n                        end\n                    end\n                end\n            else\n                if <<([falling? v] of [hitbox v]) > [3]> and <(CanMove?) = [1]>> then\n                    if <(animations: using gun?2) = [1]> then\n                        if <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>> then\n                            switch costume to (bassjumpright v)\n                        else\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                switch costume to (bassjumpup v)\n                            else\n                                switch costume to (bassjumpstraight v)\n                            end\n                        end\n                    else\n                        switch costume to (bassjump v)\n                    end\n                else\n                    if <(SLIDING?) = [1]> then\n                        switch costume to (bassdash v)\n                    end\n                end\n            end\n        end\n    else\n        if <(Megaman Costume) = [2]> then\n            if <(Collide with ladder) = [1]> then\n                if <<mouse down?> or <key (space v) pressed?>> then\n                    switch costume to (protoclimb2 v)\n                else\n                    if <(Ladder Climb Alternate) = [1]> then\n                        switch costume to (protoclimb1 v)\n                    else\n                        switch costume to (protoclimb3 v)\n                    end\n                end\n            else\n                if <<([falling? v] of [hitbox v]) > [3]> and <(CanMove?) = [1]>> then\n                    if <(animations: using gun?2) = [1]> then\n                        switch costume to (projumpgun v)\n                    else\n                        switch costume to (projump v)\n                    end\n                else\n                    if <(SLIDING?) = [1]> then\n                        switch costume to (proslide v)\n                    end\n                end\n            end\n        else\n            if <(Collide with ladder) = [1]> then\n                if <<mouse down?> or <key (space v) pressed?>> then\n                    switch costume to (ladderfire v)\n                else\n                    if <(Ladder Climb Alternate) = [1]> then\n                        switch costume to (climb1 v)\n                    else\n                        switch costume to (climb2 v)\n                    end\n                end\n            else\n                if <<([falling? v] of [hitbox v]) > [3]> and <(CanMove?) = [1]>> then\n                    if <(animations: using gun?2) = [1]> then\n                        switch costume to (jumpgun v)\n                    else\n                        switch costume to (jump v)\n                    end\n                else\n                    if <(SLIDING?) = [1]> then\n                        switch costume to (swipe v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\ngo to [front v] layer\n\nwhen I start as a clone\nif <(HEALTH) > [14]> then\n    forever\n        set size to (250) %\n        switch costume to (death v)\n        wait (.1) seconds\n        switch costume to (death2 v)\n        wait (.1) seconds\n        switch costume to (death3 v)\n        wait (.1) seconds\n    end\nend\n\nwhen I start as a clone\nset [clone? v] to [1]\n\nwhen I receive [die v]\nset [health v] to [15]\n\nwhen I start as a clone\nset [clone v] to [1]\n\nwhen I receive [die v]\nset [canmove? v] to [0]\n\nwhen I receive [die v]\nrepeat (50)\n    set [canmove? v] to [0]\nend\n\nwhen I receive [back to select v]\nrepeat (25)\n    set [canmove? v] to [0]\nend\n\nwhen I receive [bossdie v]\nset [canmove? v] to [0]\n\nwhen I receive [bossdie v]\nwait (1) seconds\nif <(Checkpoint #) = [4]> then\n    broadcast (Disable Movement v)\n    wait (.2) seconds\n    set [checkpoint # v] to [5]\nelse\n    if <(Megaman Costume) = [3]> then\n        set [canmove? v] to [-1]\n        start sound [Boss Defeated v]\n        wait (4) seconds\n        switch costume to (bassgrin v)\n        start sound [SE \[39\] v]\n        wait (1.2) seconds\n        set [canmove? v] to [0]\n        set [selected2 v] to [5]\n        switch costume to (basstele1 v)\n        start sound [Mega Man 5 SFX \(31\) v]\n        set [canmove? v] to [-1]\n        repeat until <(y position) > [180]>\n            change y by (25)\n        end\n        hide\n    else\n        if <(Megaman Costume) = [2]> then\n            set [canmove? v] to [-1]\n            start sound [Boss Defeated v]\n            wait (4) seconds\n            switch costume to (protowin1 v)\n            repeat (5)\n                wait (.02) seconds\n                next costume\n            end\n            start sound [SE \[39\] v]\n            wait (.4) seconds\n            set [canmove? v] to [0]\n            set [selected2 v] to [5]\n            switch costume to (break2 v)\n            start sound [Mega Man 5 SFX \(31\) v]\n            set [canmove? v] to [-1]\n            repeat until <(y position) > [180]>\n                change y by (25)\n            end\n            hide\n        else\n            set [canmove? v] to [-1]\n            start sound [Boss Defeated v]\n            wait (4) seconds\n            switch costume to (win1 v)\n            repeat (5)\n                wait (.1) seconds\n                next costume\n            end\n            start sound [SE \[39\] v]\n            wait (.4) seconds\n            set [canmove? v] to [0]\n            set [selected2 v] to [5]\n            switch costume to (break v)\n            start sound [Mega Man 5 SFX \(31\) v]\n            set [canmove? v] to [-1]\n            repeat until <(y position) > [180]>\n                change y by (25)\n            end\n            hide\n        end\n    end\n    broadcast (you win v)\nend\n\nwhen I receive [bossdie v]\ndelete this clone\n\nwhen I start as a clone\nif <<(Megaman Costume) = [3]> and <not <(HEALTH) > [14]>>> then\n    wait until <<touching (boss v)?> or <<<touching (ground v)?> or <<touching (misc objects v)?> and <(Collide with ladder) = [0]>>> or <touching (enemies v)?>>>\n    if <not <(HEALTH) > [14]>> then\n        wait (.05) seconds\n        delete this clone\n    end\nelse\n    wait until <<touching (boss v)?> or <touching (enemies v)?>>\n    if <not <(HEALTH) > [14]>> then\n        wait (.05) seconds\n        delete this clone\n    end\nend\n\nwhen I receive [teleportin v]\nset size to (200) %\nset [speed v] to [1]\nforever\n    if <(CanMove?) = [1]> then\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse x) < (x position)>>>> then\n            point in direction (-90)\n            set [speed v] to [-4]\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(x position) < (mouse x)>>>> then\n            point in direction (90)\n            set [speed v] to [-4]\n        end\n    end\nend\n\nwhen I receive [teleportin v]\nforever\n    if <<not <(HEALTH) > [14]>> and <not <(CanMove?) = [-1]>>> then\n        go to x: ([x position v] of [hitbox v]) y: (([y position v] of [hitbox v]) + (-12))\n    end\nend\n\nwhen I receive [stunned v]\nset [canmove? v] to [-1]\nrepeat (10)\n    change x by (5)\n    wait (0) seconds\n    repeat (2)\n        change x by (-5)\n        wait (0) seconds\n    end\n    change x by (5)\n    wait (0) seconds\nend\nset [canmove? v] to [1]\n\nwhen flag clicked\nforever\n    set [sliding? v] to ([sliding?2 v] of [hitbox v])\nend\n\nwhen I start as a clone\nwait until <<touching (enemies v)?> or <touching (boss v)?>>\nif <not <(HEALTH) > [14]>> then\n    wait (.05) seconds\n    delete this clone\nend\n\nwhen I receive [battle begin v]\nset [canmove? v] to [0]\nwait (2) seconds\nset [canmove? v] to [1]\n\nwhen I receive [ready v]\nset [canmove? v] to [0]\nhide\n\nwhen I receive [teleportin v]\ndelete this clone\n\nset [megaman costume v] to [2]\n\nwhen I receive [take dmg v]\nrepeat (45)\n    set [invincibility v] to [1]\nend\nset [invincibility v] to [0]\n\nwhen I receive [die v]\nwait (1) seconds\nrepeat (10)\n    hide\nend\n\nwhen I start as a clone\nwait until <touching (_edge_ v)?>\ndelete this clone\n\nwhen I receive [teleportin v]\nforever\n    if <(TrebleBoostTimer) = [1]> then\n        set [ghost v] effect to (100)\n        wait (.05) seconds\n        clear graphic effects\n        wait (.05) seconds\n    end\nend\n\nwhen I start as a clone\nwait until <touching (enemy projectiles v)?>\nif <(Section At) = (LevelLength)> then\n    if <not <(HEALTH) > [14]>> then\n        delete this clone\n    end\nend\n\nwhen I receive [ready v]\nset [hold v] to [0]\n\nwhen I receive [disable movement v]\nset [canmove? v] to [0]\n\nwhen I receive [enable movement v]\nset [canmove? v] to [1]\n\n@hpbar\n\nwhen flag clicked\nwait (1) seconds\nforever\n    wait until <(HEALTH) > [14]>\n    if <([costume # v] of [boss hp v]) > [28]> then\n        set [health v] to [13]\n    else\n        broadcast (die v)\n        wait (5) seconds\n        set [health v] to [1]\n    end\n    wait (.05) seconds\nend\n\nwhen I receive [take dmg v]\nif <(INVINCIBILITY) = [0]> then\n    set [brightness v] effect to (60)\n    wait (.2) seconds\nend\nclear graphic effects\nwait (.2) seconds\n\nwhen flag clicked\nhide\nrepeat (50)\n    go to [front v] layer\nend\n\nwhen I receive [teleportin v]\nset [health v] to [1]\npoint in direction (90)\ngo to x: (-205) y: (90)\nclear graphic effects\nset size to (250) %\nshow\nforever\n    switch costume to (HEALTH)\nend\n\nwhen I receive [bossdie v]\nhide\ndelete this clone\n\nwhen I receive [heal v]\nstart sound [Mega Man 5 SFX \(16\) v]\nrepeat (2)\n    set [brightness v] effect to (50)\n    wait (.1) seconds\n    clear graphic effects\n    wait (.1) seconds\nend\n\nwhen I receive [you win v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [die v]\nhide\nwait (6) seconds\nset [health v] to [1]\n\nwhen I start as a clone\nclear graphic effects\ngo to [front v] layer\nset size to (200) %\ngo to (mega man/protoman/bass v)\nif <([direction v] of [hitbox v]) = [90]> then\n    change x by (-35)\nelse\n    change x by (35)\nend\nchange y by (-15)\nshow\nswitch costume to (slide1 v)\nrepeat (2)\n    wait (.05) seconds\n    next costume\nend\nwait (.05) seconds\ndelete this clone\n\nwhen I receive [die v]\ndelete this clone\n\nwhen I receive [teleportin v]\nset [invincibility v] to [0]\n\nwhen I receive [take dmg v]\nset [invincibility v] to [1]\nwait (.8) seconds\nset [invincibility v] to [0]\n\nwhen I receive [battle begin v]\ngo to [front v] layer\n\nwhen I receive [set up stage v]\nrepeat (10)\n    set [health v] to [1]\nend\nshow\n\nwhen I receive [stage intro v]\nhide\n\nwhen I receive [teleportin v]\nrepeat (50)\n    go to [front v] layer\nend\n\nwhen I start as a clone\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change x by (-7)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change x by (7)\n    end\nend\n\nwhen I receive [enable movement v]\nshow\n\n@READY\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [ready v]\nswitch costume to (costume2 v)\ngo to x: (10) y: (15)\nif <(Megaman Costume) = [2]> then\n    broadcast (MuteMusic v)\n    start sound [whistle v]\nend\nrepeat (4)\n    go to [front v] layer\n    show\n    wait (.2) seconds\n    hide\n    wait (.2) seconds\nend\n\nwhen I start as a clone\nif <(Dmg thingy) = [1]> then\n    switch costume to (dmg v)\n    go to [front v] layer\n    repeat (3)\n        go to [front v] layer\n        show\n        wait (.05) seconds\n        hide\n        wait (.05) seconds\n    end\n    delete this clone\nelse\n    if <(Dmg thingy) = [2]> then\n        switch costume to (slide1 v)\n        go to (mega man/protoman/bass v)\n        change y by (40)\n        change x by (-35)\n        go to [front v] layer\n        go to [front v] layer\n        show\n        repeat (2)\n            wait (.05) seconds\n            next costume\n        end\n        wait (.05) seconds\n        delete this clone\n    else\n        if <(Dmg thingy) = [3]> then\n            switch costume to (slide1 v)\n            go to (mega man/protoman/bass v)\n            change y by (40)\n            change x by (0)\n            go to [front v] layer\n            go to [front v] layer\n            show\n            repeat (2)\n                wait (.05) seconds\n                next costume\n            end\n            wait (.05) seconds\n            delete this clone\n        else\n            if <(Dmg thingy) = [4]> then\n                switch costume to (slide1 v)\n                go to (mega man/protoman/bass v)\n                change y by (40)\n                change x by (35)\n                go to [front v] layer\n                go to [front v] layer\n                show\n                repeat (2)\n                    wait (.05) seconds\n                    next costume\n                end\n                wait (.05) seconds\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(Dmg thingy) = [1]> then\n    forever\n        go to (mega man/protoman/bass v)\n    end\nelse\nend\n\n@boss die\n\nwhen flag clicked\nhide\n\nwhen I receive [bossdie v]\ngo to (boss v)\ndeath\nwait (1) seconds\n\ndefine death\nif <(clone) = [0]> then\n    set size to (250) %\n    start sound [Mega Man 5 SFX \(7\)2 v]\n    switch costume to (death v)\n    point in direction (0)\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    create clone of (_myself_ v)\n    turn right (45) degrees\n    point in direction (90)\nend\n\nwhen I start as a clone\nset [clone v] to [1]\n\nwhen I start as a clone\nshow\nforever\n    wait (.05) seconds\n    go to [front v] layer\n    next costume\nend\n\nwhen I start as a clone\nrepeat until <touching (_edge_ v)?>\n    move (4) steps\nend\ndelete this clone\n\n@slide checker\n\nwhen flag clicked\nset [ghost v] effect to (99)\nshow\nforever\n    go to (hitbox v)\nend\n\nwhen flag clicked\nforever\n    if <touching (ground v)?> then\n        set [stay sliding v] to [1]\n    else\n        set [stay sliding v] to [0]\n    end\nend\n\n@Level_Art\n\nwhen I receive [setup v]\nhide\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nif <[1] = [1]> then\n    delete this clone\nend\nCreate\n\ndefine Create\nswitch costume to (wily_1 v)\nset size to (200) %\nset [level_y v] to [-30]\nset [level_x v] to [0]\nrepeat (6)\n    create clone of (_myself_ v)\n    change [level_x v] by (510)\nend\nchange [level_x v] by (-510)\nswitch costume to (wily_2 v)\nrepeat (1)\n    change [level_y v] by (440)\n    create clone of (_myself_ v)\n    change [level_x v] by (-510)\n    create clone of (_myself_ v)\n    change [level_x v] by (510)\nend\nrepeat (2)\n    next costume\n    repeat (1)\n        change [level_y v] by (440)\n        create clone of (_myself_ v)\n        change [level_x v] by (-510)\n        create clone of (_myself_ v)\n        change [level_x v] by (510)\n    end\nend\nrepeat (1)\n    change [level_y v] by (440)\n    create clone of (_myself_ v)\n    change [level_x v] by (-510)\n    create clone of (_myself_ v)\n    change [level_x v] by (510)\nend\nrepeat (3)\n    switch costume to (endless_142 v)\n    create clone of (_myself_ v)\n    change [level_x v] by (510)\nend\nrepeat (1)\n    switch costume to (endless_13 v)\n    create clone of (_myself_ v)\n    change [level_x v] by (510)\nend\nrepeat (3)\n    switch costume to (endless_142 v)\n    create clone of (_myself_ v)\n    change [level_x v] by (510)\nend\nset [level_y v] to [2120]\nset [level_x v] to [5570]\nrepeat (3)\n    switch costume to (endless_142 v)\n    create clone of (_myself_ v)\n    change [level_y v] by (440)\nend\nchange [level_y v] by (-440)\nswitch costume to (endless_142 v)\nchange [level_x v] by (510)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [brightness v] effect to (10)\nif <(costume [number v]) = [5]> then\n    forever\n        switch costume to (cossack_1_alt_22 v)\n        repeat (5)\n            wait (.02) seconds\n            next costume\n        end\n        wait (.02) seconds\n    end\nend\nif <(costume [number v]) = [11]> then\n    forever\n        switch costume to (endless_13 v)\n        wait (.02) seconds\n        next costume\n        wait (.02) seconds\n    end\nend\nif <(costume [number v]) = [13]> then\n    forever\n        switch costume to (endless_142 v)\n        wait (.02) seconds\n        next costume\n        wait (.02) seconds\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    go to [back v] layer\n    set x to ((Level_X) - (Scroll X))\n    set y to ((Level_Y) - (Scroll Y))\n    if <<([abs v] of ((Level_X) - (Scroll X)) ) > [500]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [400]>> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [setup v]\ndelete this clone\n\nwhen I receive [ready v]\nif <(Checkpoint #) = [1]> then\n    repeat (15)\n        set [scroll y min v] to [0]\n        set [scroll y max v] to [0]\n        set [scroll x min v] to [0]\n        set [scroll x max v] to [1550]\n    end\n    wait until <(Scroll X) > [1549]>\n    set [scroll x min v] to [1550]\n    broadcast (Oh no a tank squad v)\nend\nif <(Checkpoint #) = [2]> then\n    repeat (15)\n        set [scroll y min v] to [0]\n        set [scroll y max v] to [0]\n        set [scroll x min v] to [1550]\n        set [scroll x max v] to [2481]\n    end\nend\nif <(Checkpoint #) = [3]> then\n    repeat (15)\n        set [scroll y min v] to [400]\n        set [scroll y max v] to [400]\n        set [scroll x min v] to [2481]\n        set [scroll x max v] to [2481]\n    end\nend\nif <(Checkpoint #) = [4]> then\n    repeat (15)\n        set [scroll y min v] to [1690]\n        set [scroll y max v] to [1690]\n        set [scroll x min v] to [2481]\n        set [scroll x max v] to [2481]\n    end\nend\nif <(Checkpoint #) = [5]> then\n    repeat (15)\n        set [scroll y min v] to [1690]\n        set [scroll y max v] to [1690]\n        set [scroll x min v] to [3441]\n        set [scroll x max v] to [5570]\n    end\nend\nif <(Checkpoint #) = [6]> then\n    repeat (15)\n        set [scroll y min v] to [1690]\n        set [scroll y max v] to [1690]\n        set [scroll x min v] to [5570]\n        set [scroll x max v] to [5570]\n    end\nend\nif <(Checkpoint #) = [7]> then\n    repeat (15)\n        set [scroll y min v] to [2980]\n        set [scroll y max v] to [2980]\n        set [scroll x min v] to [5570]\n        set [scroll x max v] to [5570]\n    end\nend\n\nwhen flag clicked\nset [checkpoint # v] to [1]\n\nwhen I receive [oh no a tank squad v]\nwait (.1) seconds\nset [ghost v] effect to (100)\n\nwhen I receive [oh no a tank squad v]\nrepeat (10)\n    go to [back v] layer\nend\n\nwhen I receive [defeated tank sqaud v]\nwait (.05) seconds\nset [ghost v] effect to (0)\nset [brightness v] effect to (-100)\nwait (.3) seconds\nrepeat (11)\n    change [brightness v] effect by (10)\nend\n\nwhen I receive [blink v]\n\nbroadcast (blink v)\n\ndelete this clone\n\n@ground\n\nwhen I receive [setup v]\nhide\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nif <[1] = [1]> then\n    delete this clone\nend\nCreate\n\ndefine Create\nset [scroll x v] to [0]\nset [level_y v] to [15]\nset [level_x v] to [0]\nswitch costume to (costume2 v)\nset size to (200) %\nrepeat (6)\n    create clone of (_myself_ v)\n    next costume\n    change [level_x v] by (510)\nend\nchange [level_x v] by (-510)\nrepeat (5)\n    create clone of (_myself_ v)\n    next costume\n    change [level_y v] by (510)\nend\nchange [level_y v] by (-850)\nrepeat (6)\n    change [level_x v] by (510)\n    create clone of (_myself_ v)\n    next costume\nend\nset [level_y v] to [2120]\nset [level_x v] to [5570]\nswitch costume to (costume19 v)\nrepeat (3)\n    create clone of (_myself_ v)\n    next costume\n    change [level_y v] by (510)\nend\nchange [level_y v] by (-850)\nchange [level_x v] by (510)\ncreate clone of (_myself_ v)\n\nswitch costume to (costume20 v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set [brightness v] effect to (10)\n    set [ghost v] effect to (0)\n    set x to ((Level_X) - (Scroll X))\n    set y to ((Level_Y) - (Scroll Y))\n    if <(costume [number v]) = [12]> then\n        if <<([abs v] of ((Level_X) - (Scroll X)) ) > [550]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [600]>> then\n            hide\n        else\n            show\n        end\n    else\n        if <(costume [number v]) = [20]> then\n            if <<([abs v] of ((Level_X) - (Scroll X)) ) > [550]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [380]>> then\n                hide\n            else\n                show\n            end\n        else\n            if <<([abs v] of ((Level_X) - (Scroll X)) ) > [550]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [450]>> then\n                hide\n            else\n                show\n            end\n        end\n    end\nend\n\nwhen I receive [setup v]\ndelete this clone\n\nset [scroll x v] to [4000]\n\nwhen I receive [oh no a tank squad v]\nrepeat (10)\n    go to [back v] layer\nend\n\n@enemies\n\nwhen flag clicked\nhide\n\ndefine Create Enemy (what enemy ) (x) (y)\ngo to [front v] layer\nset size to (200) %\nset rotation style [left-right v]\nswitch costume to (what enemy )\nset [level_x v] to (x)\nset [level_y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nset rotation style [left-right v]\n\nwhen I receive [die v]\nwait (1) seconds\ndelete this clone\n\nwhen I start as a clone\nif <(costume [number v]) = [18]> then\n    set [hp v] to [3]\n    point in direction (90)\n    set [y v] to [15]\n    forever\n        wait until <(ENEMY ONSCREEN?) = [1]>\n        repeat until <<<touching (ground v)?> or <touching (misc objects v)?>> or <(ENEMY ONSCREEN?) = [0]>>\n            switch costume to (sas v)\n            set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n            wait (0) seconds\n            switch costume to (sas2 v)\n            set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n            wait (0) seconds\n        end\n        switch costume to (sas v)\n        repeat (5)\n            wait (0) seconds\n            next costume\n        end\n        wait (0) seconds\n        turn right (180) degrees\n        repeat (5)\n            switch costume to (sas v)\n            set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n            wait (0) seconds\n            switch costume to (sas2 v)\n            set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n            wait (0) seconds\n        end\n    end\nend\nif <(costume [number v]) = [15]> then\n    set [hp v] to [2]\n    point in direction (-90)\n    set [y v] to [15]\n    wait until <(ENEMY ONSCREEN?) = [1]>\n    switch costume to (msat v)\n    repeat (1)\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n        set [level_y v] to ((Level_Y) + ((([cos v] of (direction) ) * (10)) + (([sin v] of (y) ) * (5))))\n        change [y v] by (15)\n    end\n    repeat (2)\n        next costume\n        repeat (1)\n            set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n            set [level_y v] to ((Level_Y) + ((([cos v] of (direction) ) * (10)) + (([sin v] of (y) ) * (5))))\n            change [y v] by (15)\n        end\n    end\n    repeat until <(ENEMY ONSCREEN?) = [0]>\n        switch costume to (msat v)\n        repeat (1)\n            set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n            set [level_y v] to ((Level_Y) + ((([cos v] of (direction) ) * (10)) + (([sin v] of (y) ) * (5))))\n            change [y v] by (15)\n        end\n        repeat (2)\n            next costume\n            repeat (1)\n                set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n                set [level_y v] to ((Level_Y) + ((([cos v] of (direction) ) * (10)) + (([sin v] of (y) ) * (5))))\n                change [y v] by (15)\n            end\n        end\n    end\n    delete this clone\nend\nif <(costume [number v]) = [10]> then\n    set [hp v] to [2]\n    point in direction (-90)\n    set [y v] to [15]\n    repeat until <((Level_X) + (-150)) < ((Scroll X) + ([x position v] of [mega man v]))>\n        if <(ENEMY ONSCREEN?) = [1]> then\n            switch costume to (bird v)\n            repeat (2)\n                set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n                set [level_y v] to ((Level_Y) + ((([cos v] of (direction) ) * (10)) + (([sin v] of (y) ) * (5))))\n                change [y v] by (15)\n            end\n            next costume\n            repeat (2)\n                set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n                set [level_y v] to ((Level_Y) + ((([cos v] of (direction) ) * (10)) + (([sin v] of (y) ) * (5))))\n                change [y v] by (15)\n            end\n        end\n    end\n    set [proj direction v] to [90]\n    set [proj x v] to (Level_X)\n    set [proj y v] to (Level_Y)\n    set [projectile name v] to [rock]\n    broadcast (CREATE PROJECTILE v)\n    switch costume to (bird5 v)\n    repeat (5)\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n        set [level_y v] to ((Level_Y) + ((([cos v] of (direction) ) * (10)) + (([sin v] of (y) ) * (5))))\n        change [y v] by (15)\n    end\n    repeat until <(Level_X) < [-300]>\n        point in direction (-90)\n        switch costume to (bird3 v)\n        repeat (2)\n            set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n            set [level_y v] to ((Level_Y) + ((([cos v] of (direction) ) * (10)) + (([sin v] of (y) ) * (5))))\n            change [y v] by (15)\n        end\n        next costume\n        repeat (2)\n            set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n            set [level_y v] to ((Level_Y) + ((([cos v] of (direction) ) * (10)) + (([sin v] of (y) ) * (5))))\n            change [y v] by (15)\n        end\n    end\n    delete this clone\nend\nif <(costume [number v]) = [insert costume number here]> then\n\nwhen I start as a clone\nforever\n    wait until <touching (hitbox v)?>\n    broadcast (KNOCKBACK v)\n    wait (.1) seconds\n    change [health v] by (1)\n    broadcast (TAKE DMG v)\n    wait (1) seconds\nend\n\nwhen I receive [load enemies v]\nCreate Enemy [msat] [300] [75]\nCreate Enemy [msat] [400] [75]\nCreate Enemy [msat] [500] [75]\nCreate Enemy [sas] [650] [-90]\nCreate Enemy [msat] [1400] [75]\nCreate Enemy [msat] [1500] [75]\nCreate Enemy [msat] [2740] [900]\nCreate Enemy [sas] [2481] [-90]\nCreate Enemy [msat] [3800] [1790]\nCreate Enemy [sas] [5570] [2500]\n\nwhen I start as a clone\nset [clone v] to [1]\nforever\n    set x to ((Level_X) - (Scroll X))\n    set y to ((Level_Y) - (Scroll Y))\n    if <<([abs v] of ((Level_X) - (Scroll X)) ) > [260]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [200]>> then\n        set [enemy onscreen? v] to [0]\n        hide\n    else\n        set [enemy onscreen? v] to [1]\n        show\n    end\nend\n\nwhen I receive [teleportin v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    wait until <<<touching (mega man/protoman/bass v)?> and <touching color (#fae0c1)?>> and <not <touching (hitbox v)?>>>\n    if <<<(costume [number v]) > [17]> and <(costume [number v]) < [25]>> and <not <([direction v] of [hitbox v]) = (direction)>>> then\n        start sound [cling v]\n        set [ghost v] effect to (100)\n        wait (.1) seconds\n        clear graphic effects\n        wait (.05) seconds\n    else\n        if <(Megaman Costume) = [3]> then\n            change [hp v] by (-.5)\n        else\n            if <(Universal Hold) > [20]> then\n                change [hp v] by (-3)\n            else\n                change [hp v] by (-1)\n            end\n        end\n        if <(HP) < [1]> then\n            stop [other scripts in sprite v]\n            start sound [Mega Man 6 SRX \(19\) v]\n            switch costume to (edeath1 v)\n            repeat (3)\n                wait (0) seconds\n                set x to ((Level_X) - (Scroll X))\n                set y to ((Level_Y) - (Scroll Y))\n                next costume\n            end\n            wait (0) seconds\n            delete this clone\n        else\n            start sound [Mega Man 6 SRX \(19\) v]\n            set [brightness v] effect to (100)\n            wait (.1) seconds\n            clear graphic effects\n            wait (.05) seconds\n        end\n    end\nend\n\nwhen I receive [teleportin v]\nwait (.03) seconds\nbroadcast (load enemies v)\n\n@Projectiles\n\nwhen flag clicked\nset size to (200) %\nhide\n\nwhen I receive [create projectile v]\nif <(clone) = [0]> then\n    clear graphic effects\n    switch costume to (PROJECTILE NAME)\n    set [level_x v] to (PROJ X)\n    set [level_y v] to (PROJ Y)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset [clone v] to [1]\nshow\n\nwhen I start as a clone\nset [clone v] to [1]\npoint in direction (PROJ DIRECTION)\ngo to [front v] layer\nshow\nif <(costume [number v]) = [8]> then\n    set rotation style [left-right v]\n    set [y v] to [0]\n    repeat (10)\n        change [y v] by (-2)\n        change [level_y v] by (y)\n    end\n    repeat until <touching (ground v)?>\n        change [y v] by (-2)\n        change [level_y v] by (y)\n    end\n    set [ghost v] effect to (100)\n    set [proj x v] to (Level_X)\n    set [proj y v] to (Level_Y)\n    set [projectile name v] to [shrapnel]\n    repeat (3)\n        set [proj direction v] to (pick random (-90) to (90))\n        broadcast (CREATE PROJECTILE v)\n    end\n    start sound [SE \[83\]2 v]\n    delete this clone\nend\nif <(costume [number v]) = [19]> then\n    start sound [Mega Man 5 SFX \(11\) v]\n    set rotation style [left-right v]\n    if <([x position v] of [hitbox v]) > (x position)> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    repeat until <(y position) < ([y position v] of [hitbox v])>\n        change [level_y v] by (-10)\n    end\n    if <([x position v] of [hitbox v]) > (x position)> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    repeat until <touching (_edge_ v)?>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (10)))\n    end\n    delete this clone\nend\nif <(costume [number v]) = [9]> then\n    set rotation style [left-right v]\n    set [y v] to [15]\n    change [level_y v] by (8)\n    repeat (4)\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (8)))\n        change [y v] by (-2)\n        change [level_y v] by (y)\n    end\n    repeat until <touching (ground v)?>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (8)))\n        change [y v] by (-2)\n        change [level_y v] by (y)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [17]> then\n    start sound [SE \[92\] v]\n    set rotation style [left-right v]\n    set [y v] to [15]\n    repeat (10)\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (y)))\n        set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (y)))\n    end\n    repeat until <touching (_edge_ v)?>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (y)))\n        set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (y)))\n    end\n    delete this clone\nend\nif <(costume [number v]) = [15]> then\n    start sound [Mega Man 6 SRX \(6\) v]\n    set rotation style [left-right v]\n    set [y v] to ((distance to [hitbox v]) / (45))\n    repeat (10)\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (15)))\n        set [level_y v] to ((Level_Y) + (y))\n        change [y v] by (-1)\n    end\n    repeat until <(y position) < [-109]>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (15)))\n        set [level_y v] to ((Level_Y) + (y))\n        change [y v] by (-1)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [11]> then\n    start sound [SE \[83\] v]\n    set rotation style [left-right v]\n    set [y v] to [15]\n    repeat (10)\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (y)))\n        set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (y)))\n    end\n    repeat until <touching (_edge_ v)?>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (y)))\n        set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (y)))\n    end\n    delete this clone\nend\nif <(costume [number v]) = [1]> then\n    set rotation style [left-right v]\n    set [y v] to [15]\n    repeat until <touching (_edge_ v)?>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (y)))\n        set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (y)))\n    end\n    delete this clone\nend\nif <(costume [number v]) = [3]> then\n    set rotation style [left-right v]\n    start sound [SE \[83\] v]\n    switch costume to (explmk2 v)\n    wait (0) seconds\n    next costume\n    wait (0) seconds\n    switch costume to (explo v)\n    wait (0) seconds\n    repeat (4)\n        wait (0) seconds\n        next costume\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    set x to ((Level_X) - (Scroll X))\n    set y to ((Level_Y) - (Scroll Y))\n    if <<([abs v] of ((Level_X) - (Scroll X)) ) > [350]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [200]>> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I start as a clone\nset [internal timer v] to [0]\nrepeat until <(internal timer) > [1]>\n    wait (1) seconds\n    change [internal timer v] by (1)\nend\ndelete this clone\n\nwhen I receive [teleportin v]\ndelete this clone\n\nwhen I receive [bossdie v]\ndelete this clone\n\nwhen I receive [die v]\ndelete this clone\n\nwhen I receive [bossdie v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <touching (hitbox v)?> then\n        if <(INVINCIBILITY) = [0]> then\n            if <(Megaman Costume) = [2]> then\n                change [health v] by (2)\n            else\n                change [health v] by (1)\n            end\n            broadcast (TAKE DMG v)\n            broadcast (KNOCKBACK v)\n        end\n    end\nend\n\nwhen I start as a clone\nset size to (200) %\nif <(costume [number v]) = [11]> then\n    forever\n        switch costume to (tankjoeshot v)\n        wait (.02) seconds\n        next costume\n        wait (.02) seconds\n    end\nend\nif <(costume [number v]) = [15]> then\n    forever\n        switch costume to (airtk v)\n        wait (.02) seconds\n        next costume\n        wait (.02) seconds\n    end\nend\nif <(costume [number v]) = [17]> then\n    forever\n        switch costume to (megatk v)\n        wait (.02) seconds\n        next costume\n        wait (.02) seconds\n    end\nend\nif <(costume [number v]) = [19]> then\n    forever\n        set size to (400) %\n        switch costume to (yokushot v)\n        wait (.02) seconds\n        next costume\n        wait (.02) seconds\n    end\nend\n\n@Tanksquadillusion\n\nwhen I receive [oh no a tank squad v]\nclear graphic effects\nset size to (200) %\ngo to x: (0) y: (0)\ngo to [back v] layer\nset [brightness v] effect to (10)\nhide\nset [trackxspeed v] to [0]\ncreate clone of (_myself_ v)\nrepeat (5)\n    change [trackxspeed v] by (-1)\nend\ngo to x: (999) y: (0)\ncreate clone of (_myself_ v)\nrepeat (3)\n    change [trackxspeed v] by (-1)\nend\nrepeat (5)\n    change [trackxspeed v] by (-1)\nend\ngo to x: (999) y: (0)\ncreate clone of (_myself_ v)\nforever\n    wait (1.2) seconds\n    go to x: (999) y: (0)\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nset [trackxspeed v] to [0]\nhide\n\nwhen I start as a clone\nshow\nrepeat until <(x position) < [-490]>\n    change x by (TrackXspeed)\nend\ndelete this clone\n\nwhen I receive [teleportin v]\nset [trackxspeed v] to [0]\n\nwhen I receive [die v]\n\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [setup v]\nstop [other scripts in sprite v]\nset [trackxspeed v] to [0]\nhide\ndelete this clone\n\nwhen I receive [defeated tank sqaud v]\nstop [other scripts in sprite v]\nset [trackxspeed v] to [0]\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\ndelete this clone\n\n@Boss\n\nwhen flag clicked\nhide\n\nwhen I receive [bossdie v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [battle begin v]\nwait (1) seconds\nclear graphic effects\nforever\n    if <<touching (mega man/protoman/bass v)?> and <<touching color (#fae0c1)?> and <not <touching (hitbox v)?>>>> then\n        broadcast (BossDMG v)\n        create clone of (boss hp v)\n        if <(Checkpoint #) > [2]> then\n            repeat (2)\n                set [ghost v] effect to (90)\n                wait (.05) seconds\n                set [ghost v] effect to (0)\n                wait (.1) seconds\n            end\n        else\n            repeat (1)\n                set [ghost v] effect to (90)\n                wait (.05) seconds\n                set [ghost v] effect to (0)\n                wait (.1) seconds\n            end\n        end\n    end\nend\n\nwhen I receive [battle begin v]\nwait (1) seconds\nclear graphic effects\nforever\n    if <touching (hitbox v)?> then\n        if <(Megaman Costume) = [2]> then\n            change [health v] by (3)\n        else\n            change [health v] by (2)\n        end\n        broadcast (KNOCKBACK v)\n        broadcast (TAKE DMG v)\n        wait (1) seconds\n        if <(Checkpoint #) < [2]> then\n            wait (3) seconds\n        end\n    end\nend\n\nwhen I receive [trinitro man fight v]\nwait (.2) seconds\nbroadcast (Disable Movement v)\nswitch costume to (trin5 v)\nset size to (200) %\nclear graphic effects\ngo to [front v] layer\ngo to x: (173) y: (999)\npoint in direction (-90)\nset [y v] to [0]\nshow\nrepeat (4)\n    switch costume to (trin5 v)\n    repeat (2)\n        change [y v] by (-1)\n        change y by (y)\n    end\n    next costume\n    repeat (2)\n        change [y v] by (-1)\n        change y by (y)\n    end\nend\nrepeat (5)\n    switch costume to (trin5 v)\n    repeat (2)\n        change [y v] by (1)\n        change y by (y)\n    end\n    next costume\n    repeat (2)\n        change [y v] by (1)\n        change y by (y)\n    end\nend\nswitch costume to (trin7 v)\nset [y v] to [7]\nrepeat (15)\n    change [y v] by (-1)\n    change y by (y)\nend\nswitch costume to (trin1 v)\nset y to (-57)\nwait (.3) seconds\nrepeat (3)\n    wait (.05) seconds\n    next costume\nend\nwait (.1) seconds\nswitch costume to (trin10 v)\nbroadcast (bATTLE begin v)\n\nwhen I receive [ready v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [tank_explosion_effect v]\nif <(costume [number v]) < [5]> then\n    stop [other scripts in sprite v]\n    repeat (3)\n        clear graphic effects\n        set [projectile name v] to [explo]\n        set [proj direction v] to [90]\n        set [proj x v] to (((Scroll X) + (x position)) + (pick random (-25) to (25)))\n        set [proj y v] to ((y position) + (pick random (-25) to (25)))\n        broadcast (CREATE PROJECTILE v)\n        wait (.1) seconds\n    end\n    set [y v] to [0]\n    repeat (5)\n        switch costume to (tankjoe1 v)\n        repeat (2)\n            change [y v] by (-1)\n            change x by (y)\n        end\n        next costume\n        repeat (2)\n            change [y v] by (-1)\n            change x by (y)\n        end\n    end\n    hide\n    wait (1) seconds\n    switch costume to (megatank1 v)\n    go to x: (-999) y: (-28)\n    go to [front v] layer\n    clear graphic effects\n    show\n    set [y v] to [0]\n    repeat (4)\n        switch costume to (megatank1 v)\n        repeat (2)\n            change [y v] by (1)\n            change x by (y)\n        end\n        next costume\n        repeat (2)\n            change [y v] by (1)\n            change x by (y)\n        end\n    end\n    repeat (6)\n        switch costume to (megatank1 v)\n        repeat (2)\n            change [y v] by (-1)\n            change x by (y)\n        end\n        next costume\n        repeat (2)\n            change [y v] by (-1)\n            change x by (y)\n        end\n    end\n    repeat (10)\n        switch costume to (megatank1 v)\n        wait (0) seconds\n        next costume\n        wait (0) seconds\n    end\n    broadcast (bATTLE begin v)\n    repeat (10)\n        switch costume to (megatank1 v)\n        wait (0) seconds\n        next costume\n        wait (0) seconds\n    end\n    forever\n        repeat (15)\n            switch costume to (megatank1 v)\n            wait (0) seconds\n            next costume\n            wait (0) seconds\n        end\n        set [projectile name v] to [airtk]\n        set [proj direction v] to [90]\n        set [proj x v] to (((Scroll X) + (x position)) + (-45))\n        set [proj y v] to ((y position) + (25))\n        broadcast (CREATE PROJECTILE v)\n        repeat (5)\n            switch costume to (megatank1 v)\n            wait (0) seconds\n            next costume\n            wait (0) seconds\n        end\n        set [projectile name v] to [airtk]\n        set [proj direction v] to [90]\n        set [proj x v] to (((Scroll X) + (x position)) + (25))\n        set [proj y v] to ((y position) + (35))\n        broadcast (CREATE PROJECTILE v)\n        repeat (15)\n            switch costume to (megatank1 v)\n            wait (0) seconds\n            next costume\n            wait (0) seconds\n        end\n        start sound [SE \[2\] v]\n        repeat (2)\n            set [brightness v] effect to (25)\n            repeat (2)\n                switch costume to (megatank1 v)\n                wait (0) seconds\n                next costume\n                wait (0) seconds\n            end\n            set [brightness v] effect to (0)\n            repeat (2)\n                switch costume to (megatank1 v)\n                wait (0) seconds\n                next costume\n                wait (0) seconds\n            end\n        end\n        repeat (2)\n            set [brightness v] effect to (50)\n            repeat (2)\n                switch costume to (megatank1 v)\n                wait (0) seconds\n                next costume\n                wait (0) seconds\n            end\n            set [brightness v] effect to (0)\n            repeat (2)\n                switch costume to (megatank1 v)\n                wait (0) seconds\n                next costume\n                wait (0) seconds\n            end\n        end\n        repeat (1)\n            set [brightness v] effect to (75)\n            repeat (2)\n                switch costume to (megatank1 v)\n                wait (0) seconds\n                next costume\n                wait (0) seconds\n            end\n            set [brightness v] effect to (0)\n            repeat (2)\n                switch costume to (megatank1 v)\n                wait (0) seconds\n                next costume\n                wait (0) seconds\n            end\n        end\n        set [projectile name v] to [megatk]\n        set [proj direction v] to [90]\n        set [proj x v] to (((Scroll X) + (x position)) + (35))\n        set [proj y v] to ((y position) + (-25))\n        broadcast (CREATE PROJECTILE v)\n    end\nelse\n    stop [other scripts in sprite v]\n    repeat (3)\n        clear graphic effects\n        set [projectile name v] to [explo]\n        set [proj direction v] to [90]\n        set [proj x v] to (((Scroll X) + (x position)) + (pick random (-75) to (75)))\n        set [proj y v] to ((y position) + (pick random (-75) to (75)))\n        broadcast (CREATE PROJECTILE v)\n        wait (.1) seconds\n    end\n    set [y v] to [0]\n    repeat (5)\n        switch costume to (megatank1 v)\n        repeat (2)\n            change [y v] by (-1)\n            change x by (y)\n        end\n        next costume\n        repeat (2)\n            change [y v] by (-1)\n            change x by (y)\n        end\n    end\n    hide\n    broadcast (Defeated Tank Sqaud v)\nend\n\nwhen I receive [oh no a tank squad v]\nswitch costume to (tankjoe1 v)\nset size to (200) %\ngo to x: (-999) y: (-79)\npoint in direction (90)\ngo to [front v] layer\nclear graphic effects\nshow\nset [y v] to [0]\nrepeat (3)\n    switch costume to (tankjoe1 v)\n    repeat (2)\n        change [y v] by (1)\n        change x by (y)\n    end\n    next costume\n    repeat (2)\n        change [y v] by (1)\n        change x by (y)\n    end\nend\nrepeat (4)\n    switch costume to (tankjoe1 v)\n    repeat (2)\n        change [y v] by (-1)\n        change x by (y)\n    end\n    next costume\n    repeat (2)\n        change [y v] by (-1)\n        change x by (y)\n    end\nend\nrepeat (10)\n    switch costume to (tankjoe1 v)\n    wait (0) seconds\n    next costume\n    wait (0) seconds\nend\nbroadcast (bATTLE begin v)\nrepeat (10)\n    switch costume to (tankjoe1 v)\n    wait (0) seconds\n    next costume\n    wait (0) seconds\nend\nforever\n    repeat (15)\n        switch costume to (tankjoe1 v)\n        wait (0) seconds\n        next costume\n        wait (0) seconds\n    end\n    switch costume to (tankjoe3 v)\n    set [projectile name v] to [tankjoeshot]\n    set [proj direction v] to [90]\n    set [proj x v] to (((Scroll X) + (x position)) + (15))\n    set [proj y v] to ((y position) + (0))\n    broadcast (CREATE PROJECTILE v)\n    wait (.2) seconds\n    next costume\n    wait (.05) seconds\nend\n\nwhen I receive [battle begin v]\nif <(Checkpoint #) = [7]> then\n    wait (2) seconds\n    forever\n        show\n        start sound [SE \[90\] v]\n        switch costume to (costume13 v)\n        repeat (15)\n            wait (.02) seconds\n            next costume\n        end\n        hide\n        repeat (3)\n            set [proj x v] to ((Scroll X) + ((pick random (-5) to (5)) * (32)))\n            set [proj y v] to ((Scroll Y) + ((pick random (-2) to (2)) * (32)))\n            broadcast (Create Yoku Block v)\n            wait (.02) seconds\n        end\n        glide (1) secs to x: ((PROJ X) - (Scroll X)) y: (((PROJ Y) - (Scroll Y)) + (48))\n        switch costume to (costume28 v)\n        set size to (400) %\n        go to [front v] layer\n        show\n        start sound [SE \[43\] v]\n        if <([x position v] of [hitbox v]) < (x position)> then\n            point in direction (-90)\n        else\n            point in direction (90)\n        end\n        repeat (7)\n            wait (.02) seconds\n            switch costume to ((costume [number v]) + (-1))\n        end\n        switch costume to (costume1 v)\n        wait (.3) seconds\n        repeat (7)\n            wait (.02) seconds\n            next costume\n        end\n        set [projectile name v] to [yokushot]\n        set [proj direction v] to (direction)\n        set [proj x v] to ((Scroll X) + (x position))\n        set [proj y v] to (((Scroll Y) + (y position)) + (-10))\n        broadcast (CREATE PROJECTILE v)\n        change [y v] by (70)\n        wait (1) seconds\n    end\nend\nif <(Checkpoint #) = [4]> then\n    wait (2) seconds\n    forever\n        point towards (hitbox v)\n        set [y v] to [0]\n        repeat (4)\n            switch costume to (trin5 v)\n            repeat (2)\n                change [y v] by (1)\n                change y by (y)\n                change x by (([sin v] of (direction) ) * (4))\n            end\n            next costume\n            repeat (2)\n                change [y v] by (1)\n                change y by (y)\n                change x by (([sin v] of (direction) ) * (4))\n            end\n        end\n        repeat (8)\n            switch costume to (trin5 v)\n            repeat (2)\n                change x by (([sin v] of (direction) ) * (6))\n                point towards (hitbox v)\n                if <(x position) > [164]> then\n                    set x to (164)\n                end\n                if <(x position) < [-164]> then\n                    set x to (-164)\n                end\n            end\n            next costume\n            repeat (2)\n                change x by (([sin v] of (direction) ) * (6))\n                if <(x position) > [164]> then\n                    set x to (164)\n                end\n                if <(x position) < [-164]> then\n                    set x to (-164)\n                end\n            end\n        end\n        repeat until <touching (ground v)?>\n            switch costume to (trin7 v)\n            repeat (2)\n                change y by (-6)\n            end\n            next costume\n            repeat (2)\n                change y by (-6)\n            end\n        end\n        switch costume to (trin1 v)\n        touchground\n        switch costume to (trin1 v)\n        start sound [SE \[2\] v]\n        repeat (2)\n            set [brightness v] effect to (50)\n            wait (.1) seconds\n            set [brightness v] effect to (0)\n            wait (.1) seconds\n        end\n        repeat (2)\n            set [brightness v] effect to (80)\n            wait (.1) seconds\n            set [brightness v] effect to (0)\n            wait (.1) seconds\n        end\n        repeat (3)\n            wait (.02) seconds\n            next costume\n        end\n        wait (.02) seconds\n        switch costume to (trin10 v)\n        if <([x position v] of [hitbox v]) < (x position)> then\n            point in direction (-90)\n        else\n            point in direction (90)\n        end\n        set [y v] to [60]\n        set [projectile name v] to [explo]\n        set [proj direction v] to [90]\n        repeat (5)\n            set [proj x v] to (((Scroll X) + (x position)) + (([sin v] of (direction) ) * (y)))\n            set [proj y v] to (((Scroll Y) + (y position)) + (-10))\n            broadcast (CREATE PROJECTILE v)\n            change [y v] by (70)\n            wait (.1) seconds\n        end\n        wait (.2) seconds\n    end\nend\n\ndefine touchground\nrepeat until <touching (ground v)?>\n    change y by (-1)\nend\nrepeat until <not <touching (ground v)?>>\n    change y by (1)\nend\n\nwhen I receive [last boss fight v]\nwait (.2) seconds\nclear graphic effects\nbroadcast (Disable Movement v)\nswitch costume to (costume28 v)\npoint in direction (-90)\nset size to (400) %\ngo to x: (148) y: (-65)\ngo to [front v] layer\nshow\nstart sound [SE \[43\] v]\nrepeat (10)\n    wait (.02) seconds\n    switch costume to ((costume [number v]) + (-1))\nend\nstart sound [SE \[90\] v]\nrepeat (5)\n    wait (.02) seconds\n    switch costume to ((costume [number v]) + (-1))\nend\nbroadcast (bATTLE begin v)\n\n@boss hp\n\nwhen flag clicked\nset [clone v] to [0]\nclear graphic effects\nhide\n\nwhen I receive [battle begin v]\npoint in direction (90)\nset [fightstart? v] to [1]\ngo to x: (-180) y: (90)\nset size to (250) %\ngo to [front v] layer\nshow\nset [brightness v] effect to (0)\nswitch costume to (hpbar29 v)\nrepeat (28)\n    start sound [Mega Man 5 SFX \(16\) v]\n    switch costume to ((costume [number v]) + (-1))\n    wait (0) seconds\nend\n\nwhen I receive [bossdmg v]\nif <(clone) = [0]> then\n    repeat (3)\n        set [brightness v] effect to (60)\n        wait (.1) seconds\n        set [brightness v] effect to (0)\n        wait (.1) seconds\n    end\nend\n\nwhen I receive [bossdmg v]\nif <(clone) = [0]> then\n    next costume\n    if <(Universal Hold) > [40]> then\n        next costume\n        next costume\n        next costume\n    end\n    if <(costume [number v]) > [27]> then\n        if <(Checkpoint #) = [1]> then\n            broadcast (Tank_Explosion_Effect v)\n            wait (5) seconds\n        else\n            broadcast (BOSSDIE v)\n            wait (5) seconds\n        end\n    end\nend\n\nwhen I receive [bossdie v]\nhide\nswitch costume to (hpbar v)\n\nwhen I receive [die v]\nhide\n\nwhen I start as a clone\nset [clone v] to [1]\nset [ghost v] effect to (5)\nswitch costume to (dmg v)\ngo to [front v] layer\nshow\nstart sound [Mega Man 5 SFX \(20\) v]\nrepeat (6)\n    go to (boss v)\n    if <(Stage Boss) = [pharaoh]> then\n        change y by (30)\n    end\nend\ndelete this clone\n\nwhen I receive [back to select v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen I receive [defeated tank sqaud v]\nhide\n\nwhen flag clicked\nforever\n    set [universal hold v] to ([hold v] of [mega man/protoman/bass v])\nend\n\n@Transition Effect\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nwait (0) seconds\nswitch costume to (costume1 v)\nset [brightness v] effect to (100)\nset [ghost v] effect to (25)\nstart sound [SE \[18\] v]\nrepeat (3)\n    go to [front v] layer\n    show\n    wait (.2) seconds\n    hide\n    wait (.2) seconds\nend\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\n    change [brightness v] effect by (-10)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nset [music v] to [2]\nstop all sounds\nbroadcast (READY v)\nif <(Megaman Costume) = [2]> then\n    set volume to (0) %\n    wait (4) seconds\n    set volume to (100) %\nelse\n    wait (1) seconds\nend\nbroadcast (Teleportin v)\n\nwhen flag clicked\nhide\n\nwhen I receive [you win v]\nwait (2) seconds\nclear graphic effects\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nstop [all v]\n\n@ladder collision checker\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\nforever\n    go to (hitbox v)\nend\n\nwhen flag clicked\n\nforever\n    if <touching (misc objects v)?> then\n        set [collide with ladder v] to [1]\n    else\n        set [collide with ladder v] to [0]\n    end\nend\n\n@misc objects\n\nwhen I receive [setup v]\ndelete this clone\n\nwhen I start as a clone\nset [active v] to [1]\nset [clone v] to [1]\ngo to [front v] layer\ngo to [front v] layer\nforever\n    if <<(costume [number v]) < [6]> or <(costume [number v]) > [8]>> then\n        go [backward v] (5) layers\n        set x to ((Level_X) - (Scroll X))\n        set y to ((Level_Y) - (Scroll Y))\n        if <<(active) = [1]> and <<([abs v] of ((Level_X) - (Scroll X)) ) > [250]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [250]>>> then\n            hide\n        else\n            show\n        end\n    else\n        go [backward v] (5) layers\n        set x to ((Level_X) - (Scroll X))\n        set y to ((Level_Y) - (Scroll Y))\n        if <<([abs v] of ((Level_X) - (Scroll X)) ) > [250]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [500]>> then\n            hide\n        else\n            show\n        end\n    end\nend\n\nwhen I receive [setup v]\nhide\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nswitch costume to (ld1 v)\nif <[1] = [1]> then\n    delete this clone\nend\nCreate\n\ndefine Create\nclear graphic effects\nset size to (200) %\nset [level_y v] to [25]\nset [level_x v] to [2604]\nswitch costume to (ld1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [350]\nset [level_x v] to [2300]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [400]\nset [level_x v] to [2450]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [580]\nset [level_x v] to [2636]\nswitch costume to (ld2 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [790]\nset [level_x v] to [2420]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [815]\nset [level_x v] to [2300]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [900]\nset [level_x v] to [2420]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [880]\nset [level_x v] to [2600]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1000]\nset [level_x v] to [2636]\nswitch costume to (ld2 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1260]\nset [level_x v] to [2500]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1440]\nset [level_x v] to [2300]\nswitch costume to (ld2 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1620]\nset [level_x v] to [3830]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1640]\nset [level_x v] to [3950]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1600]\nset [level_x v] to [4100]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1670]\nset [level_x v] to [4200]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1680]\nset [level_x v] to [4300]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1550]\nset [level_x v] to [4550]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1550]\nset [level_x v] to [4670]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1620]\nset [level_x v] to [4800]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1660]\nset [level_x v] to [4900]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1700]\nset [level_x v] to [5000]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1725]\nset [level_x v] to [5100]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [1725]\nset [level_x v] to [5750]\nswitch costume to (ld1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [2300]\nset [level_x v] to [5750]\nswitch costume to (ld1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [2100]\nset [level_x v] to [5500]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [2190]\nset [level_x v] to [5500]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [2150]\nset [level_x v] to [5700]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [2700]\nset [level_x v] to [5400]\nswitch costume to (ld2 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [2500]\nset [level_x v] to [5395]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\nset [level_y v] to [2595]\nset [level_x v] to [5395]\nswitch costume to (tripl1 v)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <<(costume [number v]) > [5]> and <(costume [number v]) < [9]>> then\n        wait until <<(Collide with ladder) = [0]> and <<<touching (ladder downward collision v)?> and <<key (s v) pressed?> or <<key (down arrow v) pressed?> or <<mouse down?> and <([y position v] of [mega man/protoman/bass v]) > (mouse y)>>>>> or <<touching (ladder collision checker v)?> and <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ([y position v] of [mega man/protoman/bass v])>>>>>>>\n        set [ladder_snp v] to ((Level_X) + (-12))\n        set [collide with ladder v] to [1]\n        wait until <<not <touching (ladder collision checker v)?>> and <not <touching (ladder downward collision v)?>>>\n        set [collide with ladder v] to [0]\n    end\n    if <(costume [number v]) < [6]> then\n        wait until <touching (ladder downward collision v)?>\n        switch costume to (tripl1 v)\n        start sound [SE \[136\] v]\n        change y by (-5)\n        repeat (3)\n            wait (.1) seconds\n            next costume\n        end\n        wait (.1) seconds\n        next costume\n        set [projectile name v] to [explo]\n        set [proj direction v] to [90]\n        set [proj x v] to (Level_X)\n        set [proj y v] to (Level_Y)\n        broadcast (CREATE PROJECTILE v)\n        repeat (4)\n            change [ghost v] effect by (25)\n        end\n        set [active v] to [0]\n        wait (1) seconds\n        switch costume to (tripl1 v)\n        set [active v] to [1]\n        repeat (5)\n            change [ghost v] effect by (-20)\n        end\n    end\n    if <(costume [number v]) > [8]> then\n        switch costume to (costume1 v)\n        clear graphic effects\n        go to [front v] layer\n        show\n        repeat (5)\n            wait (.02) seconds\n            next costume\n        end\n        wait (4) seconds\n        delete this clone\n    end\nend\n\nwhen I receive [blink v]\nif <(username) = [legobuzz12]> then\n    delete this clone\nend\n\nbroadcast (blink v)\n\nwhen I receive [teleportin v]\nset [collide with ladder v] to [0]\n\nwhen flag clicked\nset [clone v] to [0]\n\nwhen I receive [create yoku block v]\nif <(clone) = [0]> then\n    start sound [SE \[8\] v]\n    set size to (200) %\n    set [level_y v] to (PROJ Y)\n    set [level_x v] to (PROJ X)\n    point in direction (90)\n    switch costume to (costume1 v)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [ready v]\nset [collide with ladder v] to [0]\n\n@ladder downward collision\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\nforever\n    go to (hitbox v)\nend\n\n@Border\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nforever\n    go to [front v] layer\n    clear graphic effects\nend\n\nif <touching (hitbox v)?> then\n    set [ghost v] effect to (50)\nend\n\nwhen I receive [ready v]\nshow\n\nwhen I receive [you win v]\nstop [other scripts in sprite v]\n\n@boss door\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set [ghost v] effect to (0)\n    set x to ((Level_X) - (Scroll X))\n    set y to ((Level_Y) - (Scroll Y))\n    if <<([abs v] of ((Level_X) - (Scroll X)) ) > [300]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [300]>> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [teleportin v]\nhide\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nswitch costume to (bossdoor1 v)\nif <[1] = [1]> then\n    delete this clone\nend\nCreate\n\ndefine Create\nswitch costume to (bossdoor1 v)\nset size to (200) %\nset [level_y v] to [1637]\nset [level_x v] to [2705]\ncreate clone of (_myself_ v)\nswitch costume to (bossdoor1 v)\nset size to (200) %\nset [level_y v] to [1637]\nset [level_x v] to [3188]\ncreate clone of (_myself_ v)\nswitch costume to (bossdoor1 v)\nset size to (200) %\nset [level_y v] to [2932]\nset [level_x v] to [5785]\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(Level_X) = [2705]> then\n    wait until <touching (hitbox v)?>\n    start sound [SE \[16\] v]\n    broadcast (bossgatetransition v)\n    switch costume to (bossdoor1 v)\n    repeat (3)\n        wait (.05) seconds\n        next costume\n    end\n    wait (1) seconds\n    repeat (3)\n        wait (.05) seconds\n        switch costume to ((costume [number v]) + (-1))\n    end\n    broadcast (Trinitro Man Fight v)\nend\nif <(Level_X) = [3188]> then\n    wait until <<touching (hitbox v)?> and <(item (1) of [activated bossgates v]) = [1]>>\n    start sound [SE \[16\] v]\n    broadcast (bossgatetransition v)\n    switch costume to (bossdoor1 v)\n    repeat (3)\n        wait (.05) seconds\n        next costume\n    end\n    wait (1) seconds\n    repeat (3)\n        wait (.05) seconds\n        switch costume to ((costume [number v]) + (-1))\n    end\n    set [scroll x max v] to [5570]\nend\nif <(Level_X) = [5785]> then\n    wait until <touching (hitbox v)?>\n    start sound [SE \[16\] v]\n    broadcast (bossgatetransition v)\n    switch costume to (bossdoor1 v)\n    repeat (3)\n        wait (.05) seconds\n        next costume\n    end\n    wait (1) seconds\n    repeat (3)\n        wait (.05) seconds\n        switch costume to ((costume [number v]) + (-1))\n    end\n    broadcast (Last Boss Fight v)\nend\n\nwhen I receive [blink v]\ndelete this clone\n\nbroadcast (blink v)\n\n@Yoku Thing\n\nwhen flag clicked\nhide\n\nwhen I receive [battle begin v]\nif <(Checkpoint #) > [5]> then\n    show\n    forever\n        repeat (1)\n            go to (boss v)\n            change y by (60)\n            change x by (-5)\n        end\n        next costume\n    end\nend\n\nwhen I receive [die v]\nhide\n\nwhen I receive [bossdie v]\nhide\n\n@toenail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\nshow\nforever\n    go to [front v] layer\nend\n\n@Menu\n\nwhen flag clicked\nset [megaman costume v] to [1]\nset [able to select? v] to [1]\nset size to (100) %\nclear graphic effects\ngo to x: (0) y: (999)\nswitch costume to (mega-man-x-3 v)\nhide\nrepeat (3)\n    wait (.1) seconds\n    create clone of (_myself_ v)\n    next costume\nend\nswitch costume to (run1 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume3 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume4 v)\ncreate clone of (_myself_ v)\nswitch costume to (icon1 v)\nrepeat (3)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\ngo to [front v] layer\nshow\nif <(costume [number v]) = [1]> then\n    glide (.5) secs to x: (0) y: (100)\nend\nif <(costume [number v]) = [2]> then\n    go to x: (-999) y: (0)\n    glide (.2) secs to x: (0) y: (0)\nend\nif <(costume [number v]) = [3]> then\n    go to x: (-999) y: (-50)\n    glide (.2) secs to x: (0) y: (-50)\nend\nif <(costume [number v]) = [14]> then\n    go to x: (999) y: (-54)\n    glide (.2) secs to x: (167) y: (-54)\nend\nif <(costume [number v]) = [15]> then\n    wait (.2) seconds\n    set [ghost v] effect to (100)\n    go to x: (155) y: (-72)\n    repeat (10)\n        go to [front v] layer\n        change [ghost v] effect by (-10)\n        show\n    end\n    forever\n        if <(Megaman Costume) = [1]> then\n            switch costume to (costume4 v)\n        else\n            if <(Megaman Costume) = [2]> then\n                switch costume to (costume5 v)\n            else\n                switch costume to (costume6 v)\n            end\n        end\n    end\nend\nif <<(costume [number v]) = [18]> or <<(costume [number v]) = [19]> or <(costume [number v]) = [20]>>> then\n    hide\n    wait (.2) seconds\n    set [ghost v] effect to (100)\n    set size to (250) %\n    go to x: ((55) + (((-17) + (costume [number v])) * (50))) y: (-100)\n    repeat (10)\n        go to [front v] layer\n        change [ghost v] effect by (-10)\n        show\n    end\n    forever\n        if <touching (mouse-pointer v)?> then\n            start sound [SE \[13\] v]\n            set [megaman costume v] to ((-17) + (costume [number v]))\n            wait until <not <touching (mouse-pointer v)?>>\n        end\n    end\nend\nif <(costume [number v]) = [4]> then\n    hide\n    wait (.2) seconds\n    set [ghost v] effect to (100)\n    set size to (300) %\n    go to x: (160) y: (-26)\n    repeat (10)\n        go to [front v] layer\n        change [ghost v] effect by (-10)\n        show\n    end\n    forever\n        if <(Megaman Costume) = [1]> then\n            switch costume to (run1 v)\n        else\n            if <(Megaman Costume) = [2]> then\n                switch costume to (prorun1 v)\n            else\n                switch costume to (bass3 v)\n            end\n        end\n        wait (.1) seconds\n        if <(Megaman Costume) = [1]> then\n            switch costume to (run2 v)\n        else\n            if <(Megaman Costume) = [2]> then\n                switch costume to (prorun2 v)\n            else\n                switch costume to (bass4 v)\n            end\n        end\n        wait (.1) seconds\n        if <(Megaman Costume) = [1]> then\n            switch costume to (run3 v)\n        else\n            if <(Megaman Costume) = [2]> then\n                switch costume to (prorun3 v)\n            else\n                switch costume to (bass5 v)\n            end\n        end\n        wait (.1) seconds\n        if <(Megaman Costume) = [1]> then\n            switch costume to (run2 v)\n        else\n            if <(Megaman Costume) = [2]> then\n                switch costume to (prorun2 v)\n            else\n                switch costume to (bass4 v)\n            end\n        end\n        wait (.1) seconds\n    end\nend\n\nwhen I start as a clone\nif <<(costume [number v]) > [1]> and <not <<(costume [number v]) > [3]> and <(costume [number v]) < [15]>>>> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (40)\n        else\n            clear graphic effects\n        end\n    end\nend\n\nwhen I receive [start v]\nwait (1) seconds\ndelete this clone\n\nwhen this sprite clicked\nif <(Able to Select?) = [1]> then\n    if <(costume [number v]) = [2]> then\n        set [able to select? v] to [0]\n        broadcast (START v)\n    end\n    if <(costume [number v]) = [3]> then\n        set [able to select? v] to [0]\n        broadcast (how to play v)\n    end\nend\n\n@how to play\n\nwhen flag clicked\nhide\n\nwhen I receive [how to play v]\ngo to x: (0) y: (0)\nclear graphic effects\nset [ghost v] effect to (100)\nswitch costume to (costume1 v)\ngo to [front v] layer\nshow\nset [able to select? v] to [0]\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait until <<key (space v) pressed?> or <mouse down?>>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nset [able to select? v] to [1]\nhide\n\n
★★★★★★★INSTRUCTIONS★★★★★★★\n\n- Arrow keys or WASD to move and jump\n- Space to fire your blaster\n- Press Down while running to Slide\n- Hold Up or W on ladders to climb them\n\n★★★★★★★★★★★★★★★★★★★★★★\n\nThis is a project showcasing a game engine from the NES game, Mega Man. This project was made to refine my old Mega Man game engine into a much better, more accurate version.\n\nHere is what is different from my previous game engines:\n\n* Improved ladder climbing physics\n* Added extra effects when you get hurt\n* More fluid player movement\n* Option to change your character\n* Fine-tuned all character animations\n* READY prompt is in the correct font\n* Player health bar and Boss health bar are graphically improved\n* Death effect particles have been graphically improved\n\n\n( if you experience any kind of lag, try displaying this project on a different browser such as Chrome )\n\n\n\n★★★★★★★★★CREDITS★★★★★★★★★\n\n-All sprites and all sound effects belong to Capcom,    the original creator of Mega Man, as well as a huge credit to MegaPhilX, the creator of Mega Man Unlimited, which this project is heavily based off of.\n\n- Credit to Spriters Resource and Sprites Inc for additional sprites\n\n- Credit to Mega Man Maker for tilesets and backgrounds\n\n- Credit to @DancingBoi for the Yoku Man sprites\n\n- Music is from Mega Man Unlimited. Stage Music is The Robot Revolution.