How to make a platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [other v]\nnext backdrop\n\nswitch backdrop to (backdrop4 v)\n\nnext backdrop\n\nrepeat (1)\nend\nswitch backdrop to (backdrop1 v)\n\n@Sprite1\n\nwhen this sprite clicked\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nhide\n\nwhen flag clicked\ngo to [front v] layer\nshow\n\nbroadcast (message1 v)\n\n@Sprite2\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo [backward v] (2) layers\n\nwhen [space v] key pressed\nrepeat (50)\n    change [ghost v] effect by (1)\nend\nnext costume\nrepeat (50)\n    change [ghost v] effect by (-1)\nend\nshow\nwait (1) seconds\n\nwhen [space v] key pressed\n\nrepeat (50)\n    change [ghost v] effect by (1)\nend\nchange [ghost v] effect by (-50)\nnext costume\nshow\nwait (1) seconds\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [8]> then\n        wait (2) seconds\n        hide\n        broadcast (message1 v)\n    end\nend\n\n@Screenshot 2016-05-05 at 1.20.01 PM\n\nset [color v] effect to (0)\n\nchange [ghost v] effect by (-50)\nchange [ghost v] effect by (-50)\nnext costume\nshow\n\nwhen [space v] key pressed\nrepeat (50)\n    change [ghost v] effect by (1)\nend\nnext costume\nrepeat (50)\n    change [ghost v] effect by (-1)\nend\nshow\nwait (1) seconds\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [8]> then\n        wait (2) seconds\n        hide\n    end\nend\n\nwhen flag clicked\nshow\nswitch costume to (screenshot 2016-05-05 at 1.32.41 pm v)\n\n@Dog2\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [message1 v]\nforever\n    if <touching color (#ff0000)?> then\n        go to x: (-143) y: (-86)\n    end\nend\n\nwhen I receive [message1 v]\nforever\n    if <touching color (#ff00bf)?> then\n        broadcast (other v)\n        go to x: (-143) y: (-86)\n    end\nend\n\ngo to x: (-158) y: (-101)\n\nwhen I receive [message1 v]\nshow\nforever\n    if <not <touching color (#666666)?>> then\n        change y by (-2)\n    end\nend\n\nwhen I receive [message1 v]\nforever\n    switch costume to (dog2-a v)\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        move (4.6) steps\n    end\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        move (4.6) steps\n    end\nend\n\nwhen I receive [message1 v]\nforever\n    forever\n        if <<touching color (#666666)?> and <key (up arrow v) pressed?>> then\n            set [gravity v] to [7]\n            change y by (gravity)\n            repeat until <<touching color (#666666)?> or <touching color (#ec1c2c)?>>\n                change [gravity v] by (-0.2)\n                change y by (gravity)\n            end\n        end\n    end\nend\n\n
space for next step