Travel | A mobile scrolling platformer

Instructions: PLS READ THE INSTRUCTIONS!\n------------------------------------------------------\n-Arrow keys to move (I AM REALLY SORRY I COULDNT PUT WASD!)\n-Avoid spikes and falling down\n-Collect ALL coins to go to the next level.\n------------------------------------------------------\nYou are a traveler! You have to travel somewhere, but the journey is filled with dangerous but exciting things!

@Stage\n\nwhen I receive [green flag v]\n\nwhen flag clicked\nforever\n    play sound [Unlimited v] until done\nend\n\n@Scrolling 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\ngo to x: (0) y: (0)\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 size to (100) %\npoint in direction (90)\nset [ghost v] effect to (0)\nset [x v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [y v] to [0]\nshow\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-2.3)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [sx v] by (2.3)\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 <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-2)\nChange player y by (sy)\nTest- die\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)) / (4)))\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\n\ndefine Change player 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 player 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    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> 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 (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 Game- die\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    set [exit v] to [die]\nend\n\ndefine Game- Win\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\n\nwhen [r v] key pressed\nbroadcast (Reset v)\nwait until <not <key (r v) pressed?>>\n\n@Platform\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 [-84]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\n    Clone at x: [360] y: [300]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [180]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [430] y: [130]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [50]\n            Clone at x: [360] y: [50]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [0] y: [180]\n            Clone at x: [0] y: [180]\n            Clone at x: [0] y: [180]\n            Clone at x: [-360] y: [100]\n            Clone at x: [-360] y: [0]\n            Clone at x: [-360] y: [100]\n            Clone at x: [-360] y: [180]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\nend\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\nif <(LEVEL) = [3]> then\n    switch costume to (level 3 1 v)\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [4]> then\n        switch costume to (level 4 1 v)\n    end\nend\n\n@Collectables\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nnext costume\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (scrolling player v)?> then\n    start sound [Coin v]\n    change [collected v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [-84]\nif <(LEVEL) = [1]> then\n    switch costume to (collectable v)\n    Clone at x: [-202] y: [-24]\n    Clone at x: [64] y: [65]\n    Clone at x: [663] y: [94]\n    Clone at x: [1329] y: [167]\n    Clone at x: [1358] y: [416]\n    Clone at x: [1447] y: [416]\n    Clone at x: [1550] y: [650]\n    Clone at x: [1700] y: [650]\n    Clone at x: [1870] y: [650]\n    Clone at x: [2000] y: [650]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (collectable v)\n        Clone at x: [-190] y: [-30]\n        Clone at x: [0] y: [52]\n        Clone at x: [219] y: [-30]\n        Clone at x: [338] y: [146]\n        Clone at x: [480] y: [306]\n        Clone at x: [620] y: [466]\n        Clone at x: [1505] y: [266]\n        Clone at x: [1633] y: [436]\n        Clone at x: [1760] y: [617]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (collectable v)\n            Clone at x: [-82] y: [-20]\n            Clone at x: [216] y: [-20]\n            Clone at x: [403] y: [46]\n            Clone at x: [561] y: [110]\n            Clone at x: [776] y: [115]\n            Clone at x: [918] y: [140]\n            Clone at x: [1099] y: [176]\n            Clone at x: [1262] y: [197]\n            Clone at x: [1375] y: [225]\n            Clone at x: [1525] y: [225]\n            Clone at x: [1631] y: [113]\n            Clone at x: [1803] y: [113]\n            Clone at x: [1931] y: [796]\n            Clone at x: [1810] y: [796]\n        end\n    end\nend\nset [x v] to [-99999999999999999999]\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)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\nset [collected dispay v] to (join (COLLECTED) (join [ / ] (COLLECTED MAX)))\n\nwhen [0 v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [,] ((mouse y) + (SCROLL Y))))\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 [-84]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [100]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\n    Clone at x: [360] y: [300]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [180]\n        Clone at x: [360] y: [180]\n        Clone at x: [100] y: [180]\n        Clone at x: [180] y: [-360]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 3 2 v)\n            end\n        end\n    end\nend\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@Exit\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<touching (scrolling player v)?> and <(costume [number v]) = [2]>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [-84]\nif <(LEVEL) = [1]> then\n    switch costume to (exit closed v)\n    Clone at x: [2178] y: [588]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (exit closed v)\n        Clone at x: [1922] y: [533]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (exit closed v)\n            Clone at x: [-93] y: [960]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (exit closed v)\n                Clone at x: [99999999999999] y: [-31]\n            end\n        end\n    end\nend\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)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [open portal v]\nswitch costume to (exit closed2 v)\n\n@Decoration\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 [-84]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\n    Clone at x: [360] y: [360]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [180]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [430] y: [130]\n        Clone at x: [360] y: [360]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [50]\n            Clone at x: [360] y: [50]\n            Clone at x: [360] y: [50]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\nend\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@THUMB NAIL\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\n\n