Motion Blocks | A Scrolling Platformer

Instructions: « Motion Blocks | A Scrolling Platformer »\n\n»Instructions«\n- WASD, Arrow Keys or Mobile to move\n- The Flags are checkpoints\n- Get to the end :)\n\n»Notes«\n- Trending!!! Thanks so much everyone!\n- Also an entry for @chipm0nk's contest\n- 10+ hours of work\n- All blocks made by me in SVE\n- Support and feedback appreciated\n- Please do not advertise!\n- If this gets 50 loves I will make a sequel!\n- @StratfordJames Loved!!!!!\n\n»Credits«\n- All art and blocks made by me @-Invert- in SVE\n- griffpatch for scrolling engine\n- TheFatRat for music\n\n»Tags«\n#Scrolling #Platformer #games #all #chipm0nk @-invert- #griffpatch #awesome #scratch #vector #editor #motion #blocks #are #cool #why #do #you #not #follow #me #now #thanks #for #playing

@Stage\n\n@Player\n\ndefine Game - Win\nset rotation style [all around v]\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\nclear graphic effects\nset rotation style [left-right v]\n\ndefine Game - Die\nset [exit? v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\nend\nwait (0.5) seconds\n\nwhen flag clicked\nset size to (100) %\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(Exit?) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(Exit?) = [Win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\ndefine Game On\nset rotation style [left-right v]\nset [x v] to (Checkpoint X)\nset [y v] to (Checkpoint Y)\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air? v] to [0]\nset [exit? v] to []\nset size to (100) %\nshow\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<<mouse down?> and <(x position) > (mouse x)>> and <(distance to [mouse-pointer v]) > [20]>>>> then\n    Change Player x by [-8]\n    point in direction (-90)\nend\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<<mouse down?> and <(mouse x) > (x position)>> and <(distance to [mouse-pointer v]) > [20]>>>> then\n    Change Player x by [8]\n    point in direction (90)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<key (up arrow v) pressed?> or <<key (space v) pressed?> or <<key (w v) pressed?> or <<<mouse down?> and <(mouse y) > (y position)>> and <(distance to [mouse-pointer v]) > [20]>>>>> then\n    if <(In air?) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y by (sy)\nPosition\nset [scroll x v] to (X)\nif <(Scroll X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((Y) - (Scroll Y)) / (10)))\nif <(Scroll Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(Y) < [-180]> then\n    set [exit? v] to [die]\nend\nif <touching (danger v)?> then\n    set [exit? v] to [die]\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air? v] by (1)\nPosition\nrepeat until <not <touching (platforms2 v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air? v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platforms2 v)?> then\n    repeat (15)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms2 v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<key (up arrow v) pressed?> or <<key (space v) pressed?> or <<key (w v) pressed?> or <<<mouse down?> and <(mouse y) > (y position)>> and <(distance to [mouse-pointer v]) > [20]>>>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air? v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms2 v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\nwhen flag clicked\nset [checkpoint x v] to [0]\nset [checkpoint y v] to [0]\nhide\n\nwhen I receive [win v]\nset size to (1) %\nhide\nstop [other scripts in sprite v]\n\n@Checkpoint\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nGo to: ((X) - (Scroll X)) ((Y) - (Scroll Y))\nif <touching (player v)?> then\n    set [checkpoint x v] to [2600]\n    set [checkpoint y v] to [0]\nend\n\nwhen I receive [setup v]\nhide\nset [x v] to [2600]\nset [y v] to [5]\n\ndefine Go to: (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Comment\n\nwhen I receive [green flag v]\ngo to [back v] layer\nhide\n\nwhen I receive [tick v]\nposition ((X) - (Scroll X)) ((Y) - (Scroll Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [100]\nset [y v] to [0]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\n@Platforms2\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nGo to: ((x) - (Scroll X)) ((y) - (Scroll Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 1 v)\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\nClone at: [360] [0]\n\ndefine Go to: (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at: (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Comment3\n\nwhen I receive [green flag v]\ngo to [back v] layer\nhide\n\nwhen I receive [tick v]\nposition ((X) - (Scroll X)) ((Y) - (Scroll Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [6050]\nset [y v] to [75]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Comment2\n\nwhen I receive [green flag v]\ngo to [back v] layer\nhide\n\nwhen I receive [tick v]\nposition ((X) - (Scroll X)) ((Y) - (Scroll Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [5450]\nset [y v] to [50]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Checkpoint2\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nGo to: ((X) - (Scroll X)) ((Y) - (Scroll Y))\nif <touching (player v)?> then\n    set [checkpoint x v] to [4325]\n    set [checkpoint y v] to [-15]\nend\n\nwhen I receive [setup v]\ngo to [back v] layer\nhide\nset [x v] to [4325]\nset [y v] to [-25]\n\ndefine Go to: (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Danger\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nGo to: ((x) - (Scroll X)) ((y) - (Scroll Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [5760]\nset [y v] to [5]\n\ndefine Go to: (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n