Scrolling Platformer Tutorial
@Stage\n\n@Ground\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\nset [landclone id v] to [0]\nset [scrollx v] to [0]\nset [scrolly v] to [0]\nforever\n    change [landclone id v] by (1)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\nforever\n    if <(LandClone ID) = [1]> then\n        forever\n            go to x: ((ScrollX) + (0)) y: ((ScrollY) + (0))\n            show\n        end\n    end\n    if <(LandClone ID) = [2]> then\n        forever\n            go to x: ((ScrollX) + (370)) y: ((ScrollY) + (0))\n            show\n        end\n    end\n    if <(LandClone ID) = [3]> then\n        forever\n            go to x: ((ScrollX) + (740)) y: ((ScrollY) + (0))\n            show\n        end\n    end\n    if <(LandClone ID) = [4]> then\n        forever\n            go to x: ((ScrollX) + (1110)) y: ((ScrollY) + (0))\n            show\n        end\n    end\n    if <(LandClone ID) = [5]> then\n        forever\n            go to x: ((ScrollX) + (1480)) y: ((ScrollY) + (0))\n            show\n        end\n    end\n    if <(LandClone ID) = [6]> then\n        forever\n            go to x: ((ScrollX) + (1850)) y: ((ScrollY) + (0))\n            show\n        end\n    end\n    if <(LandClone ID) = [7]> then\n        forever\n            go to x: ((ScrollX) + (2220)) y: ((ScrollY) + (0))\n            show\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (left arrow v) pressed?> then\n        if <(Velocity) < [5]> then\n            change [velocity v] by (1)\n        end\n    else\n        if <[0] < (Velocity)> then\n            change [velocity v] by (-1)\n            wait (0.01) seconds\n        end\n    end\n    if <key (right arrow v) pressed?> then\n        if <[-5] < (Velocity)> then\n            change [velocity v] by (-1)\n        end\n    else\n        if <(Velocity) < [0]> then\n            change [velocity v] by (1)\n            wait (0.01) seconds\n        end\n    end\n    change [scrollx v] by (Velocity)\nend\n\nwhen flag clicked\nforever\n    change [scrolly v] by (Gravity)\nend\n\n@Player\n\nwhen flag clicked\nset [gravity v] to [0]\nset [velocity v] to [0]\nforever\n    if <touching color (#66ff77)?> then\n        set [gravity v] to [0]\n        if <key (up arrow v) pressed?> then\n            change [gravity v] by (-13)\n        end\n    else\n        if <not <key (space v) pressed?>> then\n            repeat until <touching color (#66ff77)?>\n                change [gravity v] by (0.5)\n            end\n            set [gravity v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        set [gravity v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#e59c5c)?> then\n        if <(Velocity) > [0]> then\n            change [scrollx v] by (-5)\n            set [velocity v] to [-15]\n        else\n            change [scrollx v] by (5)\n            set [velocity v] to [15]\n        end\n    end\nend\n\n@Border Hide\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    show\n    set [ghost v] effect to (100)\nend\n\n
Arrows to move!\nSpace to Hover in place if you're trying to read.\nFull screen is recommended!\n\nMore Tips and Tutorials:\nhttps://scratch.mit.edu/projects/491961940/\n