2 Player Platformer
@Stage\n\n@Player\n\nwhen flag clicked\ngo to [back v] layer\nset [color v] effect to (0)\nswitch costume to (hello5 v)\nshow\ngo to x: (-216) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nforever\n    set size to (100) %\n    change [y v] by (-0.5)\n    if  then\n        if <[4] < (costume [number v])> then\n            change [x v] by (0.8)\n        else\n            switch costume to (hello2 v)\n            change [x v] by (0.8)\n        end\n    end\n    if  then\n        if <[4] < (costume [number v])> then\n            change [x v] by (-0.9)\n        else\n            switch costume to (hello3 v)\n            change [x v] by (-0.9)\n        end\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <<touching (level v)?> or <touching (moving platform v)?>> then\n        change y by (1)\n        if <<touching (level v)?> or <touching (moving platform v)?>> then\n            change y by (1)\n            if <<touching (level v)?> or <touching (moving platform v)?>> then\n                change y by (1)\n                if <<touching (level v)?> or <touching (moving platform v)?>> then\n                    change y by (1)\n                    if <<touching (level v)?> or <touching (moving platform v)?>> then\n                        change y by (1)\n                        if <<touching (level v)?> or <touching (moving platform v)?>> then\n                            change y by (1)\n                            if <<touching (level v)?> or <touching (moving platform v)?>> then\n                                change y by (-6)\n                                if  then\n                                    set [y v] to [0]\n                                    if <(x) > [0]> then\n                                        set [x v] to [-10]\n                                    else\n                                        set [x v] to [10]\n                                    end\n                                else\n                                    change x by ((x) * (-1))\n                                    set [x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <<touching (level v)?> or <touching (moving platform v)?>> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-0.5)\n    if <<<touching (level v)?> or <touching (moving platform v)?>> and > then\n        if <[4] < (costume [number v])> then\n            set [y v] to [12]\n        else\n            set [y v] to [9]\n        end\n    end\n    change y by (0.5)\n    if <<touching (spikes v)?> or <<touching (saw1 v)?> or <<[-175] > (y position)> or <<touching (moving spikes v)?> or >>>> then\n        broadcast (Restart v)\n        wait until <not <<touching (spikes v)?> or <<touching (saw1 v)?> or <<[-175] > (y position)> or <<touching (moving spikes v)?> or >>>>>\n    end\nend\n\nwhen flag clicked\n\ndefine Reset\nset [x v] to [0]\nset [yv v] to [0]\nset [y v] to [0]\ngo to x: (-216) y: (-50)\nshow\n\nwhen I receive [restart v]\nReset\nchange [deaths v] by (1)\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (0.01) seconds\nend\nrepeat (10)\n    set [ghost v] effect to (0)\nend\nshow\n\nwhen I receive [next level v]\nReset\n\nwhen flag clicked\nforever\n    broadcast (Tick v)\n    if <<touching (trampoline v)?> or <<touching (trampoline v)?> or <<touching (trampoline3 v)?> or <touching (trampoline4 v)?>>>> then\n        set [y v] to [12]\n    end\n    if <touching (zoom v)?> then\n        change [x v] by (5)\n    end\n    if <<touching (buttons v)?> and <<key (up arrow v) pressed?> or >> then\n        set [y v] to [7]\n    end\n    if <<key (down arrow v) pressed?> or > then\n        switch costume to (player2 v)\n    else\n        switch costume to (player v)\n    end\nend\n\n@Level\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (costume1 v)\nrepeat (10)\n    go to x: (0) y: (0)\n    set size to (90) %\n    go to [front v] layer\n    show\nend\nforever\n    switch costume to (LEVEL)\nend\n\nwhen I receive [next level v]\nchange [level v] by (1)\n\n@Player2\n\ndefine Reset\nset [x v] to [0]\nset [yv v] to [0]\nset [y v] to [0]\ngo to x: (-180) y: (-50)\nshow\n\nwhen I receive [restart v]\nReset\nrepeat (10)\n    change [ghost v] effect by (10)\n    wait (0.01) seconds\nend\nrepeat (10)\n    set [ghost v] effect to (0)\nend\n\nwhen I receive [next level v]\nReset\n\nwhen flag clicked\ngo to [back v] layer\nset [color v] effect to (0)\nswitch costume to (hello5 v)\nshow\ngo to x: (-180) y: (0)\nset [x v] to [0]\nset [y v] to [0]\n\nwhen I receive [tick v]\nif <<touching (trampoline v)?> or <<touching (trampoline v)?> or <<touching (trampoline3 v)?> or <touching (trampoline4 v)?>>>> then\n    set [y v] to [12]\nend\nif <touching (zoom v)?> then\n    change [x v] by (5)\nend\nif <<touching (buttons v)?> and < or <<key (w v) pressed?> or >>> then\n    set [y v] to [7]\nend\nif < or <<key (s v) pressed?> or >> then\n    switch costume to (player2 v)\nelse\n    switch costume to (player v)\nend\n\nwhen I receive [tick v]\nforever\n    change [y v] by (-0.5)\n    if <key (d v) pressed?> then\n        if <[4] < (costume [number v])> then\n            change [x v] by (0.8)\n        else\n            switch costume to (hello2 v)\n            change [x v] by (0.8)\n        end\n    end\n    if  then\n        if <[4] < (costume [number v])> then\n            change [x v] by (-0.9)\n        else\n            switch costume to (hello3 v)\n            change [x v] by (-0.9)\n        end\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <<touching (level v)?> or <touching (moving platform v)?>> then\n        change y by (1)\n        if <<touching (level v)?> or <touching (moving platform v)?>> then\n            change y by (1)\n            if <<touching (level v)?> or <touching (moving platform v)?>> then\n                change y by (1)\n                if <<touching (level v)?> or <touching (moving platform v)?>> then\n                    change y by (1)\n                    if <<touching (level v)?> or <touching (moving platform v)?>> then\n                        change y by (1)\n                        if <<touching (level v)?> or <touching (moving platform v)?>> then\n                            change y by (1)\n                            if <<touching (level v)?> or <touching (moving platform v)?>> then\n                                change y by (-6)\n                                if  then\n                                    set [y v] to [0]\n                                    if <(x) > [0]> then\n                                        set [x v] to [-10]\n                                    else\n                                        set [x v] to [10]\n                                    end\n                                else\n                                    change x by ((x) * (-1))\n                                    set [x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <<touching (level v)?> or <touching (moving platform v)?>> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-0.5)\n    if <<<touching (level v)?> or <touching (moving platform v)?>> and <key (w v) pressed?>> then\n        if <[4] < (costume [number v])> then\n            set [y v] to [12]\n        else\n            set [y v] to [9]\n        end\n    end\n    change y by (0.5)\n    if <<touching (spikes v)?> or <<touching (saw1 v)?> or <<[-175] > (y position)> or <<touching (moving spikes v)?> or >>>> then\n        broadcast (Restart v)\n        wait until <not <<touching (spikes v)?> or <<touching (saw1 v)?> or <<[-175] > (y position)> or <<touching (moving spikes v)?> or >>>>>\n    end\nend\n\nshow\n\n@portal\n\nwhen [timer v] > (0.1)\nhide\n\nwhen flag clicked\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nshow\nrepeat (10)\n    go to [front v] layer\nend\nforever\n    turn right (3) degrees\nend\n\nwhen flag clicked\nrepeat (10)\n    clear graphic effects\nend\nforever\n    show\n    if <(LEVEL) = [1]> then\n        go to x: (200) y: (-40)\n    end\n    if <(LEVEL) = [2]> then\n        go to x: (200) y: (-50)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nshow\nrepeat (10)\n    go to [front v] layer\nend\nforever\n    turn left (3) degrees\nend\n\nwhen I start as a clone\nrepeat (10)\n    clear graphic effects\nend\nforever\n    show\n    if <(LEVEL) = [1]> then\n        go to x: (200) y: (-40)\n    end\n    if <(LEVEL) = [2]> then\n        go to x: (200) y: (-50)\n    end\nend\n\nwhen I receive [tick v]\nif <<touching (player2 v)?> and <touching (player v)?>> then\n    broadcast (Next Level v)\nend\n\n@Buttons\n\nwhen I receive [tick v]\nset [button? v] to [0]\ngo to x: (0) y: (0)\nif <(LEVEL) = [1]> then\n    show\n    if <<touching (player2 v)?> or <touching (player v)?>> then\n        if <(Button?) = [0]> then\n            change y by (-5)\n            set [button? v] to [1]\n            wait until <not <<touching (player v)?> or <touching (player2 v)?>>>\n        else\n            change y by (5)\n            set [button? v] to [0]\n            wait until <not <<touching (player v)?> or <touching (player2 v)?>>>\n        end\n    end\nelse\n    hide\nend\n\n@Saw1\n\nwhen flag clicked\nforever\n    turn right (6) degrees\nend\n\nwhen flag clicked\nshow\nforever\n    switch costume to (LEVEL)\nend\n\nwhen flag clicked\nforever\n    if <(Button?) = [1]> then\n        hide\n    else\n        show\n    end\n    if <(LEVEL) = [1]> then\n        go to x: (20) y: (-70)\n    else\n        hide\n    end\nend\n\nif <(LEVEL) = [1]> then\n    go to x: (20) y: (-70)\nelse\n    hide\nend\n\nif <(LEVEL) = [1]> then\n    go to x: (20) y: (-70)\nelse\n    hide\nend\n\n@Spikes\n\nwhen flag clicked\nshow\nforever\n    switch costume to (LEVEL)\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [2]> then\n        go to x: (20) y: (-70)\n    end\n    if <(Button?) = [1]> then\n        hide\n    else\n        show\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\n\n
Mean comments will be removed, but helpful feedback will be considered.\na or left arrow key to go left\nd or right arrow key to go right\nw or up arrow key to jump\ns or down arrow key to crouch