Jump! - A mobile platformer

Instructions: Easter egg does not do anything!\nUse arrow keys to move. Hold down up longer to jump higher. Get to the portal to get to the next level. DO NOT JUMP OFF FROM A HIGH PLACE! YOU WILL GLITCH OUT! IF THIS HAPPENS. RESTART YOUR BROWSER.\nI spent 10 hours on this thing.\nSo a love and favorite would be greatly appreciated.\nEnjoy!

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\nset volume to (100) %\nforever\n    play sound [Clarx - Bones \[NCS Release\] v] until done\nend\n\nwhen I receive [time v]\nswitch backdrop to (backdrop3 v)\n\n@Player\n\nwhen I start as a clone\nswitch costume to (front v)\nclear graphic effects\nrepeat (20)\n    change [ghost v] effect by (5)\n    change y by (5)\n    turn right (5) degrees\nend\ndelete this clone\n\ndefine Double Jump\nchange y by (-1)\nif <<(jump key) = [0]> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (levels v)?>>> then\n    set [yv v] to [12]\n    set [jump v] to [1]\n    set [jump key v] to [1]\nend\nchange y by (1)\nif <<(jump key) = [0]> and <<<(jump) = [1]> and <(in air) > [10]>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>>> then\n    set [jump v] to [2]\n    set [yv v] to [12]\n    set [jump key v] to [1]\nend\n\nwhen flag clicked\nReset\nforever\n    broadcast (Game On v)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (1.5)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-1.5)\n    end\n    set [xv v] to ((Xv) * (0.8))\n    change x by (round (Xv))\n    Touch Wall\n    change [yv v] by (-1)\n    change [in air v] by (1)\n    change y by (Yv)\n    Touch Ground\n    Detect\n    Set Costume\n    if <(Down Pressed) > [0]> then\n        change [down pressed v] by (-1)\n    end\nend\n\ndefine Touch Ground\nif <(Yv) > [0]> then\n    repeat until <not <touching (levels v)?>>\n        change y by (-1)\n        set [yv v] to [0]\n    end\nelse\n    repeat until <not <touching (levels v)?>>\n        change y by (1)\n        set [yv v] to [0]\n        set [in air v] to [0]\n        set [jump v] to [0]\n    end\nend\nif <<<(in air) > [0]> and <(in air) < [10]>> and <(Yv) < [0]>> then\n    set [jump v] to [1]\nend\nDouble Jump\n\ndefine Touch Wall\nrepeat (10)\n    if <touching (levels v)?> then\n        change y by (1)\n    end\nend\nif <touching (levels v)?> then\n    change x by ((round (Xv)) * (-1))\n    change y by (-10)\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        if <(Xv) > [0]> then\n            set [xv v] to [-5]\n        else\n            set [xv v] to [5]\n        end\n        set [yv v] to [10]\n    else\n        set [xv v] to [0]\n    end\nend\n\ndefine Reset\ngo to x: (-180) y: (0)\nset size to (175) %\nset [xv v] to [0]\nset [yv v] to [0]\nset [jump v] to [0]\nset [jump key v] to [0]\nset [in air v] to [0]\nset [yv v] to [0]\n\ndefine Set Costume\nswitch costume to (front v)\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    switch costume to (up v)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    switch costume to (right v)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    switch costume to (left v)\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (up right v)\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    switch costume to (up left v)\nend\nif <(Crouch?) = [1]> then\n    switch costume to (crouch v)\nend\n\ndefine Detect\nif <not <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    set [jump key v] to [0]\nend\nif <touching (danger v)?> then\n    Death Sound\n    create clone of (_myself_ v)\n    Reset\nend\nif <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n    set [crouch? v] to [1]\n    set [down pressed v] to [10]\nelse\n    set [crouch? v] to [0]\nend\nif <(x position) > [240]> then\n    start sound [Coin v]\n    Reset\n    broadcast (Next Level v)\nend\n\nwhen I receive [time v]\nsay (join [Your score is: ] (join (Timer) [ seconds.])) for (3) seconds\nforever\n    if <key (space v) pressed?> then\n        say (join [Your score is: ] (join (Timer) [ seconds.])) for (3) seconds\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        Death Sound\n        Reset\n        wait until <not <key (r v) pressed?>>\n    end\nend\n\nwhen flag clicked\n\nforever\n    if <key (space v) pressed?> then\n        start sound [Coin v]\n        broadcast (Next Level v)\n        Reset\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\ndefine Death Sound\nset [death sound v] to (pick random (1) to (4))\nstart sound (Death Sound)\n\n@Player Trail\n\nwhen flag clicked\nhide\nset size to (175) %\nforever\n    go to (player v)\n    create clone of (_myself_ v)\n    if <(Crouch?) = [1]> then\n        switch costume to (crouch v)\n    else\n        switch costume to (normal v)\n    end\nend\n\nwhen I start as a clone\nshow\ngo to [back v] layer\nclear graphic effects\nset [ghost v] effect to (20)\nrepeat (10)\n    change [ghost v] effect by (8)\nend\nhide\ndelete this clone\n\n@Levels\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nshow\ngo to [back v] layer\nset [level v] to [1]\n\nwhen I receive [next level v]\nchange [level v] by (1)\nnext costume\nif <(costume [number v]) = [9]> then\n    switch backdrop to (backdrop3 v)\n    stop [other scripts in sprite v]\n    broadcast (Time v)\nend\n\nwhen flag clicked\nset [timer v] to [0]\nforever\n    wait (1) seconds\n    change [timer v] by (1)\nend\n\n@Danger\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nshow\ngo to [back v] layer\n\nwhen I receive [next level v]\nnext costume\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@Text\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nshow\ngo to [back v] layer\nforever\n    go to [back v] layer\nend\n\nwhen I receive [next level v]\nnext costume\n\n