ADVENTURE | -a scrolling platformer-

Instructions: Check Out My New Platformer Sequel   \nPart 1  (https://scratch.mit.edu/projects/415010189/)\nPart 2  (https://scratch.mit.edu/projects/417126652/)\n\nAfter Somehow 2 Weeks Of Working Finally Made A Scrolling Platformer Because Everybody Prefer Scrolling Than Non-Scrolling So This Was Challenging To Make.                \n(Hope U Like It) \n\nINSTRUCTIONS :-\n* Arrow Keys, WASD, Mobile Controls\n* Avoid Spikes And Lava\n* Get To The End!!\n* Like And Star This Project        :-)\n\n\nMORE STUFF :-\n* This Got 4th Place On @corpcooga Contest.   Yaaay\n* Loved By @0014049 \n\n\nCREDITS:-\n@griffpatch For The Engine\n@-PandaMC- For The Trees And Signs\n\n\nTAGS:-\n#ADVENTURE#a#scrolling#platformer#Games#Art#Best\n\nHave Fun!        Mahdi Out   (-_-)

@Stage\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\n\nwhen flag clicked\nforever\n    play sound [Alan Walker - Nebula \(New Song 2019\) v] until done\nend\n\n@Player\n\nwhen flag clicked\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 [play game v]\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    Game - 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?> then\n    switch costume to (left v)\n    Change Player x by [-10]\nend\nif <key (right arrow v) pressed?> then\n    switch costume to (right v)\n    Change Player x by [10]\nend\nif <key (up arrow v) pressed?> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n        start sound [Jump v]\n    end\nend\nchange [sy v] by (-2)\nChange Player y by (sy)\nTest - Die\nset [scroll x v] to (x)\nset [scroll y v] to (y)\nPosition\nif <(y) < [-180]> 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 (platforms 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 (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (platforms 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 Game - Die\nbroadcast (Die Animation v)\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine Test - Die\nif <touching (danger v)?> then\n    start sound [Crunch v]\n    set [exit v] to [die]\nend\n\n@Platforms\n\nwhen I receive [green flag v]\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 [0]\nset [y v] to [0]\nswitch costume to (level 1 v)\nClone at x: [575] y: [0]\nClone at x: [575] y: [0]\nClone at x: [448] y: [0]\nClone at x: [600] y: [0]\nClone at x: [719] y: [0]\nClone at x: [575] y: [0]\nClone at x: [575] y: [0]\nClone at x: [585] y: [0]\nClone at x: [700] y: [-40]\nClone at x: [1075] y: [0]\nClone at x: [575] y: [0]\nClone at x: [575] y: [-50]\nClone at x: [575] y: [0]\nClone at x: [575] y: [0]\nClone at x: [600] y: [0]\nClone at x: [1200] y: [0]\nClone at x: [960] y: [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\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Decorations\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 v)\nClone at x: [0] y: [0]\nClone at x: [575] y: [0]\nClone at x: [1150] y: [0]\nClone at x: [1600] y: [0]\nClone at x: [2200] y: [0]\nClone at x: [2935] y: [0]\nClone at x: [3500] y: [0]\nClone at x: [4000] y: [0]\nClone at x: [4600] y: [0]\nClone at x: [5400] y: [0]\nClone at x: [6415] y: [0]\nClone at x: [7700] y: [0]\nClone at x: [8500] y: [0]\nClone at x: [9460] y: [0]\nClone at x: [11000] y: [0]\nset [x v] to [-99999]\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\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\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]\nposition ((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 (level 1 v)\nClone at x: [575] y: [0]\nClone at x: [575] y: [0]\nClone at x: [430] y: [0]\nClone at x: [619] y: [0]\nClone at x: [700] y: [0]\nClone at x: [500] y: [0]\nClone at x: [600] y: [0]\nClone at x: [350] y: [0]\nClone at x: [860] y: [0]\nClone at x: [500] y: [0]\nClone at x: [900] y: [0]\nClone at x: [850] y: [0]\nClone at x: [950] y: [0]\nClone at x: [900] y: [0]\nClone at x: [1000] y: [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\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Game BackG\n\nwhen flag clicked\nshow\ngo to x: (0) y: (20)\ngo to [back v] layer\nset [ghost v] effect to (50)\n\nwhen [timer v] > (0.0001)\nhide\n\n@Die Animation\n\nwhen flag clicked\nhide\n\nwhen I receive [die animation v]\nshow\nwait (1.5) seconds\nhide\n\n@TN\n\nwhen flag clicked\nswitch backdrop to (weather v)\ngo to x: (0) y: (200)\nhide\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.0001)\nswitch backdrop to (outro v)\nshow\nglide (.3) secs to x: (0) y: (0)\nforever\n    play sound [Alan Walker - Play \(Lyrics\) ft v] until done\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n