Sky: A scrolling platformer
@Stage\n\nwhen I receive [green flag v]\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [win!!! v]\nswitch backdrop to (win!! v)\n\n@player\n\nwhen flag clicked\nshow\nset size to (80) %\nchange [☁ sv v] by (1)\nbroadcast (green flag v) and wait\nbroadcast (play game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [green flag 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    die!!!!!!!!!!!!!!!!\nend\n\ndefine Game on\nset [x v] to [0]\nset [y v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nshow\n\ndefine tick\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < [0]>>> then\n    Change x by [-8]\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > [0]>>> then\n    Change x by [8]\nend\nif <<<key (space v) pressed?> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> or <<mouse down?> and <(mouse y) > [0]>>> then\n    if <(In air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(up) = [true]> then\n    if <(In air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-2)\ncreate clone of (sprite1 v)\nChange y by (sy)\nset [scroll x v] to (x)\nposition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\ndefine Change y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nposition\nrepeat until <not <touching (platform 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 x by (sx)\nchange [x v] by (sx)\nposition\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (platform 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\ndefine die!!!!!!!!!!!!!!!!\nset [exit v] to []\nrepeat (10)\n    change size by (5)\n    change [ghost v] effect by (25)\nend\nhide\nset size to (75) %\nset [ghost v] effect to (0)\nwait (0.01) seconds\n\nwhen I receive [green flag v]\nforever\n    if <touching color (#7a60ff)?> then\n        broadcast (win!!! v)\n    end\nend\n\nwhen I receive [win!!! v]\nforever\n    hide\nend\n\nwhen I receive [green flag v]\nforever\n    if <touching color (#0200ff)?> then\n        die!!!!!!!!!!!!!!!!\n    end\nend\n\nwhen I receive [win!!! v]\nhide\n\n@Platform\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [win!!! v]\nhide\n\n@text\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [green flag v]\nreset timer\n\nwhen I receive [win!!! v]\nhide\n\nwhen flag clicked\nforever\n\n
Part 2: https://scratch.mit.edu/projects/498899333/ \n