Marshall 3

Instructions: Instructions in-game\nDesigned by WithOnions\nMusic and sound effects by LordAndrew\n

@Stage\n\nwhen flag clicked\nstart sound [Title v]\nswitch backdrop to (title screen v)\n\nwhen I receive [next v]\nnext backdrop\n\nwhen I receive [begin v]\nswitch backdrop to (level1 v)\nrepeat until <([background # v] of [_stage_ v]) = [21]>\n    play sound [Music v] until done\nend\n\nwhen flag clicked\nwait (0.01) seconds\nwait until <([background # v] of [_stage_ v]) = [21]>\nstop all sounds\n\nwhen flag clicked\nwait (0.01) seconds\nwait until <([background # v] of [_stage_ v]) = [22]>\nswitch backdrop to (ending1 v)\nwait (3) seconds\nswitch backdrop to (ending2 v)\nwait (3) seconds\nswitch backdrop to (ending3 v)\n\nwhen flag clicked\nwait (0.01) seconds\nwait until <([background # v] of [_stage_ v]) = [22]>\nplay sound [Ending v] until done\nstop [all v]\n\n@Title\n\nwhen I receive [begin v]\nhide\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\ngo to x: (-4) y: (75)\nwait (0.5) seconds\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (0.5) seconds\nbroadcast (appr v)\n\n@Three\n\nwhen I receive [begin v]\nhide\n\nwhen I receive [appr v]\nshow\nrepeat until <(size) > [100]>\n    turn right (18) degrees\n    change size by (1)\nend\nset size to (100) %\npoint in direction (90)\nwait (2) seconds\nbroadcast (appr2 v)\n\nwhen flag clicked\ngo to x: (6) y: (29)\nhide\nset size to (1) %\npoint in direction (90)\n\n@Button\n\nwhen this sprite clicked\nstart sound [Button v]\nhide\nbroadcast (Begin v)\n\nwhen I receive [appr2 v]\nshow\n\nwhen flag clicked\ngo to x: (7) y: (-80)\nhide\n\nwhen flag clicked\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\n@Marshall\n\nwhen I receive [begin v]\nshow\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <(Can go?) = [1]>> then\n        point in direction (90)\n        move (4) steps\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <(Can go?) = [1]>> then\n        point in direction (-90)\n        move (4) steps\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <not <color (#ffff00) is touching (#00ff52)?>> then\n        change [falling speed v] by (-0.3)\n        change y by (falling speed)\n    else\n        change y by (1)\n        set [falling speed v] to [0]\n    end\nend\n\nwhen flag clicked\nset size to (100) %\nset [falling speed v] to [0]\nset [jumping v] to [0]\nswitch costume to (marshall v)\ngo to x: (-219) y: (-101)\npoint in direction (90)\nhide\n\nwhen I receive [begin v]\nforever\n    if <([x position v] of [marshall v]) > [228]> then\n        broadcast (Next v)\n        go to x: (-219) y: (-112)\n        point in direction (90)\n    end\n    if <<touching color (#f80000)?> and <not <([background # v] of [_stage_ v]) > [21]>>> then\n        start sound [Hit v]\n        change [lives v] by (-1)\n        go to x: (-219) y: (-112)\n        point in direction (90)\n        say [Ouch!] for (2) seconds\n    end\n    if <<(y position) < [-170]> and <not <([background # v] of [_stage_ v]) > [21]>>> then\n        start sound [Hit v]\n        change [lives v] by (-1)\n        go to x: (-219) y: (-112)\n        point in direction (90)\n        say [Whoa!] for (2) seconds\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        start sound [Jump v]\n        set [jumping v] to [1]\n        repeat (4)\n            if <(jumping) = [1]> then\n                change [falling speed v] by (2.2)\n                change y by (falling speed)\n            end\n        end\n        wait until <color (#ffff00) is touching (#00ff52)?>\n        set [jumping v] to [0]\n    end\nend\n\nwhen I receive [begin v]\ngo to [front v] layer\nshow\nforever\n    if <<key (right arrow v) pressed?> or <key (d 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?> or <key (d 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?> or <key (a 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?> or <key (a 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 [begin v]\nwait until <<([background # v] of [_stage_ v]) = [21]> and <touching color (#ffff00)?>>\nbroadcast (Next v)\nhide\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [begin v]\nforever\n    if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n        set size to (100) %\n        repeat (10)\n            change size by (-5)\n        end\n        repeat until <not <<key (down arrow v) pressed?> or <key (s v) pressed?>>>\n            set size to (50) %\n        end\n        repeat (10)\n            change size by (5)\n        end\n        set size to (100) %\n    end\nend\n\n@SensorM\n\nwhen flag clicked\nhide variable [can go? v]\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    if <key (down arrow v) pressed?> then\n        switch costume to (smallsensor v)\n        switch costume to (smallsensor2 v)\n    else\n        switch costume to (sensor v)\n        switch costume to (sensor2 v)\n    end\nend\n\nwhen I receive [begin 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\nwhen I receive [begin v]\nforever\n    if <key (down arrow v) pressed?> then\n        repeat until <not <key (down arrow v) pressed?>>\n            switch costume to (smallsensor v)\n        end\n        switch costume to (sensor v)\n    end\nend\n\n@HitheadM\n\nwhen I receive [begin v]\nshow\nset [ghost v] effect to (99)\nforever\n    if <key (down arrow v) pressed?> then\n        repeat until <not <key (down arrow v) pressed?>>\n            switch costume to (marshall1 v)\n        end\n        switch costume to (marshall v)\n    end\nend\n\nwhen I receive [begin v]\nshow\nset [ghost v] effect to (99)\nforever\n    if <touching color (#633900)?> then\n        if <(jumping) = [1]> then\n            set [jumping v] to [0]\n            set [falling speed v] to [-1]\n        end\n    else\n    end\nend\n\nwhen I receive [begin v]\nshow\nset [ghost v] effect to (99)\nforever\n    go to (marshall v)\n    point in direction ([direction v] of [marshall v])\nend\n\nwhen flag clicked\nhide\n\n@Live-0-Meter\n\nwhen flag clicked\nwait (1) seconds\nwait until <(lives) = [0]>\nset [can go? v] to [dead]\nhide\n\nwhen I receive [begin v]\nshow\nforever\n    if <(lives) = [5]> then\n        switch costume to (five 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\nset [lives v] to [5]\ngo to x: (199) y: (145)\nhide\n\nwhen flag clicked\nwait (1) seconds\nwait until <([background # v] of [_stage_ v]) = [22]>\nhide\n\n@Platform1\n\nwhen flag clicked\ngo to x: (-65) y: (-4)\nhide\nforever\n    if <([background # v] of [_stage_ v]) = [12]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (-65) y: (-4)\nhide\nforever\n    glide (2) secs to x: (27) y: (-4)\n    glide (2) secs to x: (-65) y: (-4)\nend\n\n@Platform2\n\nwhen flag clicked\ngo to x: (177) y: (-43)\nhide\nforever\n    if <([background # v] of [_stage_ v]) = [12]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (177) y: (-43)\nhide\nforever\n    glide (2) secs to x: (177) y: (34)\n    glide (2) secs to x: (177) y: (-43)\nend\n\n@Life1\n\nwhen flag clicked\nforever\n    if <([background # v] of [_stage_ v]) = [9]> then\n        hide\n    end\nend\n\nwhen flag clicked\nwait (0.01) seconds\nwait until <([background # v] of [_stage_ v]) = [8]>\nshow\nwait until <touching (marshall v)?>\nif <(lives) = [5]> then\n    start sound [Health v]\n    hide\nelse\n    change [lives v] by (1)\n    start sound [Health v]\n    hide\nend\n\nwhen flag clicked\ngo to x: (167) y: (-123)\nhide\nforever\n    repeat (4)\n        change y by (-1)\n        wait (0.05) seconds\n    end\n    repeat (4)\n        change y by (1)\n        wait (0.05) seconds\n    end\nend\n\n@Life2\n\nwhen flag clicked\nforever\n    if <([background # v] of [_stage_ v]) = [14]> then\n        hide\n    end\nend\n\nwhen flag clicked\nwait (0.01) seconds\nwait until <([background # v] of [_stage_ v]) = [13]>\nshow\nwait until <touching (marshall v)?>\nif <(lives) = [5]> then\n    start sound [Health v]\n    hide\nelse\n    change [lives v] by (1)\n    start sound [Health v]\n    hide\nend\n\nwhen flag clicked\ngo to x: (-62) y: (-48)\nhide\nforever\n    repeat (4)\n        change y by (-1)\n        wait (0.05) seconds\n    end\n    repeat (4)\n        change y by (1)\n        wait (0.05) seconds\n    end\nend\n\n@Platform3\n\nwhen flag clicked\ngo to x: (177) y: (-43)\nhide\nforever\n    if <([background # v] of [_stage_ v]) = [17]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (-59) y: (131)\nhide\nforever\n    glide (2) secs to x: (116) y: (131)\n    glide (2) secs to x: (-59) y: (131)\nend\n\n@Life3\n\nwhen flag clicked\nforever\n    if <([background # v] of [_stage_ v]) = [18]> then\n        hide\n    end\nend\n\nwhen flag clicked\nwait (0.01) seconds\nwait until <([background # v] of [_stage_ v]) = [17]>\nshow\nwait until <touching (marshall v)?>\nif <(lives) = [5]> then\n    start sound [Health v]\n    hide\nelse\n    change [lives v] by (1)\n    start sound [Health v]\n    hide\nend\n\nwhen flag clicked\ngo to x: (-92) y: (-118)\nhide\nforever\n    repeat (4)\n        change y by (-1)\n        wait (0.05) seconds\n    end\n    repeat (4)\n        change y by (1)\n        wait (0.05) seconds\n    end\nend\n\n@Text\n\nwhen flag clicked\nswitch costume to (tee v)\ngo to x: (8) y: (139)\nhide\nwait (0.01) seconds\nwait until <([background # v] of [_stage_ v]) = [24]>\nwait (5) seconds\nshow\nrepeat until <([costume # v] of [text v]) = [1]>\n    wait (1) seconds\n    next costume\nend\nswitch costume to (full v)\nwait (2) seconds\nrepeat until <touching (_edge_ v)?>\n    change y by (-1)\nend\nhide\nwait (2) seconds\nbroadcast (appr3 v)\n\n@Double\n\nwhen flag clicked\nset size to (300) %\nhide\n\nwhen I receive [appr3 v]\nset [ghost v] effect to (100)\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nwait (1) seconds\nsay [See you next time!]\n\n@Game Over\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nwait (0.01) seconds\nwait until <(lives) = [0]>\nshow\ngo to [front v] layer\nshow\ngo to [front v] layer\nstop [all v]\n\n