Marshall (a platform game)

Instructions: ALL LEVELS ARE POSSIBLE.\nArrow keys - Move Marshall

@Stage\n\nwhen I receive [next level v]\nchange [level# v] by (1)\nnext backdrop\n\nwhen flag clicked\nwait (5) seconds\nwait until <([background # v] of [_stage_ v]) = [28]>\nstop all sounds\nhide variable [seconds until destruction v]\nset [sound playing? v] to [duh]\nplay sound [Ending v] until done\nstop [all v]\n\nwhen flag clicked\nwait (5) seconds\nwait until <([background # v] of [_stage_ v]) = [27]>\nstop all sounds\nrepeat until <(Seconds Until Destruction) = [0]>\n    play sound [Final Boss v] until done\nend\n\nwhen flag clicked\nswitch backdrop to (title screen v)\n\nwhen I receive [go v]\nset [level# v] to [1]\nswitch backdrop to (screen1 v)\nrepeat until <([background # v] of [_stage_ v]) = [27]>\n    play sound [Music v] until done\nend\n\n@Title\n\nwhen flag clicked\ngo to x: (0) y: (139)\nshow\nforever\n    if <(sound playing?) = [0]> then\n        repeat (15)\n            change y by (-2)\n            wait (0.005) seconds\n        end\n        repeat (15)\n            change y by (2)\n            wait (0.005) seconds\n        end\n    else\n        go to x: (0) y: (139)\n    end\nend\n\nwhen I receive [go v]\nhide\n\nwhen flag clicked\nforever\n    if <(sound playing?) = [1]> then\n        go to x: (0) y: (139)\n    end\nend\n\nwhen I receive [go v]\n\n@Bushes\n\nwhen I receive [go v]\nhide\n\nwhen flag clicked\nshow\nset size to (877) %\ngo to x: (5) y: (-83)\n\n@Button\n\nwhen flag clicked\nset [sound playing? v] to [0]\nshow\ngo to x: (5) y: (-30)\nswitch costume to (costume1 v)\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen this sprite clicked\nset [sound playing? v] to [1]\nplay sound [Select v] until done\nhide\nbroadcast (Go v)\n\n@Marshall\n\nwhen I receive [go v]\nwait (0.02) seconds\nshow\nforever\n    if <(x position) > [235]> then\n        go to x: (-220) y: (118)\n        broadcast (Next level v)\n    end\n    if <<touching color (#310063)?> or <touching color (#8400ff)?>> then\n        set [y-velocity v] to [12.5]\n    end\n    if <(y position) < [-173]> then\n        change [lives v] by (-1)\n        go to x: (-220) y: (118)\n    end\n    if <touching (alien v)?> then\n        change [lives v] by (-1)\n        go to x: (-220) y: (118)\n    end\nend\n\nwhen flag clicked\nforever\n    if <([background # v] of [_stage_ v]) = [28]> then\n        hide\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (-220) y: (118)\nswitch costume to (marshall v)\nset [y-velocity v] to [0]\nset [can go? v] to [0]\nclear graphic effects\n\nwhen I receive [go v]\nwait (0.02) seconds\nshow\nforever\n    if <<key (right arrow v) pressed?> and <(Can go?) = [1]>> then\n        point in direction (90)\n        change x by (4)\n    end\n    if <<key (left arrow v) pressed?> and <(Can go?) = [1]>> then\n        point in direction (-90)\n        change x by (-4)\n    end\nend\n\nwhen I receive [go v]\nwait (0.02) seconds\nshow\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        switch costume to (goright1 v)\n        wait (0.05) seconds\n        switch costume to (goright2 v)\n        wait (0.05) seconds\n        switch costume to (goright3 v)\n        wait until <not <key (right arrow v) pressed?>>\n        switch costume to (goright2 v)\n        wait (0.05) seconds\n        switch costume to (goright1 v)\n        wait (0.05) seconds\n        switch costume to (marshall v)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        switch costume to (goright1 v)\n        wait (0.05) seconds\n        switch costume to (goright2 v)\n        wait (0.05) seconds\n        switch costume to (goright3 v)\n        wait until <not <key (left arrow v) pressed?>>\n        switch costume to (goright2 v)\n        wait (0.05) seconds\n        switch costume to (goright1 v)\n        wait (0.05) seconds\n        switch costume to (marshall v)\n    end\nend\n\nwhen I receive [go v]\nwait (0.02) seconds\nshow\nforever\n    if <<key (up arrow v) pressed?> and <touching color (#00ff52)?>> then\n        set [y-velocity v] to [10]\n    end\nend\n\nwhen I receive [go v]\nwait (0.02) seconds\nshow\nforever\n    change y by (Y-Velocity)\n    if <touching color (#00ff52)?> then\n        set [y-velocity v] to [1]\n    else\n        change [y-velocity v] by (-0.4)\n    end\n    if <touching color (#ff0000)?> then\n        change [lives v] by (-1)\n        go to x: (-220) y: (118)\n    end\nend\n\nwhen I receive [game over v]\nhide\n\n@Sensor\n\nwhen flag clicked\nshow\nset [ghost v] effect to (99)\nswitch costume to (sensor v)\nset [can go? v] to [0]\nclear graphic effects\nforever\n    go to (marshall v)\n    point in direction ([direction v] of [marshall v])\n    set [ghost v] effect to (99)\n    next costume\nend\n\nwhen I receive [go v]\nforever\n    if <touching color (#633900)?> then\n        set [can go? v] to [0]\n    else\n        set [can go? v] to [1]\n    end\nend\n\n@Lives\n\nwhen flag clicked\nforever\n    if <(sound playing?) = [duh]> then\n        hide\n    end\nend\n\nwhen I receive [go v]\nshow\n\nwhen flag clicked\nswitch costume to (full v)\nhide\nset [lives v] to [5]\nforever\n    if <(Lives) = [5]> then\n        switch costume to (full v)\n    end\n    if <(Lives) = [4]> then\n        switch costume to (four v)\n    end\n    if <(Lives) = [3]> then\n        switch costume to (three v)\n    end\n    if <(Lives) = [2]> then\n        switch costume to (two v)\n    end\n    if <(Lives) = [1]> then\n        switch costume to (one v)\n    end\nend\n\nwhen flag clicked\nwait until <(Lives) = [0]>\nhide\nbroadcast (Game over v)\nwait (0.1) seconds\nstop [all v]\n\n@Obst1\n\nwhen flag clicked\nforever\n    if <([background # v] of [_stage_ v]) = [11]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [go v]\nwait until <([background # v] of [_stage_ v]) = [11]>\nshow\nforever\n    glide (2) secs to x: (117) y: (131)\n    glide (2) secs to x: (117) y: (3)\nend\n\nwhen flag clicked\ngo to x: (117) y: (3)\nhide\n\n@Game Over\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [game over v]\nshow\nstop [all v]\n\n@Plat1\n\nwhen flag clicked\ngo to x: (-19) y: (114)\nhide\n\nwhen I receive [go v]\nwait until <([background # v] of [_stage_ v]) = [23]>\nshow\nforever\n    set [ghost v] effect to (100)\n    wait (1.5) seconds\n    repeat (33.3)\n        change [ghost v] effect by (-3)\n    end\n    set [ghost v] effect to (0)\n    wait (1.5) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\n\nwhen flag clicked\nforever\n    if <([background # v] of [_stage_ v]) = [23]> then\n        show\n    else\n        hide\n    end\nend\n\n@Barrier\n\nwhen flag clicked\nhide variable [seconds until destruction v]\nset [seconds until destruction v] to [30]\ngo to x: (7) y: (1)\nhide\nwait (1) seconds\nwait until <([background # v] of [_stage_ v]) = [27]>\nshow\nwait until <(Seconds Until Destruction) = [0]>\nhide\n\n@Alien\n\nwhen flag clicked\nwait (5) seconds\nwait until <([background # v] of [_stage_ v]) = [27]>\nshow variable [seconds until destruction v]\nshow\nsay [Muahaha, Marshall!] for (3) seconds\nsay [I kidnapped your brother, Hershel!] for (2.5) seconds\nsay [You were looking for him, well too bad!] for (3) seconds\nsay [FACE MY WRATH!] for (2) seconds\nbroadcast (Message appear v)\nrepeat (30)\n    change [seconds until destruction v] by (-1)\n    wait (1) seconds\nend\nhide variable [can go? v]\nswitch costume to (alien2 v)\nwait (0.5) seconds\nhide\n\nwhen I receive [message appear v]\nrepeat until <(Seconds Until Destruction) < [1]>\n    glide (2) secs to x: (-166) y: (-96)\n    glide (2) secs to x: (12) y: (-60)\n    glide (2) secs to x: (163) y: (-101)\n    glide (2) secs to x: (0) y: (0)\nend\ngo to x: (0) y: (0)\n\nwhen flag clicked\nswitch costume to (alien1 v)\ngo to x: (0) y: (0)\nhide\n\n@Sprite1\n\nwhen I receive [message appear v]\nshow\nwait (3) seconds\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n