Faded- a platformer (Mobile friendly)

Instructions: Arrow keys, WASD of click on mobile.

@Stage\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    play sound [Alan Walker - Fade \[NCS Release\] \(1\).mp3 v] until done\nend\n\n@Sprite1\n\nwhen I receive [green flag clicked v]\nReset\nset size to (70) %\nset rotation style [left-right v]\ngo to x: (-200) y: (100)\nshow\nset [speed y v] to [0]\nset [level v] to [1]\nset [falling? v] to [10]\nbroadcast (New Level v)\nset [vibration v] to [5]\nforever\n    Tick <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <<(x position) > (mouse x)> and <(distance to [mouse-pointer v]) > [40]>>>>> <<key (up arrow v) pressed?> or <<mouse down?> and <<(mouse y) > (y position)> and <(distance to [mouse-pointer v]) > [20]>>>> <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <<(mouse x) > (x position)> and <(distance to [mouse-pointer v]) > [40]>>>>>\nend\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <not <touching (ground v)?>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching (ground v)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <<(mouse y) > (y position)> and <(distance to [mouse-pointer v]) > [20]>>>>> and <([abs v] of (speed) ) > [3]>> then\n        if <(wall jump) = [0]> then\n            set [speed x v] to ((-1.2) * (speed))\n            set [speed y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        end\n    else\n        set [speed x v] to [0]\n    end\nend\nif <(speed) < [0]> then\n    change [frame v] by ((speed) / (-8))\nelse\n    change [frame v] by ((speed) / (8))\nend\n\ndefine Tick <left> <up> <right>\ncreate clone of (_myself_ v)\nif <<(speed y) < [4]> or <up>> then\n    if <touching (water v)?> then\n        change [speed y v] by (3)\n    else\n        change [speed y v] by (-1)\n    end\nelse\n    if <touching (water v)?> then\n        change [speed y v] by (-0.5)\n    else\n        change [speed y v] by (-1.5)\n    end\nend\nif <touching (water v)?> then\n    set [speed y v] to ((speed y) * (0.8))\nend\nif <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <<mouse down?> and <<(y position) > (mouse y)> and <(distance to [mouse-pointer v]) > [20]>>>>> then\n    change [speed y v] by (-2)\n    if <touching (water v)?> then\n        change [speed y v] by (-2)\n    end\nend\nchange y by (speed y)\nTouch Ground <(speed y) > [0]>\nif <(wall jump) > [0]> then\n    change [wall jump v] by (-1)\nelse\n    set [speed x v] to ((speed x) * (0.7))\n    if <left> then\n        change [speed x v] by (-2)\n    end\n    if <right> then\n        change [speed x v] by (2)\n    end\nend\nif <(speed x) < [-0.5]> then\n    Walk (-90) (speed x)\nelse\n    if <(speed x) > [0.5]> then\n        Walk (90) (speed x)\n    else\n        set [frame v] to [0]\n    end\nend\nif <up> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        set [speed y v] to [14]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <(y position) < [-180]> then\n    Reset\n    set [speed y v] to [0]\nend\nif <<touching (lava v)?> or <touching (spikes v)?>> then\n    start sound [Pillow-Hit-2 v]\n    Reset\n    broadcast (Retry v)\n    broadcast (Shake v)\nend\nif <touching (portal v)?> then\n    change [level v] by (1)\n    start sound [Ding - Sound Effects YouTube v]\n    broadcast (New Level v)\n    Reset\nend\nif <touching (bouncy v)?> then\n    set [speed y v] to ((15) + ((speed y) * (-0.7)))\nend\n\nwhen flag clicked\nbroadcast (Green Flag clicked v)\n\ndefine Reset\nclear graphic effects\nswitch costume to (right v)\nbroadcast (New Level v)\nbroadcast (Position v)\npoint in direction (90)\nset size to (70) %\nset rotation style [left-right v]\ngo to x: (-200) y: (100)\nshow\nset [speed y v] to [0]\nset [falling? v] to [10]\nClone [10]\n\ndefine Clone (#)\nrepeat (#)\n    create clone of (particles v)\nend\n\nwhen I start as a clone\nswitch costume to (left2 v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\ndelete this clone\n\n@Rain\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\n    hide\nend\n\nwhen I start as a clone\nshow\nPosition\nset size to (pick random (50) to (60)) %\nset [ghost v] effect to (pick random (50) to (80))\ngo to [back v] layer\nrepeat until <<([abs v] of (y position) ) > [175]> or <([abs v] of (x position) ) > [235]>>\n    move (10) steps\nend\ndelete this clone\n\ndefine Position\ngo to (random position v)\npoint in direction (pick random (-163) to (-167))\nrepeat until <touching (_edge_ v)?>\n    move (-10) steps\nend\n\nwhen I receive [shake v]\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\n\n@Ground\n\nwhen flag clicked\nforever\n    switch costume to (LEVEL)\nend\n\nwhen I receive [shake v]\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\n\n@Coins\n\nwhen flag clicked\nforever\n    if <not <key (m v) pressed?>> then\n        next costume\n        hide\n    end\nend\n\nwhen [m v] key pressed\ngo to (mouse-pointer v)\nshow\nsay (join (mouse x) (join [,] (mouse y)))\nwait until <not <key (m v) pressed?>>\n\ndefine Clone (x) (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nset [level v] to ([costume # v] of [ground v])\nrepeat until <<not <(Level) = ([costume # v] of [ground v])>> or <touching (sprite1 v)?>>\n    next costume\n    wait (0.05) seconds\nend\nif <touching (sprite1 v)?> then\n    change [coins v] by (1)\n    start sound [collect v]\n    Clone [8]\nend\ndelete this clone\n\nwhen I receive [new level v]\nwait (0.001) seconds\nSpawn Level (LEVEL)\n\ndefine Spawn Level (level)\nif <(level) = [1]> then\n    Clone [0] [-88]\n    Clone [45] [4]\nend\nif <(level) = [2]> then\n    Clone [6] [6]\n    Clone [-204] [-85]\nend\nif <(level) = [3]> then\n    Clone [-9] [3]\n    Clone [116] [84]\nend\nif <(level) = [4]> then\n    Clone [-130] [-95]\n    Clone [-8] [19]\n    Clone [118] [-98]\nend\nif <(level) = [5]> then\n    Clone [-155] [50]\n    Clone [46] [15]\n    Clone [161] [-107]\nend\nif <(level) = [6]> then\n    Clone [-160] [49]\n    Clone [92] [-86]\n    Clone [148] [86]\n    Clone [178] [86]\n    Clone [208] [86]\nend\nif <(level) = [7]> then\n    Clone [-102] [30]\n    Clone [-102] [-10]\n    Clone [-102] [-50]\n    Clone [-102] [-90]\n    Clone [-102] [-130]\n    Clone [60] [30]\n    Clone [60] [-10]\n    Clone [60] [-50]\n    Clone [60] [-90]\n    Clone [60] [-130]\nend\n\ndefine Clone (#)\nrepeat (#)\n    create clone of (particles v)\nend\n\nwhen I receive [shake v]\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\n\nwhen I receive [retry v]\ndelete this clone\n\nwhen I receive [retry v]\nwait (0.001) seconds\nSpawn Level (LEVEL)\n\nwhen I receive [new level v]\ndelete this clone\n\n@Other Stuff\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    switch costume to (LEVEL)\nend\n\nwhen I receive [shake v]\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\n\n@Particles\n\nwhen I start as a clone\ngo to [back v] layer\nshow\ngo to (sprite1 v)\nset size to (pick random (80) to (130)) %\nset [brightness v] effect to (pick random (6) to (-6))\nset [xv v] to (pick random (-5) to (5))\nset [yv v] to (pick random (0) to (10))\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    go to x: ((x position) + (Xv)) y: ((y position) + (Yv))\n    change [yv v] by (-1)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [shake v]\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\n\n@Spikes\n\nwhen I receive [shake v]\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\n\nwhen flag clicked\nforever\n    switch costume to (LEVEL)\nend\n\n@Portal\n\nwhen flag clicked\ncreate clone of (_myself_ v)\nforever\n    turn right (10) degrees\n    set [ghost v] effect to (50)\nend\n\nwhen I receive [position v]\nif <(LEVEL) = [1]> then\n    go to x: (171) y: (-70)\nend\nif <(LEVEL) = [2]> then\n    go to x: (180) y: (-75)\nend\nif <(LEVEL) = [4]> then\n    go to x: (180) y: (60)\nend\nif <(LEVEL) = [5]> then\n    go to x: (200) y: (-110)\nend\nif <(LEVEL) = [6]> then\n    go to x: (210) y: (-70)\nend\nif <(LEVEL) = [7]> then\n    go to x: (200) y: (60)\nend\nif <(LEVEL) = [8]> then\n    go to x: (200) y: (-80)\nend\n\nwhen I start as a clone\nforever\n    turn left (10) degrees\n    set [ghost v] effect to (50)\nend\n\nwhen I receive [shake v]\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\n\nwhen I receive [new level v]\nset [coins v] to [0]\n\nwhen I receive [retry v]\nset [coins v] to [0]\n\nwhen flag clicked\nforever\n    broadcast (Position v)\nend\n\n@Water\n\nwhen flag clicked\nclear graphic effects\ngo to x: (0) y: (0)\nset [me v] to [1]\nrepeat (3)\n    create clone of (_myself_ v)\n    change y by (-5)\n    change [brightness v] effect by (-10)\n    change [me v] by (1)\nend\n\nwhen I start as a clone\nshow\nforever\n    switch costume to (LEVEL)\n    set y to ((([sin v] of (((timer) + (me)) * (300)) ) * (8)) - ((me) * (5)))\nend\n\nwhen flag clicked\nforever\n    hide\nend\n\n@Lava\n\nwhen flag clicked\nclear graphic effects\ngo to x: (0) y: (0)\nset [me v] to [1]\nrepeat (3)\n    create clone of (_myself_ v)\n    change y by (-5)\n    change [brightness v] effect by (-10)\n    change [me v] by (1)\nend\n\nwhen I start as a clone\nshow\nforever\n    switch costume to (LEVEL)\n    set y to ((([sin v] of (((timer) + (me)) * (300)) ) * (8)) - ((me) * (5)))\nend\n\nwhen flag clicked\nforever\n    hide\nend\n\n@Lava particles\n\nwhen flag clicked\nhide\nforever\n    Spawn [10] lava particles\n    Spawn [3] water particles\nend\n\ndefine Spawn (x) lava particles\nset [clone id v] to [1]\nrepeat (x)\n    go to (random position v)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\npoint in direction (pick random (-30) to (30))\nif <(clone id) = [1]> then\n    switch costume to (costume1 v)\n    if <not <touching (lava v)?>> then\n        delete this clone\n    end\nelse\n    switch costume to (costume2 v)\n    if <not <touching (water v)?>> then\n        delete this clone\n    end\nend\nset size to (100) %\nset [ghost v] effect to (100)\nrepeat (6)\n    change [ghost v] effect by ((0) - ((100) / (6)))\nend\nrepeat (6)\n    change [ghost v] effect by ((100) / (6))\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    move (5) steps\n    if <touching (ground v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\nend\n\ndefine Spawn (x) water particles\nset [clone id v] to [2]\nrepeat (x)\n    go to (random position v)\n    create clone of (_myself_ v)\nend\n\n@Bouncy\n\nwhen I receive [shake v]\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by ((vibration) * (-1))\nwait (0.01) seconds\nchange x by (vibration)\nwait (0.01) seconds\nchange y by (vibration)\nwait (0.01) seconds\nchange x by ((vibration) * (-1))\nwait (0.01) seconds\n\nwhen I receive [retry v]\nrepeat (1)\n    delete this clone\nend\nClone level (LEVEL)\n\ndefine Clone level (level)\nif <(level) = [6]> then\n    go to x: (-152) y: (-123)\n    create clone of (_myself_ v)\nend\nif <(level) = [5]> then\n    go to x: (-152) y: (-115)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nforever\n    switch costume to (costume1 v)\n    wait until <touching (sprite1 v)?>\n    switch costume to (costume1 v)\n    repeat (9)\n        next costume\n    end\n    wait until <not <touching (sprite1 v)?>>\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [new level v]\nbroadcast (Retry v)\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    show\n    go to x: (0) y: (0)\nend\n\n