Teamwork! A Platformer by PMFC
@Stage\n\nwhen flag clicked\nset [the level v] to [1]\nforever\n    switch backdrop to (The Level)\nend\n\nwhen flag clicked\nforever\n    play sound [Nebula v] until done\nend\n\n@Player\n\nwhen I receive [next level v]\nbroadcast (Reset v)\n\nwhen flag clicked\nset [the level v] to [1]\nbroadcast (Next Level v)\nforever\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n        change [x velocity v] by (-1.5)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x velocity v] by (1.5)\n    end\n    set [x velocity v] to ((X Velocity) * (0.85))\n    change x by (X Velocity)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((X Velocity) * (-1))\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            if <(X Velocity) > [0]> then\n                set [x velocity v] to [-10]\n            else\n                set [x velocity v] to [10]\n            end\n            set [y velocity v] to [15]\n        else\n            set [x velocity v] to [0]\n        end\n    end\n    change [y velocity v] by (-1)\n    change y by (Y Velocity)\n    if <touching (ground v)?> then\n        change y by ((Y Velocity) - ((Y Velocity) * (2)))\n        set [y velocity v] to [0]\n    end\n    change y by (-1)\n    if <<touching (ground v)?> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        set [y velocity v] to [15]\n    end\n    change y by (1)\n    if <(x position) > [239]> then\n        broadcast (Next Level v) and wait\n        change [the level v] by (1)\n    end\n    if <touching (spikes v)?> then\n        broadcast (Reset v)\n    else\n        if <touching (lava v)?> then\n            broadcast (Reset v)\n        end\n        if <touching (spikes v)?> then\n            broadcast (Reset v)\n        end\n    end\nend\n\nif <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n    switch costume to (crouch v)\nelse\n    switch costume to (player v)\nend\n\nwhen I receive [reset v]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-216) y: (40)\n\nwhen flag clicked\nforever\n    set rotation style [left-right v]\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        point in direction (90)\n    else\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n            point in direction (-90)\n        end\n    end\nend\n\n\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [backward v] (2) layers\n    if <<mouse down?> or <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>>> then\n        if <<<mouse down?> and <(mouse y) > (y position)>> or <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <key (w v) pressed?>>> then\n            switch costume to (player3 v)\n        else\n            switch costume to (player v)\n        end\n    else\n        if <<<mouse down?> and <(mouse y) > (y position)>> or <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <key (w v) pressed?>>> then\n            switch costume to (player2 v)\n        else\n            switch costume to (player4 v)\n        end\n    end\nend\n\n@Ground\n\nwhen flag clicked\nforever\n    switch costume to (The Level)\n    set [ghost v] effect to (100)\nend\n\n@Spikes\n\nwhen flag clicked\nforever\n    switch costume to (The Level)\nend\n\n@Lava\n\nwhen flag clicked\nforever\n    set y to (Magma)\n    switch costume to (The Level)\nend\n\nwhen flag clicked\nforever\n    set [magma v] to [0]\n    repeat (10)\n        change [magma v] by (1)\n    end\n    repeat (20)\n        change [magma v] by (-1)\n    end\n    repeat (10)\n        change [magma v] by (1)\n    end\nend\n\n@Ground2\n\nwhen flag clicked\nforever\n    switch costume to (The Level)\nend\n\n@Sprite1\n\nwhen flag clicked\nset [clo v] to [0]\nset [ghost v] effect to (80)\nforever\n    go to [front v] layer\n    go [backward v] (3) layers\n    set size to ((125) - ((([y position v] of [player v]) - (y position)) / (2))) %\n    go to (player v)\n    D\nend\n\ndefine D\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    change y by (-1)\n    if <<touching (_edge_ v)?> and <[-125] < (x position)>> then\n        broadcast (void v)\n    end\nend\nchange y by (-10)\n\nif <touching (_edge_ v)?> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ncreate clone of (_myself_ v)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-2)\nend\nset [ghost v] effect to (80)\n\nwhen I start as a clone\nset [clo v] to [1]\nset [ghost v] effect to (80)\nrepeat (10)\n    change size by (-5)\n    change [ghost v] effect by (2)\nend\nset [ghost v] effect to (100)\ndelete this clone\n\nchange [ghost v] effect by (10)\n\nwhen I receive [void v]\nif <(clo) = [0]> then\n    repeat (10)\n        change [ghost v] effect by (2)\n    end\n    set [ghost v] effect to (100)\n    wait until <not <<touching (_edge_ v)?> and <[-100] < (x position)>>>\n    repeat (10)\n        change [ghost v] effect by (-2)\n    end\n    set [ghost v] effect to (80)\nend\n\nset [ghost v] effect to (80)\n\nset [ghost v] effect to (80)\n\n@Sprite2\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    show\nend\n\n