Platformer Creator

Instructions: Platformer Creator \n\nUse the arrow keys to switch to a different tile\nJust use your mouse and click to place the tile\nPress "1" key to switch between editing and playing mode\nUse arrow keys/awsd keys to move the player\nTake a screenshot or something and remix this project to show off the platformer you made

@Stage\n\nwhen flag clicked\nforever\n    if <<(stage) = [editor]> and <key (1 v) pressed?>> then\n        broadcast (Start v)\n        wait until <not <key (1 v) pressed?>>\n    end\n    if <<(stage) = [playing]> and <key (1 v) pressed?>> then\n        broadcast (Editor v)\n        wait until <not <key (1 v) pressed?>>\n    end\nend\n\n@level tile\n\nwhen flag clicked\nerase all\npoint in direction (90)\nset [tile costume v] to [1]\nset size to (100) %\nbroadcast (Editor v)\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nset [stage v] to [playing]\nhide\n\nwhen I receive [editor v]\nset [stage v] to [editor]\nswitch costume to (tile costume)\nshow\nwait until <not <mouse down?>>\nforever\n    switch costume to (tile costume)\n    go to (mouse-pointer v)\n    go to x: ((round ((x position) / (24))) * (24)) y: ((round ((y position) / (24))) * (24))\n    if <mouse down?> then\n        stamp\n    end\n    if <key (right arrow v) pressed?> then\n        if <(tile costume) < [6]> then\n            change [tile costume v] by (1)\n        end\n        wait until <not <key (right arrow v) pressed?>>\n    end\n    if <key (left arrow v) pressed?> then\n        if <(tile costume) > [1]> then\n            change [tile costume v] by (-1)\n        end\n        wait until <not <key (left arrow v) pressed?>>\n    end\n    if <key (r v) pressed?> then\n        turn right (90) degrees\n        wait until <not <key (r v) pressed?>>\n    end\nend\n\n@Player\n\nwhen I receive [start v]\nset [x v] to [0]\nset [y v] to [0]\nforever\n    Physics\n    if <<<touching color (#ff4e4e)?> or <<touching color (#949494)?> or <touching color (#6b6b6b)?>>> or <(y position) < [-178]>> then\n        go to x: (0) y: (0)\n        set [x v] to [0]\n        set [y v] to [0]\n    end\nend\n\ndefine Physics\nif <touching color (#91caff)?> then\n    if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n        change [y v] by (-0.5)\n    else\n        change [y v] by (-0.2)\n    end\nelse\n    change [y v] by (-1)\nend\nset [x v] to (((<<key (right arrow v) pressed?> or <key (d v) pressed?>> + (() - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)) * (2)) + ((x) * (0.8)))\nchange x by (x)\nif <<<touching color (#599642)?> or <touching color (#426f31)?>> or <touching color (#967142)?>> then\n    change y by (1)\nend\nif <<<touching color (#599642)?> or <touching color (#426f31)?>> or <touching color (#967142)?>> then\n    change y by (1)\nend\nif <<<touching color (#599642)?> or <touching color (#426f31)?>> or <touching color (#967142)?>> then\n    change y by (1)\nend\nif <<<touching color (#599642)?> or <touching color (#426f31)?>> or <touching color (#967142)?>> then\n    change y by (1)\nend\nif <<<touching color (#599642)?> or <touching color (#426f31)?>> or <touching color (#967142)?>> then\n    change y by (-4)\n    repeat until <not <<<touching color (#599642)?> or <touching color (#426f31)?>> or <touching color (#967142)?>>>\n        change x by ((([abs v] of (x) ) / (x)) * (-1))\n    end\n    set [x v] to [0]\nend\nchange y by (y)\nif <<<touching color (#599642)?> or <touching color (#426f31)?>> or <touching color (#967142)?>> then\n    repeat until <not <<<touching color (#599642)?> or <touching color (#426f31)?>> or <touching color (#967142)?>>>\n        change y by ((([abs v] of (y) ) / (y)) * (-1))\n    end\n    set [y v] to [0]\nend\nchange y by (-1)\nif <<key (up arrow v) pressed?> or <key (v v) pressed?>> then\n    if <touching color (#91caff)?> then\n        set [y v] to [5.5]\n    else\n        if <<<touching color (#599642)?> or <touching color (#426f31)?>> or <touching color (#967142)?>> then\n            set [y v] to [14]\n        end\n    end\nend\nchange y by (1)\n\nwhen I receive [editor v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\n@TN\n\nwhen flag clicked\nforever\n    show\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n