Infinite Platformer!

Instructions: Arrow keys to move. Avoid red. Bounce on purple, and press s to skip the level!\n\nSometimes a level is impossible, but I did my best to try to eliminate that.

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop v)\nforever\n    play sound [Alan Walker - Fade.mp3 v] until done\nend\n\n@player\n\nwhen flag clicked\ngo to x: (-214) y: (115)\nswitch costume to (costume1 v)\nshow\ngo to x: (-177) y: (12)\nhide variable [y v]\nhide variable [x v]\nset [y v] to [0]\nset [x v] to [0]\nforever\n    change [y v] by (-1)\n    if <key (left arrow v) pressed?> then\n        change [x v] by (-1)\n    end\n    if <key (right arrow v) pressed?> then\n        change [x v] by (1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching color (#7fd891)?> then\n        change y by (1)\n    end\n    if <touching color (#7fd891)?> then\n        change y by (1)\n    end\n    if <touching color (#7fd891)?> then\n        change y by (1)\n    end\n    if <touching color (#7fd891)?> then\n        change y by (1)\n    end\n    if <touching color (#7fd891)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <key (up arrow v) pressed?> then\n            set [y v] to [17]\n            if <(x) > [0]> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching color (#7fd891)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<key (up arrow v) pressed?> and <touching color (#7fd891)?>> then\n        set [y v] to [12]\n    end\n    change y by (1)\n    if <touching color (#ff0000)?> then\n        change [deaths v] by (1)\n        go to x: (-177) y: (12)\n    end\n    if <(x position) > [222]> then\n        go to x: (-217) y: (-20)\n        broadcast (generate v)\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <key (s v) pressed?> then\n        go to x: (-217) y: (-20)\n        broadcast (generate v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#bf5dff)?> then\n        set [y v] to [20]\n    end\nend\n\nwhen [right arrow v] key pressed\npoint in direction (90)\n\nwhen [left arrow v] key pressed\npoint in direction (-179)\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset size to (70) %\nswitch costume to (costume2 v)\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\ndelete this clone\n\n@trees\n\nwhen flag clicked\nhide\nbroadcast (generate v)\n\nwhen I receive [generate v]\nrepeat (pick random (0) to (4))\n    set size to (pick random (50) to (150)) %\n    go to x: (pick random (-182) to (270)) y: (-39)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [back v] layer\nshow\n\nwhen I receive [generate v]\ndelete this clone\n\n@ground\n\n@rocks\n\nwhen flag clicked\nhide\n\nwhen I receive [generate v]\ndelete this clone\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (1) layers\nshow\n\nwhen I receive [generate v]\nrepeat (pick random (0) to (2))\n    set size to (pick random (50) to (100)) %\n    go to x: (pick random (-182) to (270)) y: (-60)\n    create clone of (_myself_ v)\nend\n\n@spikes\n\nwhen I receive [generate v]\nrepeat (pick random (0) to (7))\n    go to x: (pick random (-94) to (270)) y: (-73)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [generate v]\nrepeat (3)\n    delete this clone\nend\n\nwhen flag clicked\nhide\n\n@platforms\n\nwhen I receive [generate v]\nrepeat (pick random (0) to (2))\n    go to x: (pick random (-94) to (270)) y: (pick random (-40) to (38))\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [generate v]\ndelete this clone\n\nwhen flag clicked\nhide\n\n@platforms2\n\nwhen I receive [generate v]\nrepeat (pick random (0) to (2))\n    switch costume to (pick random (1) to (4))\n    go to x: (pick random (-36) to (270)) y: (-18)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [generate v]\ndelete this clone\n\nwhen flag clicked\nhide\n\n@bounce\n\nwhen I receive [generate v]\nrepeat (pick random (0) to (2))\n    go to x: (pick random (-72) to (261)) y: (-94)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [generate v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <<color (#daa3ff) is touching (#7fd891)?> or <color (#daa3ff) is touching (#ff0000)?>> then\n    delete this clone\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\n