Wonderful Platformer (Mobile Friendly)

Instructions: New endless game! > https://scratch.mit.edu/projects/892702701\n(update 3.5)\n9rds holds the 17 ( first 6 levels) world record \nUse your arrow keys or tap to move!\nNew Game: Dodge Things 2 ↓\nhttps://scratch.mit.edu/projects/892702701/\n\nHelp:\n\nLevel difficult? Click "Skip" and the level should switch to the next one.\n\nGame lagging?\nQuit Fullscreen mode.\nRemove clouds (world record will not work)\nTurbоwrар runs this project a lot better.

@Stage\n\nwhen flag clicked\nforever\n    play sound (pick random (1) to (4)) until done\nend\n\nplay sound [bensound-littleidea v] until done\n\n@player\n\nwhen flag clicked\nset [my variable v] to [0]\nforever\n    if <<touching (spikes v)?> or <touching (lava v)?>> then\n        set [my variable v] to [1]\n        set x to (-217)\n        set y to (0)\n        set [my variable v] to [0]\n        switch costume to (right v)\n        change [deaths v] by (1)\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen flag clicked\nforever\n    if <(y position) < [-183]> then\n        set x to (-217)\n    end\nend\n\nwhen flag clicked\ngo to x: (-215) y: (-3)\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    change [y v] by (-1)\n    if <not <(my variable) = [1]>> then\n        if <<key (left arrow v) pressed?> or <<mouse down?> and <<(x position) > (mouse x)> and <not <(touching ui) = [1]>>>>> then\n            change [x v] by (-1)\n            switch costume to (left v)\n        end\n        if <<key (right arrow v) pressed?> or <<mouse down?> and <<(mouse x) > (x position)> and <not <(touching ui) = [1]>>>>> then\n            change [x v] by (1)\n            switch costume to (right v)\n        end\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (platform v)?> then\n        change y by (2)\n    end\n    if <touching (platform v)?> then\n        change y by (2)\n    end\n    if <touching (platform v)?> then\n        change y by (2)\n    end\n    if <touching (platform v)?> then\n        change y by (2)\n    end\n    if <touching (platform v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<key (up arrow v) pressed?> or <<<mouse down?> and <(mouse y) > (y position)>> and <not <(touching ui) = [1]>>>> 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 (platform v)?> 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?> or <<mouse down?> and <(mouse y) > (y position)>>> and <<not <(touching ui) = [1]>> and <touching (platform v)?>>> then\n        set [y v] to [14]\n    end\n    change y by (1)\n    if <<(x position) > [222]> and <touching (_edge_ v)?>> then\n        set y to (0)\n        set x to (-217)\n        change [level v] by (1)\n    end\n    if <touching (trampoline v)?> then\n        set [y v] to [20]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(y position) < [-153]> and <touching (_edge_ v)?>> then\n        set x to (-217)\n        set y to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <<<touching (platform v)?> and <(x refresh) = (x)>> and <(y refresh) = (y)>>> then\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nrepeat (10)\n    change [brightness v] effect by (3)\nend\ndelete this clone\n\nwhen I receive [skip v]\nset x to (-217)\nset y to (0)\nswitch costume to (right v)\n\nwhen flag clicked\nforever\n    if <(level) = [8]> then\n        say [Nice] for (2) seconds\n    end\nend\n\nwhen flag clicked\nshow variable [time v]\nset [time v] to [0]\nrepeat until <(level) = [6]>\n    change [time v] by (1)\n    wait (1) seconds\nend\nwait until <(level) = [6]>\nif <(☁ W.R.) > (time)> then\n    if <(Levels Skipped) = [0]> then\n        set [☁ w.r. v] to (time)\n    end\nend\n\nwhen flag clicked\ndelete this clone\n\nwhen flag clicked\nforever\n    wait (0.01) seconds\n    set [x refresh v] to (x)\n    change [y refresh v] by (y)\nend\n\nset [☁ w.r. v] to [0]\n\n@platform\n\nwhen flag clicked\nforever\n    switch costume to (level)\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        set [level v] to [1]\n    end\n    wait (1) seconds\nend\n\nwhen flag clicked\ndelete this clone\n\n@lava\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (level)\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    glide (1) secs to x: (0) y: (5)\n    glide (1) secs to x: (0) y: (-5)\nend\n\n@Sprite1\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@trampoline\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        play sound [Big Boing v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (level)\nend\n\n@spikes\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    switch costume to (level)\nend\n\nwhen flag clicked\ndelete this clone\n\n@Sprite4\n\nwhen flag clicked\nhide\nif <(username) = [JetPilot4]> then\n    show\nend\n\n@clouds\n\nwhen flag clicked\nforever\n    hide\n    create clone of (_myself_ v)\n    wait (4) seconds\nend\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (3))\nset [ghost v] effect to (pick random (10.) to (40))\ngo to [back v] layer\ngo [backward v] (1500) layers\ngo to (random position v)\nset x to (276)\nshow\nrepeat until <<<(x position) < [-2]> and <touching (_edge_ v)?>> or <<<touching (platform v)?> and <(y position) < [-210]>> or <<<touching (spikes v)?> or <touching (sign v)?>> or <touching (lava v)?>>>>\n    change x by (-5)\nend\ndelete this clone\n\n@Sprite3\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nif <<not <is turbowarp?>> and <(Cancel Turbo) = [0]>> then\n    show\nend\n\nwhen this sprite clicked\nset [cancel turbo v] to [1]\nhide\n\nset [cancel turbo v] to [0]\n\nset [☁ w.r. v] to [17]\n\n@Skip button\n\nwhen flag clicked\n\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [touching ui v] to [1]\n        wait until <not <touching (mouse-pointer v)?>>\n        set [touching ui v] to [0]\n    end\nend\n\nwhen this sprite clicked\nset size to (35) %\nwait until <not <mouse down?>>\nset size to (40) %\nstart sound [Wood Tap v]\nif <touching (mouse-pointer v)?> then\n    if <not <(level) = [8]>> then\n        change [level v] by (1)\n        change [levels skipped v] by (1)\n        broadcast (skip v)\n    end\nend\n\nwhen flag clicked\nset [levels skipped v] to [0]\nset [deaths v] to [0]\n\nshow\nforever\n    if <(level) = [7]> then\n        show variable [deaths v]\n        show variable [levels skipped v]\n    end\nend\n\nhide\n\n@More Games button\n\nwhen flag clicked\nset [more games v] to [0]\nset [touching ui v] to [0]\nclear graphic effects\nset size to (40) %\nshow\n\nhide\nwait until <(level) = [8]>\n\nwhen I start as a clone\nset size to (0) %\nhide\ngo to x: (0) y: (0)\nswitch costume to (costume2 v)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change size by (10)\n    change [ghost v] effect by (-20)\nend\n\nwhen this sprite clicked\nif <<(mouse y) > [136]> and <(mouse x) > [109]>> then\n    set size to (100) %\n    play sound [Wood Tap v] until done\n    repeat (10)\n        change size by (-10)\n        change [ghost v] effect by (20)\n    end\n    set [more games v] to [0]\n    hide\nend\n\nwhen flag clicked\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [touching ui v] to [1]\n        wait until <not <touching (mouse-pointer v)?>>\n        set [touching ui v] to [0]\n    end\nend\n\nwhen flag clicked\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [touching ui v] to [1]\n        wait until <not <touching (mouse-pointer v)?>>\n        set [touching ui v] to [0]\n    end\nend\n\nwhen this sprite clicked\nif <(More games) = [0]> then\n    set size to (35) %\n    wait until <not <mouse down?>>\n    set size to (40) %\n    start sound [Wood Tap v]\n    if <touching (mouse-pointer v)?> then\n        if <(More games) = [0]> then\n            set [more games v] to [1]\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen flag clicked\nset [levels skipped v] to [0]\nset [deaths v] to [0]\nshow\nforever\n    if <(level) = [7]> then\n        show variable [deaths v]\n        show variable [levels skipped v]\n    end\nend\n\nwhen I start as a clone\nset drag mode [not draggable v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [touching ui v] to [1]\n        wait until <not <touching (mouse-pointer v)?>>\n        set [touching ui v] to [0]\n    end\nend\n\n