Mega Man - Rise of Ghost Man        {SCROLLING PLATFORMER}
@Stage\n\nwhen flag clicked\nset [scroll y min v] to [-0]\nset [scroll x min v] to [0]\nset [scroll x max v] to [965]\nset [scroll y max v] to [0]\nset [music v] to [3]\nset [kill v] to [0]\n\nwhen I receive [game start v]\nset [kill v] to [1]\nset [flying hacks? v] to [0]\nset [scroll y min v] to [-0]\nset [scroll x min v] to [0]\nset [scroll x max v] to [965]\nset [scroll y max v] to [0]\nset [flying hacks? v] to [0]\nset [scroll y min v] to [-0]\nset [scroll x min v] to [0]\nset [scroll x max v] to [965]\nset [scroll y max v] to [28]\nbroadcast (Teleportin v)\nstop all sounds\nwait (.02) seconds\nif <(HARD MODE?) = [1]> then\n    set [music v] to [5]\nelse\n    set [music v] to [3]\nend\nset [kill v] to [0]\nset volume to (100) %\nforever\n    play sound (MUSIC) until done\nend\n\nwhen I receive [teleportin v]\nset [flying hacks? v] to [0]\nset [scroll y min v] to [0]\nset [scroll x min v] to [0]\nset [scroll x max v] to [0]\nset [scroll y min v] to [-2090]\nrepeat until <(Scroll Y) < [-2010]>\n    set [scroll y max v] to (Scroll Y)\nend\nset [scroll x max v] to [5030]\nset [scroll y max v] to [-2090]\nwait (1) seconds\nwait until <(Scroll X) > [5029]>\nset [scroll x min v] to [5030]\nbroadcast (GHOST MAN FIGHT v)\n\nwait (.2) seconds\n\nset [flying hacks? v] to [0]\nset [scroll y min v] to [-0]\nset [scroll x min v] to [0]\nset [scroll y max v] to [0]\nset [scroll x max v] to [2000]\nwait (1) seconds\nwait until <[] > [4560]>\nif <not <(CHECKPOINT #) = [2]>> then\n    set [scroll x min v] to [4560]\n    set [scroll x max v] to [8000]\n    broadcast (BOSSGATE #1 v)\nend\n\nwhen I receive [teleportin v]\nif <(CHECKPOINT #) = [1]> then\n    set [kill v] to [1]\n    set [scroll y v] to [0]\n    repeat (25)\n        set [flying hacks? v] to [0]\n        set [scroll y min v] to [-2090]\n        set [scroll x min v] to [4230]\n        set [scroll y max v] to [-2090]\n        set [scroll x max v] to [5030]\n    end\nelse\n    set [kill v] to [1]\n    set [scroll y v] to [0]\n    repeat (3)\n        set [flying hacks? v] to [0]\n        set [scroll x min v] to [0]\n        set [scroll x max v] to [0]\n        set [scroll y max v] to [0]\n    end\nend\n\nforever\n    play sound [Mega Man IV - Dive Man v] until done\nend\n\nset [scroll y min v] to [-4000]\n\nset [scroll x max v] to [5000]\n\nwhen I receive [fortressdoorexplosion\ v]\nset [scroll x max v] to [6000]\n\nwhen I receive [teleportin v]\nset volume to (100) %\nif <(CHECKPOINT #) = [2]> then\n    set [music v] to [7]\n    stop all sounds\nelse\n    if <(HARD MODE?) = [1]> then\n        set [music v] to [5]\n    else\n        set [music v] to [3]\n    end\n    stop all sounds\nend\n\nwhen I receive [bossgate #1 v]\nrepeat (10)\n    change volume by (-10)\nend\nset [music v] to [5]\n\nwhen I receive [teleportin v]\nstop all sounds\nrepeat (10)\n    change volume by (-10)\nend\nif <(HARD MODE?) = [1]> then\n    set [music v] to [5]\nelse\n    set [music v] to [3]\nend\nstop all sounds\nrepeat (10)\n    change volume by (10)\nend\n\nwhen I receive [grenade man run v]\nset [scroll x min v] to [4560]\nset [scroll x max v] to [20000]\n\nwhen I receive [ghost man fight v]\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\nwait until <([y position v] of [hitbox v]) < [50]>\n\nwhen I receive [die v]\nrepeat (10)\n    change volume by (-10)\nend\n\nwhen I receive [kill v]\nrepeat (10)\n    change volume by (-10)\nend\n\nset [hard mode? v] to [0]\n\nwhen I receive [yay v]\nstop [other scripts in sprite v]\nclear sound effects\nstop all sounds\nforever\n    set volume to (100) %\n    play sound [William Tell Overture Rossini - Mega Man Style \[0CC FamiTracker\] v] until done\nend\n\n@Star 1\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nrepeat until <(x position) > [235]>\n    change x by ((costume [number v]) * (2))\nend\ndelete this clone\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nswitch costume to (pick random (1) to (3))\nset size to (pick random (100) to (250)) %\ngo to [front v] layer\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [intro v]\nstart sound [Mega Man 3 \(NES\) Game Music  Selected Robot Master Screen v]\nwait (0.01) seconds\nset volume to (100) %\nrepeat (40)\n    if <(pick random (1) to (2)) = [1]> then\n        go to x: (-240) y: (pick random (70) to (200))\n    else\n        go to x: (-240) y: (pick random (-200) to (-80))\n    end\n    create clone of (_myself_ v)\n    wait (.1) seconds\nend\nwait (2) seconds\nbroadcast (SetUp v)\n\nwhen I receive [setup v]\nhide\ndelete this clone\n\n@mega man\n\nwhen flag clicked\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 flag clicked\nforever\n    go to x: ([x position v] of [hitbox v]) y: (([y position v] of [hitbox v]) + (-12))\nend\n\nwhen I receive [die v]\nset [speed v] to [1]\n\nwhen I start as a clone\nset rotation style [left-right v]\ngo to [front v] layer\nshow\nif <(hold) = [42]> then\n    turn left (10) degrees\nelse\n    if <(hold) = [41]> then\n        turn right (10) degrees\n    end\nend\nif <(hold) = [40]> 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\nelse\n    start sound [Mega Man 5 SFX \(4\) v]\n    switch costume to (laser v)\nend\n\nwhen flag clicked\nset [flame sword? v] to [0]\nforever\n    if <<<(CanMove?) = [1]> and <(CLIMBING ON LADDER) = [0]>> and <<key (space v) pressed?> or <mouse down?>>> then\n        set [hold v] to [0]\n        create clone of (_myself_ v)\n        start sound [Mega Man 5 SFX \(4\)2 v]\n        repeat until <<(hold) > [19]> or <<not <key (space v) pressed?>> and <not <mouse down?>>>>\n            change [hold v] by (1)\n        end\n        if <(hold) > [19]> 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 (100)\n                wait (.1) seconds\n                set [brightness v] effect to (0)\n                wait (.1) seconds\n            end\n            set [hold v] to [40]\n            create clone of (_myself_ v)\n            start sound [Mega Man 5 SFX \(21\) v]\n        else\n            wait until <<not <key (space v) pressed?>> and <not <mouse down?>>>\n        end\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nif <(animations: editmode>2) = [1]> then\n    set [speed v] to [28]\nelse\n    set [speed v] to [3]\nend\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 <(FLAME SWORD?) = [0]>> then\n    if <(what?) = [Walk]> then\n        if <not <(dead:) = [1]>> then\n            if <(FLAME SWORD?) = [0]> then\n                switch costume to (run1 v)\n            end\n            repeat (3)\n                if <([falling? v] of [hitbox v]) > [1]> then\n                    if <(animations: using gun?2) = [1]> then\n                        if <(FLAME SWORD?) = [0]> then\n                            switch costume to (jumpgun v)\n                        end\n                    else\n                        if <(FLAME SWORD?) = [0]> then\n                            switch costume to (jump v)\n                        end\n                    end\n                else\n                    wait (.1) seconds\n                    if <(FLAME SWORD?) = [0]> then\n                        next costume\n                    end\n                end\n            end\n            wait (.1) seconds\n        end\n    end\n    if <(what?) = [GunRun]> then\n        if <not <(dead:) = [1]>> then\n            if <(FLAME SWORD?) = [0]> then\n                switch costume to (gunrun1 v)\n            end\n            repeat (3)\n                if <([falling? v] of [hitbox v]) > [1]> then\n                    if <(animations: using gun?2) = [1]> then\n                        if <(FLAME SWORD?) = [0]> then\n                            switch costume to (j2 v)\n                        end\n                    else\n                        if <(FLAME SWORD?) = [0]> then\n                            switch costume to (j v)\n                        end\n                    end\n                else\n                    wait (.1) seconds\n                    if <(FLAME SWORD?) = [0]> then\n                        next costume\n                    end\n                end\n            end\n            wait (.1) seconds\n        end\n    end\nend\n\nwhen I start as a clone\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\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]) > [1]> then\n                    if <(animations: using gun?2) = [1]> then\n                        if <(FLAME SWORD?) = [0]> then\n                            switch costume to (jumpgun v)\n                        end\n                    else\n                        if <(FLAME SWORD?) = [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 <(animations: using gun?2) = [1]> then\n                            if <(FLAME SWORD?) = [0]> then\n                                Do [GunRun]\n                            end\n                        else\n                            if <(FLAME SWORD?) = [0]> then\n                                Do [Walk]\n                            end\n                        end\n                    else\n                        if <<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 <(FLAME SWORD?) = [0]> then\n                                    switch costume to (idlegun v)\n                                end\n                            else\n                                if <(FLAME SWORD?) = [0]> then\n                                    switch costume to (idle v)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nswitch costume to (jumpgun v)\n\nwhen I receive [jumphigh v]\nchange [speed y v] by (50)\n\nwhen I receive [intro over v]\nrepeat (10)\n    show\nend\n\nwhen I receive [jumpup v]\nchange [speed y v] by (30)\n\nwhen I start as a clone\nif <not <(costume [number v]) = [24]>> then\n    repeat until <touching (_edge_ v)?>\n        move (20) steps\n    end\n    delete this clone\nend\n\ndefine death\nstart sound [Mega Man 5 SFX \(7\) v]\nswitch costume to (death v)\npoint in direction (0)\ncreate clone of (_myself_ v)\nturn right (45) degrees\ncreate clone of (_myself_ v)\nturn right (45) degrees\ncreate clone of (_myself_ v)\nturn right (45) degrees\ncreate clone of (_myself_ v)\nturn right (45) degrees\ncreate clone of (_myself_ v)\nturn right (45) degrees\ncreate clone of (_myself_ v)\nturn right (45) degrees\ncreate clone of (_myself_ v)\nturn right (45) degrees\ncreate clone of (_myself_ v)\nturn right (45) degrees\npoint in direction (90)\n\nwhen flag clicked\nset [section at v] to [1]\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 [inshell? 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)\nbroadcast (Teleportin v)\n\nwhen I start as a clone\nwait until <touching (_edge_ v)?>\ndelete this clone\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    if <touching (ghost wall v)?> then\n        set [ghost mode? v] to [1]\n        set [ghost v] effect to (50)\n    else\n        set [ghost mode? v] to [0]\n        set [ghost v] effect to (0)\n    end\n    wait (.05) seconds\nend\nset [getting ouched ? v] to [0]\nset [canmove? v] to [1]\nset [takingdmg v] to [0]\n\nwhen flag clicked\nset [getting ouched ? v] to [0]\nset [takingdmg v] to [0]\n\nwhen I receive [blink v]\nrepeat (3)\n    set [ghost v] effect to (100)\n    wait (.05) seconds\n    if <<touching (ghost wall v)?> and <(GHOST MODE?) = [1]>> then\n        set [ghost v] effect to (50)\n    else\n        set [ghost mode? v] to [0]\n        set [ghost v] effect to (0)\n    end\n    wait (.05) seconds\nend\n\nwhen I receive [teleportin v]\nhide\nwait (.1) seconds\nset [canmove? v] to [0]\ngo to [front v] layer\nswitch costume to (break v)\nchange y by (200)\nshow\nif <(CHECKPOINT #) = [1]> then\n    repeat (20)\n        switch costume to (break v)\n        change y by (-10)\n    end\nelse\n    repeat (40)\n        switch costume to (break v)\n        change y by (-10)\n    end\nend\nstart sound [Mega Man 5 SFX \(2\) v]\nswitch costume to (tele2 v)\nwait (.1) seconds\nbroadcast (blink v)\nset [canmove? v] to [1]\n\nchange [scroll x v] by (-15)\n\nwhen flag clicked\nwait (1) seconds\nforever\n    wait until <<(y position) < [-165]> and <(HEALTH) < [15]>>\n    start sound [Mega Man 5 SFX \(7\) v]\n    hide\n    wait (1) seconds\n    broadcast (GAME START v)\n    set [scroll x v] to [0]\n    set [scroll y v] to [0]\n    show\n    wait (3) seconds\nend\n\nmove (10) steps\n\nif <(costume [number v]) = [18]> then\n    forever\n        set [brightness v] effect to (100)\n        wait (.1) seconds\n        clear graphic effects\n        wait (.1) seconds\n    end\nend\n\nwhen I receive [teleportin v]\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [heal v]\nrepeat (3)\n    set [ghost v] effect to (100)\n    wait (.1) seconds\n    set [ghost v] effect to (0)\n    wait (.1) seconds\nend\n\nwhen I receive [teleportin v]\nclear graphic effects\n\nwhen I receive [bossgate #1 v]\nset [canmove? v] to [0]\nrepeat (10)\n    switch costume to (idle v)\nend\n\nwhen I receive [grenade man flee v]\nset [canmove? v] to [1]\n\nwhen flag clicked\nset [ghost mode? v] to [0]\nforever\n    wait until <(GHOST MODE?) = [1]>\n    set [ghost v] effect to (50)\n    wait until <(GHOST MODE?) = [0]>\n    set [ghost v] effect to (0)\nend\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 [ghost man fight v]\nset [canmove? v] to [0]\n\nwhen I receive [battle begin v]\nset [canmove? v] to [1]\n\nwhen I receive [kill v]\nset [canmove? v] to [0]\n\nwhen I receive [kill v]\nwait (1) seconds\nstop [other scripts in sprite v]\nwait (2) seconds\nswitch costume to (jump v)\nglide (.25) secs to x: (0) y: (50)\nrepeat until <touching (ground v)?>\n    change y by (-10)\nend\nstart sound [Mega Man II - Victory v]\nswitch costume to (idle v)\nset y to (-87)\nwait (7) seconds\nswitch costume to (jump v)\nglide (.25) secs to x: (0) y: (50)\nwait (.5) seconds\nswitch costume to (break v)\nstart sound [Mega Man 5 SFX \(31\) v]\nrepeat until <touching (_edge_ v)?>\n    change y by (10)\nend\nrepeat (5)\n    change y by (10)\nend\nhide\nwait (1) seconds\nbroadcast (yay v)\n\nwhen flag clicked\nset [flame sword? v] to [0]\nforever\n    if <<<(CanMove?) = [1]> and <(CLIMBING ON LADDER) = [0]>> and <key (z v) pressed?>> then\n        if <(direction) = [90]> then\n            set [canmove? v] to [0]\n            set [flame sword? v] to [1]\n            set [f_s. dir. v] to [45]\n            broadcast (FLAME SWORD v)\n            switch costume to (sword1 v)\n            start sound [Mega Man 6 SRX \(34\) v]\n            repeat (5)\n                wait (.02) seconds\n                next costume\n                create clone of (flame sword projectile v)\n                change [f_s. dir. v] by (15)\n            end\n            wait (.25) seconds\n            set [canmove? v] to [1]\n            set [flame sword? v] to [0]\n        else\n            set [flame sword? v] to [1]\n            set [f_s. dir. v] to [-45]\n            broadcast (FLAME SWORD v)\n            switch costume to (sword1 v)\n            start sound [Mega Man 6 SRX \(34\) v]\n            repeat (5)\n                wait (.02) seconds\n                next costume\n                create clone of (flame sword projectile v)\n                change [f_s. dir. v] by (-15)\n            end\n            wait (.25) seconds\n            set [flame sword? v] to [0]\n        end\n    end\nend\n\n@ground\n\nwhen I receive [setup v]\nshow\nset size to (200) %\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nswitch costume to (costume1 v)\nCreate\nhide\n\nwhen I receive [level loop v]\nforever\n    set [brightness v] effect to (0)\n    set x to ((Level_X) - (Scroll X))\n    set y to ((Level_Y) - ([ceiling v] of (Scroll Y) ))\n    if <<([abs v] of ((Level_X) - (Scroll X)) ) > [600]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [475]>> then\n        hide\n    else\n        show\n    end\nend\n\ndefine Create\nset [level_y v] to [0]\nset [level_x v] to [0]\nrepeat (6)\n    create clone of (_myself_ v)\n    change [level_y v] by (-416)\n    next costume\nend\nchange [level_y v] by (416)\nswitch costume to (costume4 v)\nrepeat (20)\n    change [level_x v] by (500)\n    create clone of (_myself_ v)\n    next costume\nend\nswitch costume to (costume15 v)\nrepeat (3)\n    create clone of (_myself_ v)\n    change [level_x v] by (500)\n    next costume\nend\nchange [level_y v] by (450)\nchange [level_x v] by (9999)\n\ndefine Create\n\nwhen I receive [setup v]\nbroadcast (GAME START v)\nforever\n    broadcast (Level Loop v)\nend\n\nrepeat (3)\n    create clone of (_myself_ v)\n    next costume\nend\nswitch costume to (costume7 v)\nset [level_x v] to [1440]\nset [level_y v] to [-965]\nrepeat (4)\n    create clone of (_myself_ v)\n    next costume\n    change [level_x v] by (480)\nend\nswitch costume to (costume11 v)\nrepeat (4)\n    create clone of (_myself_ v)\n    next costume\n    change [level_y v] by (416)\nend\nchange [level_y v] by (-416)\nrepeat (9)\n    change [level_x v] by (480)\n    create clone of (_myself_ v)\n    next costume\nend\nswitch costume to (costume23 v)\nchange [level_y v] by (-416)\nchange [level_x v] by (-480)\ncreate clone of (_myself_ v)\nnext costume\nchange [level_x v] by (-480)\ncreate clone of (_myself_ v)\nnext costume\nchange [level_x v] by (480)\nset [level_y v] to [-190]\nrepeat (18)\n    change [level_x v] by (480)\n    create clone of (_myself_ v)\n    next costume\nend\nchange [level_x v] by (480)\n\nwhen I start as a clone\ngo to [front v] layer\n\nwhen I receive [bossgate #1 v]\n\nif <(costume [number v]) = [10]> then\n    start sound [Mega Man 5 SFX \(15\) v]\n    switch costume to (costume13 v)\nend\nif <(costume [number v]) = [12]> then\n    switch costume to (costume14 v)\nend\n\nwhen I receive [teleportin v]\nif <(costume [number v]) = [13]> then\n    switch costume to (costume10 v)\nend\nif <(costume [number v]) = [14]> then\n    switch costume to (costume11 v)\nend\n\nwhen I receive [grenade man run v]\n\nif <(costume [number v]) = [13]> then\n    start sound [Mega Man 5 SFX \(15\) v]\n    switch costume to (costume10 v)\nend\nif <(costume [number v]) = [14]> then\n    switch costume to (costume11 v)\nend\n\n@Level_Art\n\nwhen I receive [setup v]\nshow\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nswitch costume to (grenade v)\nCreate\nhide\n\ndefine Create\nset [brightness v] effect to (15)\nset size to (200) %\nswitch costume to (winter3 v)\nset [level_y v] to [435]\nset [level_x v] to [0]\ncreate clone of (_myself_ v)\nswitch costume to (winter v)\nset [level_y v] to [0]\nset [level_x v] to [0]\nrepeat (1)\n    create clone of (_myself_ v)\n    change [level_y v] by (-416)\nend\nswitch costume to (ghsot v)\nrepeat (5)\n    create clone of (_myself_ v)\n    change [level_y v] by (-416)\nend\nchange [level_y v] by (416)\nrepeat (8)\n    change [level_x v] by (500)\n    create clone of (_myself_ v)\nend\nswitch costume to (winter2 v)\nrepeat (3)\n    change [level_x v] by (499)\n    create clone of (_myself_ v)\nend\n\nrepeat (20)\n    create clone of (_myself_ v)\n    change [level_x v] by (500)\nend\n\ndefine Find Costume Number\nset [level costumes v] to [1]\nswitch costume to ((1) / (1))\nnext costume\nrepeat until <(costume [number v]) = [1]>\n    change [level costumes v] by (1)\n    next costume\nend\n\nwhen I receive [level loop v]\nforever\n    set x to ((Level_X) - (Scroll X))\n    set y to ((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 flag clicked\nforever\n    broadcast (Level Loop v)\nend\n\nchange [level_x v] by (480)\n\nchange [level_x v] by (480)\n\nset [level_y v] to [-150]\n\nchange [level_x v] by (540)\n\nchange [level_y v] by (-448)\n\nwhen I start as a clone\nforever\n    set [brightness v] effect to (0)\n    repeat (20)\n        change [brightness v] effect by (.4)\n    end\n    repeat (20)\n        change [brightness v] effect by (-.4)\n    end\nend\n\nwait (.5) seconds\nset [brightness v] effect to (20)\nwait (.5) seconds\n\nswitch costume to (ghsot v)\n\nbroadcast (blink v)\n\n@hitbox\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)?> or <<touching (ghost wall v)?> and <(GHOST MODE?) = [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\nwait until <(Health) < [1]>\nstop [other scripts in sprite v]\nbroadcast (game over v)\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 [holding? v] to [0]\nset [inshell? 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 <(TRANSITION) = [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)>>>> <<<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)>>>> <<<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)>>>>\n    end\nend\n\nwhen I receive [jumpup v]\nchange [speed y v] by (30)\n\nwhen I receive [jumphigh v]\nchange [speed y v] by (50)\n\nwhen flag clicked\nset volume to (60) %\nset [frame v] to [0]\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 flag clicked\nset rotation style [left-right v]\nif <(editmode>) = [1]> then\n    set [speed v] to [28]\nelse\n    set [speed v] to [3]\nend\n\nwhen flag clicked\n\nchange [scroll x v] by (10)\n\nwhen flag clicked\nset [canmove? v] to [0]\n\nforever\n    if <key (r v) pressed?> then\n        go to x: (0) y: (-120)\n        set [speed y v] to [0]\n        broadcast (Teleportin v)\n        wait (10) seconds\n    end\nend\n\nwhen flag clicked\nset size to (150) %\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]\ngo to x: (-999) y: (-999)\n\nforever\n    if <(slope) = [8]> then\n        change [scroll x v] by ((0) - ((speed) * (2)))\n        change y by (((0) - (slope)) * (2))\n        set [slope v] to [0]\n    end\nend\n\ndefine Tick <<> <^> <>>\nif <(CanMove?) = [1]> then\n    if <(CLIMBING ON LADDER) = [0]> then\n        if <<(Flying Hacks?) = [1]> and <<<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 <not <(speed y) > [3]>> then\n                change [speed y v] by (-.1)\n            end\n            change y by (speed y)\n        else\n            if <(FLAME SWORD?) = [0]> then\n                change [speed y v] by (-.8)\n                change y by (speed y)\n            end\n        end\n    end\n    Touch Ground <(speed y) > [0]>\n    if <<> then\n        point in direction (-90)\n        if <(FLAME SWORD?) = [0]> then\n            Walk (direction) [-6]\n        end\n    end\n    if <>> then\n        point in direction (90)\n        if <(FLAME SWORD?) = [0]> then\n            Walk (direction) [6]\n        end\n    end\n    set [speed x v] to ((speed x) * (0.7))\n    if <(FLAME SWORD?) = [0]> then\n        change y by (speed y)\n    end\n    Touch Ground <(speed y) > [0]>\n    if <<^> and <(falling?) < [3]>> then\n        if <(FLAME SWORD?) = [0]> then\n            set [speed y v] to [10]\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        if <(CLIMBING ON LADDER) = [0]> then\n            change [speed y v] by (-1)\n        end\n        if <(CLIMBING ON LADDER) = [1]> then\n            change y by (-6)\n        end\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 <(FLAME SWORD?) = [0]> then\n            if <(falling?) < [3]> then\n                set [speed y v] to [10]\n            else\n            end\n        else\n            set [speed y v] to [0]\n        end\n    else\n        if <(FLAME SWORD?) = [0]> then\n            change [speed y v] by (-1)\n        end\n    end\nend\n\nchange [speed x v] by (-3)\n\nchange [speed x v] by (3)\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <not <<touching (ground v)?> or <<touching (ghost wall v)?> and <(GHOST MODE?) = [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\ndefine Touch Ground <up?>\n\ngo to x: (-172) y: (-81)\n\nchange x by (1)\n\nwhen flag clicked\n\nwhen flag clicked\n\nwhen I receive [knockback v]\nif <(direction) = [90]> then\n    repeat (3)\n        Walk [90] [-15]\n    end\n    repeat (3)\n        Walk [90] [-8]\n    end\nelse\n    repeat (3)\n        Walk [90] [15]\n    end\n    repeat (3)\n        Walk [90] [8]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (ladder v)?> then\n        set [climbing on ladder v] to [1]\n    else\n        set [climbing on ladder v] to [0]\n    end\nend\n\nwhen I receive [teleportin v]\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 [rushjump v]\nset [speed y v] to [25]\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]\nwait (.4) seconds\nset [canmove? v] to [1]\nset [takingdmg v] to [0]\n\nwhen I receive [bossdie v]\nwait (1) seconds\nstop [other scripts in sprite v]\nwait (2) seconds\nhide\n\nbroadcast (Teleportin v)\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]\nhide\nwait (.1) seconds\nset [scroll y v] to [100]\nset [speed y v] to [10]\nrepeat (5)\n    if <(CHECKPOINT #) = [2]> then\n        set [scroll x v] to [5100]\n    else\n        if <(CHECKPOINT #) = [1]> then\n            set [scroll x v] to [4100]\n            set [scroll y v] to [-2300]\n        else\n            set [scroll x v] to [0]\n        end\n    end\nend\nset [canmove? v] to [0]\ngo to [front v] layer\nchange y by (300)\nset [ghost v] effect to (100)\nshow\nrepeat (1)\n    change y by (-20)\nend\nrepeat until <<touching (ground v)?> or <touching (ghost wall v)?>>\n    change y by (-15)\nend\nset x to (0)\nchange y by (20)\nset y to (25)\nstart sound [Mega Man 5 SFX \(21\) v]\nwait (.1) seconds\nset [canmove? v] to [1]\n\nbroadcast (Teleportin v)\n\nbroadcast (Teleportin v)\n\nwhen flag clicked\nset [sliding? v] to [0]\n\nwhen flag clicked\nforever\n    if <(SLIDING?) = [1]> then\n        switch costume to (idle2 v)\n    else\n        switch costume to (idle v)\n    end\nend\n\nwhen flag clicked\nset [sliding? v] to [0]\nset [slide time v] to [0]\nforever\n    if <(slide time) > [13]> then\n        set [sliding? v] to [0]\n    end\n    if <not <<<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 <(slide time) > [0]> then\n            change [slide time v] by (-1)\n            set [sliding? v] to [0]\n        end\n    end\nend\n\nwhen I receive [bossgate #1 v]\nset [canmove? v] to [0]\n\nwhen I receive [grenade man flee v]\nset [canmove? v] to [1]\n\nchange y by (-20)\n\nwhen I receive [moveplatform v]\nchange x by (5)\n\nwhen I receive [moveplatformup v]\nchange y by (5)\n\nwhen flag clicked\nforever\n    if <<<key (down arrow v) pressed?> or <<key (s v) pressed?> or <<mouse down?> and <<(distance to [mouse-pointer v]) > [20]> and <(mouse y) < (y position)>>>>> and <not <key (space v) pressed?>>> then\n        start sound [Mega Man 6 SRX \(9\) v]\n        set [ghost mode? v] to [1]\n        wait until <<<key (space v) pressed?> and <not <touching (ghost wall v)?>>> or <(GHOST MODE?) = [0]>>\n        set [ghost mode? v] to [0]\n        start sound [Mega Man 6 SRX \(9\) v]\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [battle begin v]\nset [canmove? v] to [1]\n\nwhen I receive [ghost man fight v]\nset [canmove? v] to [0]\n\nwhen I receive [kill v]\nset [canmove? v] to [0]\n\nset [speed y v] to [5]\n\nset [speed y v] to [10]\n\nwhen flag clicked\n\nwait (1) seconds\nforever\n    wait until <(FLAME SWORD?) = [1]>\n    set [canmove? v] to [0]\n    wait until <(FLAME SWORD?) = [0]>\n    set [canmove? v] to [1]\nend\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [intro v]\nhide\ngo to x: (-15) y: (-55)\nclear graphic effects\nset size to (200) %\nswitch costume to (nail man text2 v)\ngo to [front v] layer\nwait (3.5) seconds\nshow\nrepeat (8)\n    next costume\n    wait (0.005) seconds\nend\n\nwhen I receive [setup v]\nhide\ndelete this clone\n\nwhen I receive [teleportin v]\nswitch costume to (costume1 v)\nshow\nrepeat (2)\n    go to [front v] layer\n    clear graphic effects\n    wait (.2) seconds\n    set [ghost v] effect to (100)\n    wait (.2) seconds\nend\nhide\n\n@border\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume2 v)\ngo to [front v] layer\nclear graphic effects\nshow\n\nwhen I receive [intro v]\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nclear graphic effects\nhide\n\nwhen I receive [game start v]\nset [brightness v] effect to (-100)\ngo to [front v] layer\nshow\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\n\n@toenail\n\nwhen flag clicked\nhide\n\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ngo to [front v] layer\nwait (.5) seconds\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nrepeat (3)\n    start sound [Mega Man 6 SRX \(6\) v]\n    clear graphic effects\n    change [brightness v] effect by (100)\n    wait (.05) seconds\n    change [ghost v] effect by (100)\n    wait (.05) seconds\nend\nclear graphic effects\nchange [brightness v] effect by (100)\nwait (.5) seconds\nclear graphic effects\nforever\n    switch costume to (mega-man-x v)\n    wait (.4) seconds\n    next costume\n    wait (.4) seconds\nend\n\n@hpbar\n\nwhen flag clicked\nwait (1) seconds\nforever\n    wait until <(HEALTH) > [14]>\n    broadcast (die v)\n    wait (1) seconds\nend\n\nbroadcast (die v)\n\nwhen flag clicked\nrepeat (10)\n    set [health v] to [1]\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [player start v]\nshow\n\nwhen I receive [take dmg v]\nif <(GHOST MODE?) = [0]> then\n    set [brightness v] effect to (100)\n    wait (.2) seconds\n    clear graphic effects\n    wait (.2) seconds\nend\n\nwhen I receive [gemini die v]\nwait (1) seconds\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [teleportin v]\nset [health v] to [1]\npoint in direction (0)\ngo to x: (-209) y: (91)\nclear graphic effects\nset size to (250) %\nshow\nrepeat (10)\n    go to [front v] layer\nend\nforever\n    switch costume to (HEALTH)\nend\n\nwhen I receive [bossdie v]\nstop [other scripts in sprite v]\nwait (4) seconds\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nwhen I receive [heal v]\nstart sound [Mega Man 5 SFX \(19\) v]\nset [health v] to [1]\nrepeat (3)\n    set [brightness v] effect to (100)\n    wait (.1) seconds\n    clear graphic effects\n    wait (.1) seconds\nend\n\nwhen I receive [grenade man run v]\nrepeat (10)\n    go to [front v] layer\nend\n\nwhen I receive [kill v]\nstop [other scripts in sprite v]\nhide\n\n@vile\n\nwhen flag clicked\nset volume to (100) %\nstart sound [a-ha-take-on-me-cut-mp3_rnSXv7Z v]\nswitch costume to (vile3 v)\nset size to (250) %\ngo to x: (-225) y: (-43)\npoint in direction (90)\nset rotation style [left-right v]\ngo to [front v] layer\nshow\nrepeat (10)\n    go to [front v] layer\n    change x by (30)\nend\nrepeat (6)\n    change x by (15)\nend\nrepeat (4)\n    change x by (5)\nend\nswitch costume to (vile1 v)\nstart sound [Mega Man 5 SFX \(21\)3 v]\nwait (.2) seconds\nstart sound [Mega Man 5 SFX \(21\)3 v]\nswitch costume to (vile2 v)\npoint in direction (-90)\ncreate clone of (_myself_ v)\nwait (2) seconds\nswitch costume to (vile3 v)\nrepeat (12)\n    go to [front v] layer\n    change x by (-30)\nend\nrepeat (8)\n    change x by (-15)\nend\nrepeat (5)\n    change x by (-5)\nend\nhide\nrepeat (10)\n    change volume by (-10)\nend\nbroadcast (INTRO v)\n\nbroadcast (GAME START v)\nbroadcast (SetUp v)\n\nwhen flag clicked\nstart sound [Mega Man 5 SFX \(42\) v]\nhide\n\nwhen I start as a clone\nswitch costume to (reee v)\npoint in direction (90)\nset size to (100) %\ngo to x: (12) y: (999)\nrepeat (3)\n    change y by (-40)\nend\nrepeat (2)\n    change y by (-30)\nend\nrepeat (2)\n    change y by (-20)\nend\nrepeat (2)\n    change y by (-10)\nend\nstart sound [mario_coin_sound v]\nrepeat (3)\n    show\n    wait (.5) seconds\n    hide\n    wait (.2) seconds\nend\ndelete this clone\n\nwhen I receive [flame sword v]\npoint in direction (90)\ngo to [front v] layer\nswitch costume to (icon v)\nset size to (150) %\nrepeat (3)\n    go to (hitbox v)\n    change y by (40)\n    show\n    wait (.2) seconds\n    hide\n    wait (.2) seconds\nend\n\n@Background\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo [backward v] (1) layers\nshow\n\nwhen I receive [setup v]\nhide\ndelete this clone\n\n@Ghost Man\n\nwhen flag clicked\nhide\n\nwhen I receive [setup v]\nhide\ndelete this clone\n\nwhen I receive [ghost man fight v]\npoint in direction (-90)\nset rotation style [left-right v]\ngo to x: (150) y: (999)\nswitch costume to (gjump v)\nclear graphic effects\nshow\nrepeat (5)\n    change y by (-5)\nend\nrepeat (3)\n    change y by (-15)\nend\nrepeat (3)\n    change y by (-25)\nend\nrepeat (3)\n    change y by (-40)\nend\nchange y by (-13)\nrepeat (2)\n    switch costume to (dance1 v)\n    repeat (2)\n        wait (.05) seconds\n        next costume\n    end\n    wait (.05) seconds\n    switch costume to (flash v)\n    wait (.05) seconds\nend\nswitch costume to (dance1 v)\nwait (.5) seconds\nbroadcast (bATTLE begin v)\n\nwhen I receive [ghost man fight v]\nwait (2) seconds\nrepeat until <([costume # v] of [boss hp v]) > [14]>\n    if <<touching color (#fcd8a8)?> or <touching (flame sword projectile v)?>> then\n        start sound [Mega Man 5 SFX \(20\) v]\n        broadcast (BossDMG v)\n        repeat (7)\n            set [ghost v] effect to (100)\n            wait (.05) seconds\n            clear graphic effects\n            wait (.05) seconds\n        end\n    end\nend\n\nwhen I receive [kill v]\nstop [other scripts in sprite v]\nhide\nwait (.02) seconds\nstart sound [Mega Man 5 SFX \(22\) v]\nrepeat (12)\n    set [projectile name v] to [expl1]\n    set [proj x v] to ((5030) + ((x position) + (pick random (-25) to (25))))\n    set [proj y v] to ((-2090) + (((y position) + (25)) + (pick random (-25) to (25))))\n    set [proj direction v] to (direction)\n    broadcast (CREATE PROJECTILE v)\n    wait (.02) seconds\nend\n\nwhen I receive [ghost man fight v]\nwait (3) seconds\nwait until <([costume # v] of [boss hp v]) > [14]>\nstop [other scripts in sprite v]\nbroadcast (KILL v)\n\nwhen I start as a clone\nclear graphic effects\nif <(GHOST CLONE) = [1]> then\n    glide (.5) secs to x: (100) y: (91)\n    point towards (hitbox v)\n    wait (.05) seconds\n    next costume\n    wait (.05) seconds\n    point towards (hitbox v)\n    next costume\n    set [projectile name v] to [pharaoh]\n    set [proj x v] to ((5030) + (x position))\n    set [proj y v] to ((-2090) + ((y position) + (25)))\n    set [proj direction v] to ((direction) + (pick random (-10) to (10)))\n    broadcast (CREATE PROJECTILE v)\n    wait (.5) seconds\nelse\n    glide (.5) secs to x: (-100) y: (91)\n    wait (.1) seconds\n    next costume\n    wait (.05) seconds\n    next costume\n    point towards (hitbox v)\n    set [projectile name v] to [pharaoh]\n    set [proj x v] to ((5030) + (x position))\n    set [proj y v] to ((-2090) + ((y position) + (25)))\n    set [proj direction v] to ((direction) + (pick random (-10) to (10)))\n    broadcast (CREATE PROJECTILE v)\n    wait (.5) seconds\nend\nwait (.25) seconds\nrepeat (3)\n    start sound [Mega Man 5 SFX \(11\)2 v]\n    set [ghost v] effect to (100)\n    wait (.05) seconds\n    clear graphic effects\n    wait (.05) seconds\nend\ndelete this clone\n\nwhen I receive [ghost man fight v]\nwait (1) seconds\nforever\n    wait until <touching (hitbox v)?>\n    broadcast (KNOCKBACK v)\n    wait (.3) seconds\n    change [health v] by (2)\n    broadcast (TAKE DMG v)\nend\n\nwhen I receive [intro v]\nswitch costume to (idle v)\ngo to x: (3) y: (999)\nshow\nglide (1) secs to x: (3) y: (-17)\nrepeat (3)\n    switch costume to (dance1 v)\n    repeat (2)\n        wait (.05) seconds\n        next costume\n    end\n    wait (.05) seconds\n    switch costume to (flash v)\n    wait (.05) seconds\nend\nswitch costume to (dance1 v)\n\nwhen I receive [intro over v]\nhide\n\nwhen I receive [battle begin v]\nforever\n    if <(HARD MODE?) = [1]> then\n        go to x: (150) y: (-113)\n        switch costume to (jump v)\n        repeat (3)\n            change y by (10)\n            change x by (-5)\n        end\n        repeat (3)\n            change y by (12)\n            change x by (-6)\n        end\n        repeat (3)\n            change y by (16)\n            change x by (-9)\n        end\n        repeat (3)\n            change y by (18)\n            change x by (-13)\n        end\n        repeat (3)\n            change y by (12)\n            change x by (-18)\n        end\n        switch costume to (fireball v)\n        point towards (hitbox v)\n        set [ghost clone v] to [1]\n        create clone of (_myself_ v)\n        wait (.02) seconds\n        set [ghost clone v] to [2]\n        create clone of (_myself_ v)\n        wait (1) seconds\n        next costume\n        wait (.05) seconds\n        next costume\n        point towards (hitbox v)\n        set [projectile name v] to [pharaoh]\n        set [proj x v] to ((5030) + (x position))\n        set [proj y v] to ((-2090) + ((y position) + (25)))\n        set [proj direction v] to ((direction) + (0))\n        broadcast (CREATE PROJECTILE v)\n        wait (.02) seconds\n        set [projectile name v] to [pharaoh]\n        set [proj x v] to ((5030) + (x position))\n        set [proj y v] to ((-2090) + ((y position) + (25)))\n        set [proj direction v] to ((direction) + (-25))\n        broadcast (CREATE PROJECTILE v)\n        wait (.02) seconds\n        set [projectile name v] to [pharaoh]\n        set [proj x v] to ((5030) + (x position))\n        set [proj y v] to ((-2090) + ((y position) + (25)))\n        set [proj direction v] to ((direction) + (25))\n        broadcast (CREATE PROJECTILE v)\n        wait (1) seconds\n        set [jumpy jump v] to [5]\n        go to x: (-3) y: (91)\n        point in direction (-90)\n        repeat until <touching (ground v)?>\n            change y by (-15)\n        end\n        repeat (2)\n            switch costume to (fireball v)\n            set [jumpy jump v] to [5]\n            play sound [Mega Man 5 SFX \(21\)3 v] until done\n            repeat (5)\n                change [jumpy jump v] by (4)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (-2))\n            end\n            repeat (5)\n                change [jumpy jump v] by (-4)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (-2))\n            end\n            next costume\n            point towards (hitbox v)\n            set [projectile name v] to [pharaoh]\n            set [proj x v] to ((5030) + (x position))\n            set [proj y v] to ((-2090) + ((y position) + (25)))\n            set [proj direction v] to ((direction) + (0))\n            broadcast (CREATE PROJECTILE v)\n            repeat (12)\n                change [jumpy jump v] by (-4)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (2))\n            end\n            set y to (-110)\n        end\n        repeat (3)\n            switch costume to (fireball v)\n            point in direction (90)\n            start sound [Mega Man 5 SFX \(21\)3 v]\n            set [jumpy jump v] to [5]\n            repeat (5)\n                change [jumpy jump v] by (4)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (2))\n            end\n            repeat (5)\n                change [jumpy jump v] by (-4)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (2))\n            end\n            next costume\n            point towards (hitbox v)\n            set [projectile name v] to [pharaoh]\n            set [proj x v] to ((5030) + (x position))\n            set [proj y v] to ((-2090) + ((y position) + (25)))\n            set [proj direction v] to ((direction) + (0))\n            broadcast (CREATE PROJECTILE v)\n            repeat (12)\n                change [jumpy jump v] by (-2)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (-2))\n            end\n            set y to (-110)\n        end\n        switch costume to (idle v)\n        set y to (-115)\n        repeat (3)\n            repeat (2)\n                start sound [Mega Man 5 SFX \(21\)3 v]\n                switch costume to (dance2 v)\n                repeat (1)\n                    start sound [Mega Man 5 SFX \(21\)3 v]\n                    wait (.05) seconds\n                    next costume\n                end\n                wait (.05) seconds\n                start sound [Mega Man 5 SFX \(21\)3 v]\n                switch costume to (flash v)\n                wait (.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (.05) seconds\n            start sound [Mega Man 6 SRX \(39\) v]\n            point towards (hitbox v)\n            set [projectile name v] to [skull]\n            set [proj x v] to ((5030) + (x position))\n            set [proj y v] to ((-2090) + ((y position) + (25)))\n            set [proj direction v] to (direction)\n            broadcast (CREATE PROJECTILE v)\n        end\n        wait (.25) seconds\n        switch costume to (idle v)\n        set x to (95)\n        repeat (5)\n            change x by (10)\n        end\n        set x to (150)\n    else\n        go to x: (150) y: (-113)\n        switch costume to (jump v)\n        repeat (3)\n            change y by (10)\n            change x by (-5)\n        end\n        repeat (3)\n            change y by (12)\n            change x by (-6)\n        end\n        repeat (3)\n            change y by (16)\n            change x by (-9)\n        end\n        repeat (3)\n            change y by (18)\n            change x by (-13)\n        end\n        repeat (3)\n            change y by (12)\n            change x by (-18)\n        end\n        switch costume to (fireball v)\n        point towards (hitbox v)\n        set [ghost clone v] to [1]\n        create clone of (_myself_ v)\n        wait (.02) seconds\n        set [ghost clone v] to [2]\n        create clone of (_myself_ v)\n        wait (.5) seconds\n        next costume\n        wait (.05) seconds\n        next costume\n        point towards (hitbox v)\n        set [projectile name v] to [pharaoh]\n        set [proj x v] to ((5030) + (x position))\n        set [proj y v] to ((-2090) + ((y position) + (25)))\n        set [proj direction v] to ((direction) + (0))\n        broadcast (CREATE PROJECTILE v)\n        wait (1) seconds\n        set [jumpy jump v] to [5]\n        go to x: (-3) y: (91)\n        point in direction (-90)\n        repeat until <touching (ground v)?>\n            change y by (-15)\n        end\n        repeat (2)\n            switch costume to (fireball v)\n            set [jumpy jump v] to [5]\n            play sound [Mega Man 5 SFX \(21\)3 v] until done\n            repeat (5)\n                change [jumpy jump v] by (2)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (-2))\n            end\n            repeat (5)\n                change [jumpy jump v] by (-2)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (-2))\n            end\n            next costume\n            point towards (hitbox v)\n            set [projectile name v] to [pharaoh]\n            set [proj x v] to ((5030) + (x position))\n            set [proj y v] to ((-2090) + ((y position) + (25)))\n            set [proj direction v] to ((direction) + (0))\n            broadcast (CREATE PROJECTILE v)\n            repeat (12)\n                change [jumpy jump v] by (-2)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (2))\n            end\n            set y to (-110)\n        end\n        repeat (3)\n            switch costume to (fireball v)\n            point in direction (90)\n            start sound [Mega Man 5 SFX \(21\)3 v]\n            set [jumpy jump v] to [5]\n            repeat (5)\n                change [jumpy jump v] by (2)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (2))\n            end\n            repeat (5)\n                change [jumpy jump v] by (-2)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (2))\n            end\n            next costume\n            point towards (hitbox v)\n            set [projectile name v] to [pharaoh]\n            set [proj x v] to ((5030) + (x position))\n            set [proj y v] to ((-2090) + ((y position) + (25)))\n            set [proj direction v] to ((direction) + (0))\n            broadcast (CREATE PROJECTILE v)\n            repeat (12)\n                change [jumpy jump v] by (-2)\n                change y by (jumpy jump)\n                change x by ((jumpy jump) / (-2))\n            end\n            set y to (-110)\n        end\n        switch costume to (idle v)\n        set y to (-115)\n        if <(x position) < ([x position v] of [mega man v])> then\n            point in direction (90)\n        else\n            point in direction (-90)\n        end\n        repeat (3)\n            repeat (2)\n                start sound [Mega Man 5 SFX \(21\)3 v]\n                switch costume to (dance2 v)\n                repeat (1)\n                    start sound [Mega Man 5 SFX \(21\)3 v]\n                    wait (.05) seconds\n                    next costume\n                end\n                wait (.05) seconds\n                start sound [Mega Man 5 SFX \(21\)3 v]\n                switch costume to (flash v)\n                wait (.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (.05) seconds\n            start sound [Mega Man 6 SRX \(39\) v]\n            set [projectile name v] to [skull]\n            set [proj x v] to ((5030) + (x position))\n            set [proj y v] to ((-2090) + ((y position) + (25)))\n            set [proj direction v] to (direction)\n            broadcast (CREATE PROJECTILE v)\n        end\n        wait (.25) seconds\n        switch costume to (idle v)\n        set x to (95)\n        repeat (5)\n            change x by (10)\n        end\n        set x to (150)\n    end\nend\n\nwhen I receive [kill v]\ndelete this clone\n\nwhen I receive [die v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\n@border2\n\nwhen flag clicked\nhide\n\nwhen I receive [game start v]\nclear graphic effects\ngo to x: (0) y: (0)\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [yay v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@flame sword projectile\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to (hitbox v)\nforever\n    wait (.1) seconds\nend\n\nwhen I start as a clone\ngo to [front v] layer\nstart sound [Mega Man 6 SRX \(54\) v]\nset size to (200) %\nset rotation style [left-right v]\npoint in direction (F_S. DIR.)\nshow\nrepeat (15)\n    move (15) steps\nend\nrepeat (30)\n    move (5) steps\n    turn right (15) degrees\n    change y by (-5)\nend\nrepeat (10)\n    move (5) steps\n    turn right (15) degrees\n    change y by (-5)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@checkpoints\n\nwhen flag clicked\nset [checkpoint # v] to [0]\nset size to (200) %\nhide\n\nwhen I receive [level loop v]\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)) ) > [300]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [300]>> then\n        hide\n    else\n        show\n    end\nend\n\ndefine Create\nset [level_y v] to [-2150]\nset [level_x v] to [4188]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [level_x v] to [-5000]\n\nwhen I receive [setup v]\nshow\nset size to (200) %\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [-5000]\nswitch costume to (cp1 v)\nCreate\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    wait (.05) seconds\n    next costume\nend\n\nwhen I start as a clone\nclear graphic effects\nwait (1) seconds\nif <(Level_X) = [4188]> then\n    wait until <touching (mega man v)?>\n    start sound [Mega Man 5 SFX \(14\) v]\n    set [checkpoint # v] to [1]\n    repeat (5)\n        set [brightness v] effect to (100)\n        wait (.1) seconds\n        clear graphic effects\n        wait (.1) seconds\n    end\nend\n\ngo to [front v] layer\n\n@boss hp\n\nwhen flag clicked\nclear graphic effects\nhide\n\nwhen I receive [ghost man fight v]\nwait (1) seconds\ngo to x: (-180) y: (91)\nset size to (250) %\ngo to [front v] layer\nshow\nset [color v] effect to (23)\nset [brightness v] effect to (0)\nswitch costume to (hpbar15 v)\nrepeat (14)\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]\nrepeat (3)\n    set [brightness v] effect to (100)\n    wait (.1) seconds\n    set [color v] effect to (23)\n    set [brightness v] effect to (0)\n    wait (.1) seconds\nend\n\nwhen I receive [bossdmg v]\nnext costume\n\nwhen I receive [kill v]\nstop [other scripts in sprite v]\nwait (1) seconds\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nwhen I receive [die v]\nhide\n\n@GHOST WALL\n\nwhen I receive [setup v]\nshow\nset size to (200) %\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nswitch costume to (costume1 v)\nCreate\nhide\n\ndefine Create\nswitch costume to (ghost v)\nset [level_y v] to [0]\nset [level_x v] to [0]\nrepeat (6)\n    create clone of (_myself_ v)\n    change [level_y v] by (-416)\n    next costume\nend\nchange [level_y v] by (416)\nswitch costume to (costume3 v)\nrepeat (20)\n    change [level_x v] by (500)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I receive [level loop v]\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)) ) > [600]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [330]>> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I start as a clone\nforever\n    set [brightness v] effect to (0)\n    repeat (5)\n        change [brightness v] effect by (5)\n    end\n    repeat (5)\n        change [brightness v] effect by (-5)\n    end\nend\n\nwhen I start as a clone\nrepeat (10)\n    go to [front v] layer\nend\n\n@enemies\n\nwhen flag clicked\nhide\n\nwhen I receive [teleportin v]\ndelete this clone\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 receive [nextsectiom v]\ndelete this clone\n\nwhen I start as a clone\nshow\nif <<(costume [number v]) = [46]> or <<(costume [number v]) = [11]> or <(costume [number v]) = [67]>>> then\n    set rotation style [left-right v]\n    forever\n        point towards (mega man v)\n    end\nend\nif <<(costume [number v]) = [42]> or <<(costume [number v]) = [33]> or <(costume [number v]) = [51]>>> then\n    wait (.05) seconds\n    if <([x position v] of [mega man v]) < (x position)> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\nend\nif <(costume [number v]) = [49]> then\n    wait (.05) seconds\n    forever\n        if <(x position) < ([x position v] of [mega man v])> then\n            point in direction (90)\n        else\n            point in direction (-90)\n        end\n    end\nend\nif <(costume [number v]) = [58]> then\n    wait until <<touching color (#66fff4)?> or <<touching color (#fcd8a8)?> or <touching (flame sword projectile v)?>>>\n    switch costume to (exp1 v)\n    broadcast (Fortressdoorexplosion\ v)\n    stop [other scripts in sprite v]\n    repeat (7)\n        wait (.01) seconds\n        start sound [Mega Man 5 SFX \(11\)2 v]\n        next costume\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [42]> then\n    set [hp v] to [4]\n    forever\n        wait (.1) seconds\n        switch costume to (heli3 v)\n        wait (.1) seconds\n        next costume\n    end\nend\nif <(costume [number v]) = [46]> then\n    set [hp v] to [3]\n    forever\n        wait (.1) seconds\n        switch costume to (met1 v)\n        wait (.1) seconds\n        next costume\n        wait (.1) seconds\n        next costume\n    end\nend\nif <(costume [number v]) = [49]> then\n    set [hp v] to [5]\nend\nif <(costume [number v]) = [51]> then\n    set [hp v] to [9]\nend\nif <(costume [number v]) = [58]> then\n    set [hp v] to [99]\nend\nif <(costume [number v]) = [11]> then\n    if <(HARD MODE?) = [1]> then\n        set [hp v] to [3]\n    else\n        set [hp v] to [1]\n    end\nend\nif <(costume [number v]) = [67]> then\n    if <(HARD MODE?) = [1]> then\n        set [hp v] to [8]\n    else\n        set [hp v] to [5]\n    end\nend\n\nwhen I receive [die v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(ENEMY ONSCREEN?) = [1]> then\n        if <(costume [number v]) = [57]> then\n            if <touching (hitbox v)?> then\n                broadcast (Heal v)\n                delete this clone\n            end\n        else\n            wait until <<touching color (#66fff4)?> or <<touching color (#fcd8a8)?> or <touching (flame sword projectile v)?>>>\n            if <(costume [number v]) = [11]> then\n                start sound [cling v]\n                wait (.05) seconds\n            else\n                change [hp v] by (-1)\n                if <(HP) < [1]> then\n                    stop [other scripts in sprite v]\n                    start sound [Mega Man 5 SFX \(6\) v]\n                    switch costume to (expl1 v)\n                    repeat (2)\n                        set x to ((Level_X) - (Scroll X))\n                        set y to ((Level_Y) - (Scroll Y))\n                        wait (.1) seconds\n                        next costume\n                    end\n                    set x to ((Level_X) - (Scroll X))\n                    set y to ((Level_Y) - (Scroll Y))\n                    wait (.2) seconds\n                    delete this clone\n                else\n                    start sound [Mega Man 5 SFX \(2\) v]\n                    set [brightness v] effect to (100)\n                    wait (.1) seconds\n                    clear graphic effects\n                    wait (.1) seconds\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [16]> then\n    wait (.3) seconds\n    repeat (5)\n        start sound [Mega Man 5 SFX \(9\) v]\n    end\nend\n\nset [projectile name v] to [drop]\nset [proj x v] to (x position)\nset [proj y v] to (y position)\nset [proj direction v] to (direction)\nbroadcast (CREATE PROJECTILE v)\nwait (.3) seconds\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [11]> then\n        forever\n            wait until <touching (hitbox v)?>\n            broadcast (KNOCKBACK v)\n            wait (.3) seconds\n            change [health v] by (2)\n            broadcast (TAKE DMG v)\n        end\n    end\n    if <(costume [number v]) = [16]> then\n        forever\n            wait until <touching (hitbox v)?>\n            broadcast (KNOCKBACK v)\n            wait (.3) seconds\n            change [health v] by (3)\n            broadcast (TAKE DMG v)\n        end\n    end\n    if <(costume [number v]) = [20]> then\n        forever\n            wait until <touching (hitbox v)?>\n            broadcast (KNOCKBACK v)\n            wait (.3) seconds\n            change [health v] by (3)\n            broadcast (TAKE DMG v)\n        end\n    end\n    if <(costume [number v]) = [30]> then\n        forever\n            wait until <touching (hitbox v)?>\n            if <(ENEMY ONSCREEN?) = [1]> then\n                change [health v] by (3)\n                broadcast (TAKE DMG v)\n                wait (1) seconds\n            end\n        end\n    end\n    if <(costume [number v]) = [28]> then\n        forever\n            wait until <touching (hitbox v)?>\n            broadcast (KNOCKBACK v)\n            wait (.3) seconds\n            change [health v] by (1)\n            broadcast (TAKE DMG v)\n        end\n    end\n    if <(costume [number v]) = [33]> then\n        forever\n            wait until <touching (hitbox v)?>\n            broadcast (KNOCKBACK v)\n            wait (.3) seconds\n            change [health v] by (2)\n            broadcast (TAKE DMG v)\n        end\n    end\n    if <(costume [number v]) = [35]> then\n        forever\n            wait until <touching (hitbox v)?>\n            broadcast (KNOCKBACK v)\n            wait (.3) seconds\n            change [health v] by (4)\n            broadcast (TAKE DMG v)\n        end\n    end\n    if <(costume [number v]) = [40]> then\n        forever\n            wait until <touching (hitbox v)?>\n            broadcast (KNOCKBACK v)\n            wait (.3) seconds\n            change [health v] by (1)\n            broadcast (TAKE DMG v)\n        end\n    end\n    if <(costume [number v]) = [51]> then\n        forever\n            wait until <touching (hitbox v)?>\n            broadcast (KNOCKBACK v)\n            wait (.3) seconds\n            change [health v] by (3)\n            broadcast (TAKE DMG v)\n        end\n    end\n    if <(costume [number v]) = [67]> then\n        forever\n            wait until <touching (hitbox v)?>\n            broadcast (KNOCKBACK v)\n            wait (.3) seconds\n            change [health v] by (2)\n            broadcast (TAKE DMG v)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [20]> then\n    wait (1) seconds\n    wait until <(x position) < [-231]>\n    delete this clone\nend\n\nwhen I receive [sectiondown v]\ndelete this clone\n\nwhen I receive [sectiondownprogress v]\ndelete this clone\n\nwhen I receive [sectionup v]\ndelete this clone\n\nif <<(costume [number v]) > [29]> and <(costume [number v]) < [33]>> then\n    play sound [cling v] until done\nelse\n    if <<not <(costume [number v]) = [11]>> and <not <(costume [number v]) = [12]>>> then\n        change [hp v] by (-1)\n    end\nend\n\nwhen I receive [teleportin v]\nwait (2) seconds\nwait (.02) seconds\nCreate Enemy [met] [-25] [-565]\nwait (.02) seconds\nCreate Enemy [met1] [-115] [-930]\nwait (.02) seconds\nCreate Enemy [met] [-50] [-1775]\nwait (.02) seconds\nCreate Enemy [bone1] [200] [-2015]\nwait (.02) seconds\nCreate Enemy [bone1] [865] [-2040]\nwait (.02) seconds\nCreate Enemy [met] [1227] [-2000]\nwait (.02) seconds\nCreate Enemy [met] [1830] [-2128]\nwait (.02) seconds\nCreate Enemy [bone1] [2622] [-2163]\nwait (.02) seconds\nCreate Enemy [bone1] [3785] [-2100]\nwait (.02) seconds\nCreate Enemy [energy] [4324] [-2185]\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 start as a clone\nif <(costume [number v]) = [51]> then\n    forever\n        switch costume to (stomp v)\n        wait (3) seconds\n        if <(ENEMY ONSCREEN?) = [1]> then\n            start sound [Mega Man 5 SFX \(5\) v]\n            switch costume to (stomp2 v)\n            repeat (5)\n                change [level_y v] by (18)\n            end\n            repeat (5)\n                change [level_y v] by (10)\n            end\n            repeat (5)\n                change [level_y v] by (2)\n            end\n            repeat (5)\n                change [level_y v] by (-2)\n            end\n            repeat (5)\n                change [level_y v] by (-10)\n            end\n            repeat (5)\n                change [level_y v] by (-18)\n            end\n            start sound [super-stomp v]\n            repeat (4)\n                next costume\n                wait (.1) seconds\n            end\n            switch costume to (stomp v)\n        end\n    end\nend\nif <(costume [number v]) = [49]> then\n    forever\n        switch costume to (sniper v)\n        wait (.5) seconds\n        wait until <(distance to [hitbox v]) < [200]>\n        if <(ENEMY ONSCREEN?) = [1]> then\n            switch costume to (joe9 v)\n            repeat (1)\n                start sound [Mega Man 5 SFX \(9\) v]\n                set [projectile name v] to [bomb]\n                set [proj x v] to (Level_X)\n                set [proj y v] to (Level_Y)\n                set [proj direction v] to (direction)\n                broadcast (CREATE PROJECTILE v)\n                wait (.5) seconds\n                switch costume to (sniper v)\n                wait (1) seconds\n            end\n        end\n    end\nend\nif <(costume [number v]) = [33]> then\n    forever\n        repeat until <(distance to [mega man v]) < [150]>\n            if <(direction) = [90]> then\n                change [level_x v] by (-5)\n            else\n                change [level_x v] by (5)\n            end\n        end\n        repeat (4)\n            start sound [Mega Man 5 SFX \(9\) v]\n            set [projectile name v] to [missile]\n            set [proj x v] to (Level_X)\n            set [proj y v] to ((Level_Y) + (-15))\n            set [proj direction v] to [180]\n            broadcast (CREATE PROJECTILE v)\n            repeat (4)\n                if <(direction) = [90]> then\n                    change [level_x v] by (-5)\n                else\n                    change [level_x v] by (5)\n                end\n            end\n        end\n        repeat (400)\n            if <(direction) = [90]> then\n                change [level_x v] by (-5)\n            else\n                change [level_x v] by (5)\n            end\n        end\n    end\nend\nif <(costume [number v]) = [46]> then\n    forever\n        if <(HARD MODE?) = [1]> then\n            wait (1) seconds\n            wait until <(distance to [hitbox v]) < [250]>\n            if <(ENEMY ONSCREEN?) = [1]> then\n                start sound [Mega Man 5 SFX \(9\) v]\n                set [projectile name v] to [bullet]\n                set [proj x v] to (Level_X)\n                set [proj y v] to (Level_Y)\n                set [proj direction v] to (direction)\n                broadcast (CREATE PROJECTILE v)\n            end\n        else\n            wait (2) seconds\n            wait until <(distance to [hitbox v]) < [200]>\n            if <(ENEMY ONSCREEN?) = [1]> then\n                start sound [Mega Man 5 SFX \(9\) v]\n                set [projectile name v] to [bullet]\n                set [proj x v] to (Level_X)\n                set [proj y v] to (Level_Y)\n                set [proj direction v] to (direction)\n                broadcast (CREATE PROJECTILE v)\n            end\n        end\n    end\nend\nif <(costume [number v]) = [42]> then\n    forever\n        repeat (20)\n            if <(direction) = [90]> then\n                change [level_x v] by (-5)\n            else\n                change [level_x v] by (5)\n            end\n        end\n        if <(ENEMY ONSCREEN?) = [1]> then\n            start sound [Mega Man 5 SFX \(11\) v]\n            set [projectile name v] to [helishot2]\n            if <(direction) = [90]> then\n                set [proj x v] to ((Level_X) + (-15))\n            else\n                set [proj x v] to ((Level_X) + (15))\n            end\n            set [proj y v] to ((Level_Y) + (-15))\n            if <(direction) = [90]> then\n                set [proj direction v] to [-120]\n            else\n                set [proj direction v] to [120]\n            end\n            broadcast (CREATE PROJECTILE v)\n        end\n    end\nend\nif <(costume [number v]) = [67]> then\n    forever\n        wait (.5) seconds\n        switch costume to (bone2 v)\n        if <(ENEMY ONSCREEN?) = [1]> then\n            if <(HARD MODE?) = [1]> then\n                if <(distance to [mega man v]) < [250]> then\n                    switch costume to (bone2 v)\n                    wait (.1) seconds\n                    switch costume to (bone3 v)\n                    wait (.1) seconds\n                    switch costume to (bone1 v)\n                    wait (.1) seconds\n                    start sound [Mega Man 5 SFX \(11\)2 v]\n                    set [projectile name v] to [skull]\n                    set [proj x v] to (Level_X)\n                    set [proj y v] to (Level_Y)\n                    set [proj direction v] to (direction)\n                    broadcast (CREATE PROJECTILE v)\n                    wait (.02) seconds\n                    set [projectile name v] to [skull]\n                    set [proj x v] to (Level_X)\n                    set [proj y v] to (Level_Y)\n                    set [proj direction v] to ((direction) + (-20))\n                    broadcast (CREATE PROJECTILE v)\n                    wait (.02) seconds\n                    start sound [Mega Man 5 SFX \(11\)2 v]\n                    set [projectile name v] to [skull]\n                    set [proj x v] to (Level_X)\n                    set [proj y v] to (Level_Y)\n                    set [proj direction v] to ((direction) + (20))\n                    broadcast (CREATE PROJECTILE v)\n                    wait (.5) seconds\n                end\n            else\n                if <(distance to [mega man v]) < [250]> then\n                    switch costume to (bone2 v)\n                    wait (.1) seconds\n                    switch costume to (bone3 v)\n                    wait (.1) seconds\n                    switch costume to (bone1 v)\n                    wait (.1) seconds\n                    start sound [Mega Man 5 SFX \(11\)2 v]\n                    set [projectile name v] to [skull]\n                    set [proj x v] to (Level_X)\n                    set [proj y v] to (Level_Y)\n                    set [proj direction v] to (direction)\n                    broadcast (CREATE PROJECTILE v)\n                    wait (.02) seconds\n                    switch costume to (bone2 v)\n                    wait (.1) seconds\n                    switch costume to (bone3 v)\n                    wait (.1) seconds\n                    switch costume to (bone1 v)\n                    wait (.1) seconds\n                    start sound [Mega Man 5 SFX \(11\)2 v]\n                    set [projectile name v] to [skull]\n                    set [proj x v] to (Level_X)\n                    set [proj y v] to (Level_Y)\n                    set [proj direction v] to ((direction) + (-20))\n                    broadcast (CREATE PROJECTILE v)\n                    wait (.02) seconds\n                    switch costume to (bone2 v)\n                    wait (.1) seconds\n                    switch costume to (bone3 v)\n                    wait (.1) seconds\n                    switch costume to (bone1 v)\n                    wait (.1) seconds\n                    start sound [Mega Man 5 SFX \(11\)2 v]\n                    set [projectile name v] to [skull]\n                    set [proj x v] to (Level_X)\n                    set [proj y v] to (Level_Y)\n                    set [proj direction v] to ((direction) + (20))\n                    broadcast (CREATE PROJECTILE v)\n                    wait (.5) seconds\n                end\n            end\n        end\n    end\nend\nif <(costume [number v]) = [11]> then\n    forever\n        wait (.5) seconds\n        if <(ENEMY ONSCREEN?) = [1]> then\n            if <(distance to [mega man v]) < [150]> then\n                switch costume to (met v)\n                wait (.1) seconds\n                switch costume to (met2 v)\n                wait (.1) seconds\n                switch costume to (met3 v)\n                wait (.1) seconds\n                start sound [Mega Man 5 SFX \(9\) v]\n                set [projectile name v] to [bullet]\n                set [proj x v] to (Level_X)\n                set [proj y v] to (Level_Y)\n                set [proj direction v] to (direction)\n                broadcast (CREATE PROJECTILE v)\n                wait (.02) seconds\n                set [projectile name v] to [bullet]\n                set [proj x v] to (Level_X)\n                set [proj y v] to (Level_Y)\n                set [proj direction v] to ((direction) + (-45))\n                broadcast (CREATE PROJECTILE v)\n                wait (.02) seconds\n                set [projectile name v] to [bullet]\n                set [proj x v] to (Level_X)\n                set [proj y v] to (Level_Y)\n                set [proj direction v] to ((direction) + (45))\n                broadcast (CREATE PROJECTILE v)\n                switch costume to (met3 v)\n                wait (.1) seconds\n                switch costume to (met2 v)\n                wait (.1) seconds\n                switch costume to (met v)\n                wait (.1) seconds\n            end\n        end\n    end\nend\nif <(costume [number v]) = [46]> then\n    forever\n        wait (2) seconds\n        if <(ENEMY ONSCREEN?) = [1]> then\n            start sound [Mega Man 5 SFX \(9\) v]\n            set [projectile name v] to [bullet]\n            set [proj x v] to (Level_X)\n            set [proj y v] to (Level_Y)\n            set [proj direction v] to (direction)\n            broadcast (CREATE PROJECTILE v)\n        end\n    end\nend\nif <(costume [number v]) = [30]> then\n    forever\n        set [y v] to [0]\n        set [level_y v] to [-200]\n        repeat (20)\n            change [y v] by (.5)\n            change [level_y v] by (y)\n        end\n        repeat (60)\n            change [y v] by (-.5)\n            change [level_y v] by (y)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [16]> then\n    set [x v] to [0]\n    set [y v] to [0]\n    repeat (15)\n        change x by (x)\n        change y by (y)\n        change [y v] by (-.2)\n        change [x v] by (-.5)\n    end\n    repeat (15)\n        change x by (x)\n        change y by (y)\n        change [y v] by (.2)\n        change [x v] by (-.2)\n    end\n    repeat until <(x position) < [-245]>\n        change x by (x)\n        change y by (y)\n        change [y v] by (.2)\n        change [x v] by (-.2)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [30]> then\n    forever\n        wait (.1) seconds\n        next costume\n        wait (.1) seconds\n        next costume\n        wait (.1) seconds\n        switch costume to (spike v)\n    end\nend\nif <(costume [number v]) = [33]> then\n    forever\n        wait (.1) seconds\n        next costume\n        wait (.1) seconds\n        switch costume to (aerial v)\n    end\nend\nif <(costume [number v]) = [40]> then\n    forever\n        wait (.1) seconds\n        next costume\n        wait (.1) seconds\n        switch costume to (rounder v)\n    end\nend\n\nrepeat (3)\n\nwhen I receive [blink v]\ndelete this clone\n\nwhen flag clicked\nset [brightness v] effect to (15)\n\nwait (.05) seconds\nCreate Enemy [sniper] [1212] [-1070]\nwait (.05) seconds\nCreate Enemy [sniper] [1814] [-1040]\nwait (.05) seconds\nCreate Enemy [sniper] [2600] [-1070]\n\nwhen I receive [teleportin v]\ndelete this clone\n\nwhen I receive [fortressdoorexplosion\ v]\nwait (.2) seconds\nif <(costume [number v]) = [58]> then\n    repeat (7)\n        wait (.01) seconds\n        start sound [Mega Man 5 SFX \(11\)2 v]\n        next costume\n    end\n    delete this clone\nend\n\nwhen I receive [teleportin v]\ndelete this clone\n\nif <not <(CHECKPOINT #) = [2]>> then\n    Create Enemy [sniper] [503] [-110]\n    wait (.02) seconds\n    Create Enemy [spike] [950] [-200]\n    wait (.02) seconds\n    Create Enemy [spike] [1150] [-200]\n    wait (.02) seconds\n    Create Enemy [sniper] [1500] [-110]\n    wait (.02) seconds\n    Create Enemy [sniper] [2500] [-33]\n    wait (.02) seconds\n    Create Enemy [spike] [2975] [-200]\n    wait (.02) seconds\n    Create Enemy [spike] [3150] [-200]\n    wait (.02) seconds\n    Create Enemy [spike] [3300] [-200]\n    wait (.02) seconds\n    Create Enemy [bomb] [3715] [-40]\n    wait (.02) seconds\n    Create Enemy [bomb] [3715] [20]\nend\nwait (.02) seconds\nCreate Enemy [sniper] [5590] [0]\nwait (.02) seconds\nCreate Enemy [sniper] [5590] [-88]\nwait (.02) seconds\nCreate Enemy [sniper] [7213] [31]\nwait (.02) seconds\nCreate Enemy [energy] [6150] [-95]\nwait (.02) seconds\nCreate Enemy [met] [7000] [-43]\nwait (.02) seconds\nCreate Enemy [met] [6464] [-100]\nwait (.02) seconds\nCreate Enemy [met1] [8000] [31]\nwait (.02) seconds\nCreate Enemy [met1] [8900] [-50]\nwait (.02) seconds\nCreate Enemy [met] [9504] [-35]\n\nwhen I start as a clone\nif <(costume [number v]) = [46]> then\n    forever\n        repeat (5)\n            change [level_y v] by (2)\n        end\n        repeat (5)\n            change [level_y v] by (5)\n        end\n        repeat (5)\n            change [level_y v] by (8)\n        end\n        repeat (5)\n            change [level_y v] by (-8)\n        end\n        repeat (5)\n            change [level_y v] by (-5)\n        end\n        repeat (5)\n            change [level_y v] by (-2)\n        end\n    end\nend\n\nwait (.02) seconds\nCreate Enemy [met1] [135] [-1190]\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]\nset [blow up v] to [0]\ngo to [front v] layer\nif <(costume [number v]) = [9]> then\n    go to [front v] layer\n    point in direction (90)\n    set rotation style [left-right v]\n    repeat (2)\n        wait (.1) seconds\n        next costume\n    end\n    wait (.1) seconds\n    delete this clone\nend\nif <(costume [number v]) = [39]> then\n    start sound [Mega Man 5 SFX \(11\)2 v]\n    point in direction (PROJ DIRECTION)\n    set rotation style [left-right v]\n    repeat until <<touching (_edge_ v)?> or <touching (hitbox v)?>>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (12)))\n        set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (12)))\n    end\n    if <touching (hitbox v)?> then\n        change [health v] by (1)\n        broadcast (TAKE DMG v)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [27]> then\n    start sound [Mega Man 5 SFX \(11\)2 v]\n    point in direction (PROJ DIRECTION)\n    set rotation style [left-right v]\n    repeat until <<touching (ground v)?> or <touching (hitbox v)?>>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (7)))\n        set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (7)))\n    end\n    set [blow up v] to [1]\n    if <touching (hitbox v)?> then\n        change [health v] by (1)\n        broadcast (TAKE DMG v)\n    end\nend\nif <(costume [number v]) = [35]> then\n    point in direction (PROJ DIRECTION)\n    set rotation style [left-right v]\n    repeat until <<touching (_edge_ v)?> or <touching (hitbox v)?>>\n        if <(HARD MODE?) = [1]> then\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)))\n            if <(Scroll X) < [4533]> then\n                turn right (-2) degrees\n            end\n        else\n            set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (8)))\n            set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (8)))\n        end\n    end\n    if <touching (hitbox v)?> then\n        change [health v] by (2)\n        broadcast (TAKE DMG v)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [16]> then\n    set rotation style [left-right v]\n    repeat (5)\n        point towards (hitbox v)\n    end\n    repeat until <<touching (ground v)?> or <touching (hitbox v)?>>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (8)))\n        set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (8)))\n    end\n    set [blow up v] to [1]\n    if <touching (hitbox v)?> then\n        change [health v] by (2)\n        broadcast (TAKE DMG v)\n    end\nend\nif <(costume [number v]) = [13]> then\n    point in direction (90)\n    set rotation style [left-right v]\n    glide (1) secs to x: (-211) y: (169)\n    delete this clone\nend\nif <(costume [number v]) = [12]> then\n    point in direction (PROJ DIRECTION)\n    set rotation style [all around v]\n    start sound [Mega Man 5 SFX \(50\) v]\n    repeat until <<touching (_edge_ v)?> or <touching (hitbox v)?>>\n        move (5) steps\n    end\n    if <touching (hitbox v)?> then\n        change [health v] by (2)\n        broadcast (TAKE DMG v)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [8]> then\n    set [y v] to [0]\n    point in direction (PROJ DIRECTION)\n    set rotation style [all around v]\n    start sound [misseis-magicos v]\n    repeat (20)\n        change [y v] by (.4)\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    if <(direction) > [0]> then\n        repeat (10)\n            turn right (15) degrees\n            change [y v] by (.4)\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    else\n        repeat (10)\n            turn right (-15) degrees\n            change [y v] by (.4)\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    end\n    repeat until <<touching (ground v)?> or <touching (hitbox v)?>>\n        change [y v] by (.4)\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    start sound [Mega Man 5 SFX \(11\) v]\n    switch costume to (expl1 v)\n    repeat (2)\n        if <touching (hitbox v)?> then\n            change [health v] by (1)\n            broadcast (TAKE DMG v)\n        end\n        wait (.1) seconds\n        next costume\n    end\n    wait (.1) seconds\n    delete this clone\nend\nif <(costume [number v]) = [3]> then\n    point in direction (PROJ DIRECTION)\n    set rotation style [left-right v]\n    repeat until <touching (hitbox v)?>\n        set [level_x v] to ((Level_X) + (([sin v] of (direction) ) * (8)))\n        set [level_y v] to ((Level_Y) + (([cos v] of (direction) ) * (8)))\n    end\n    if <touching (hitbox v)?> then\n        change [health v] by (1)\n        broadcast (TAKE DMG v)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [7]> then\n    point in direction (PROJ DIRECTION)\n    set rotation style [left-right v]\n    repeat until <<touching (_edge_ v)?> or <touching (hitbox v)?>>\n        move (10) steps\n    end\n    if <touching (hitbox v)?> then\n        change [health v] by (4)\n        broadcast (TAKE DMG v)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [14]> then\n    point in direction (PROJ DIRECTION)\n    set rotation style [left-right v]\n    repeat until <<touching (_edge_ v)?> or <touching (hitbox v)?>>\n        move (5) steps\n    end\n    if <touching (hitbox v)?> then\n        change [health v] by (1)\n        broadcast (TAKE DMG v)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [15]> then\n    point in direction (PROJ DIRECTION)\n    set rotation style [left-right v]\n    repeat until <touching (hitbox v)?>\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)))\n    end\n    if <touching (hitbox v)?> then\n        change [health v] by (2)\n        broadcast (TAKE DMG v)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [5]> then\n    point in direction (PROJ DIRECTION)\n    set rotation style [left-right v]\n    repeat until <touching (hitbox v)?>\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)))\n    end\n    if <touching (hitbox v)?> then\n        change [health v] by (1)\n        broadcast (TAKE DMG v)\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)) ) > [250]> or <([abs v] of ((Level_Y) - (Scroll Y)) ) > [200]>> then\n        hide\n        delete this clone\n    else\n        show\n    end\nend\n\nchange y by (-5)\n\nwhen I start as a clone\nset [internal timer v] to [0]\nrepeat until <(internal timer) > [3]>\n    wait (1) seconds\n    change [internal timer v] by (1)\nend\ndelete this clone\n\nwhen I start as a clone\nif <(costume [number v]) = [16]> then\n    wait (.05) seconds\n    repeat until <(blow up) = [1]>\n        switch costume to (bomb v)\n        repeat (2)\n            wait (.1) seconds\n            next costume\n        end\n        wait (.1) seconds\n    end\n    switch costume to (exp1 v)\n    start sound [Mega Man 5 SFX \(11\)2 v]\n    repeat (7)\n        wait (.01) seconds\n        next costume\n    end\n    delete this clone\nend\nif <(costume [number v]) = [27]> then\n    wait (.05) seconds\n    repeat until <(blow up) = [1]>\n        switch costume to (grenade v)\n        repeat (7)\n            wait (.02) seconds\n            next costume\n        end\n        wait (.02) seconds\n    end\n    switch costume to (expl1 v)\n    start sound [Mega Man 5 SFX \(11\) v]\n    repeat (2)\n        wait (.01) seconds\n        next costume\n    end\n    delete this clone\nend\nif <(costume [number v]) = [35]> then\n    forever\n        wait (.02) seconds\n        switch costume to (skull3 v)\n        wait (.02) seconds\n        switch costume to (skull4 v)\n        wait (.02) seconds\n        switch costume to (skull2 v)\n        wait (.02) seconds\n        switch costume to (skull v)\n    end\nend\n\nwhen I receive [teleportin v]\ndelete this clone\n\n@toenail2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nswitch costume to (costume6 v)\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [yay v]\nwait (2) seconds\nif <(HARD MODE?) = [0]> then\n    switch costume to (after hardmode v)\n    set [hard mode? v] to [1]\nelse\n    switch costume to (pre hardmode v)\nend\nset [ghost v] effect to (100)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\ngo to [front v] layer\nshow\nforever\n    go to x: ((mouse x) / (30)) y: ((mouse y) / (30))\nend\n\nset [hard mode? v] to [0]\n\n@lightning\n\nwhen flag clicked\nset size to (150) %\nhide\n\nwhen I receive [game start v]\nforever\n    wait (1) seconds\n    if <not <(Scroll X) > [4533]>> then\n        go to (random position v)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\ngo to [back v] layer\nset size to (pick random (150) to (200)) %\nset y to (pick random (50) to (150))\nif <<(Scroll Y) > [-100]> or <(Scroll X) > [4233]>> then\n    start sound [thunder v]\nend\nswitch costume to (thunder1 v)\nshow\nrepeat (4)\n    wait (.1) seconds\n    next costume\nend\nrepeat (4)\n    change [ghost v] effect by (25)\nend\nwait (.1) seconds\ndelete this clone\n\n
------------------------Instructions------------------------\n\n- Arrow keys or WASD to move\n\n- Space bar to shoot or charge your shot\n\n- Press the Down Arrow or S to enter Ghost Mode,\n  where you can phase through laser walls. Shooting\n  your blaster will deactivate it\n\n- Press Z to use your Flame Sword, which is effective\n  against many enemies\n\n- Mobile supported as well\n\n-------------------------------------------------------------\n\nBreak into the diabolical Ghost Man's fortress, while fighting off undead enemies, and bypassing the defenses, with a showdown against the evil leader himself.\n\n\n-------------------------Credits-------------------------\n\nAll credit goes to Capcom, the creator of Mega Man.\n\nStage and boss were made completely by me\n\nIntro music is Take on Me by a-ha\n\nMusic is Super Mario World Ghost House, Zero theme, Duel of the Fates, and William Tell Overture.\n