Faded Into Unknown ][ ~~Scrolling platformer~~

Instructions:                                   Instructions \n(Arrow Keys) to move\nYou can Wall Jump in this game\nYou have to get all the coins to get to the portal.\nDo not touch the acid or spikes, it kills you.\nClick on the sound button to mute and unmute the sound. \nUpdated: 14/10/20 Made mobile-friendly.\n\nAll levels are 100% possible\n\n\nBy @Alars _95

@Stage\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\n\nwhen flag clicked\nhide variable [mouse v]\n\nwhen flag clicked\nforever\n    play sound [Alan Walker - Faded \(minus\) v] until done\nend\n\nwhen I receive [sound on v]\nset volume to (100) %\n\nwhen I receive [sound off v]\nset volume to (0) %\n\n@Blank\n\n@Player\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\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) > [50]>\n        Tick\n        broadcast (Tick v) and wait\n        create clone of (_myself_ v)\n    end\n    if <(EXIT) = [win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\ndefine Game On\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nset rotation style [left-right v]\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    change [sx v] by (-2)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [sx v] by (2)\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 <<<((mouse y) - (y position)) > [50]> and <mouse down?>> or <key (up arrow v) pressed?>> then\n    if <(In air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\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)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [de]\nend\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms 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 (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <key (up arrow v) pressed?> 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 (platforms 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\nwhen this sprite clicked\nnext costume\n\ndefine Game - Die\nset [exit v] to [0]\nrepeat (1)\nhide\nwait (1) seconds\n\ndefine Test - die\nif <touching (danger v)?> then\n    set [exit v] to [de]\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\nChange player x by [-8]\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-10)\nend\ndelete this clone\n\nwhen I receive [game start v]\nshow variable [treasure found: v]\nset [ghost v] effect to (0)\nswitch costume to (costume1 v)\nturn video (off v)\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen flag clicked\nhide variable [treasure found: v]\nset [ghost v] effect to (100)\n\n@Collectables\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    change [treasure found: v] by (1)\n    if <(TREASURE FOUND:) = (Max Treasure Found)> then\n        broadcast (Open portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [treasure found: v] to [0]\nset [max treasure found v] to [0]\nset [y v] to [0]\nset [x v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (star v)\n    Clone at x: [50] y: [0]\n    Clone at x: [100] y: [50]\n    Clone at x: [363] y: [63]\n    Clone at x: [750] y: [71]\n    Clone at x: [750] y: [130]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (star v)\n        Clone at x: [125] y: [125]\n        Clone at x: [400] y: [453]\n        Clone at x: [890] y: [790]\n        Clone at x: [1053] y: [890]\n        Clone at x: [1630] y: [1012]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (star v)\n            Clone at x: [-170] y: [67]\n            Clone at x: [470] y: [30]\n            Clone at x: [208] y: [54]\n            Clone at x: [660] y: [244]\n            Clone at x: [1485] y: [60]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (star v)\n                Clone at x: [349] y: [-110]\n                Clone at x: [449] y: [-110]\n                Clone at x: [620] y: [-110]\n                Clone at x: [620] y: [137]\n                Clone at x: [1020] y: [236]\n            end\n            set [x v] to [-99999]\n        end\n        set [x v] to [-99999]\n    end\n    set [x v] to [-99999]\nend\nset [x v] to [-99999]\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 [max treasure found v] by (1)\ncreate clone of (_myself_ v)\n\n@Platforms\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 [y v] to [0]\nset [x v] to [0]\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]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2.1 v)\n        Clone at x: [420] y: [250]\n        Clone at x: [460] y: [385]\n        Clone at x: [540] y: [200]\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: [560] y: [0]\n            Clone at x: [560] y: [0]\n            Clone at x: [160] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4.1 v)\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [0] y: [360]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5.1 v)\n                end\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\nClone at x: [360] y: [0]\n\nClone at x: [560] y: [0]\n\nwhen flag clicked\nswitch costume to (level 1.1 v)\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 [y v] to [0]\nset [x v] to [0]\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]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2.1 v)\n        Clone at x: [420] y: [250]\n        Clone at x: [460] y: [385]\n        Clone at x: [540] y: [200]\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: [460] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4.1 v)\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5.1 v)\n                end\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\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\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 <<(costume [name v]) = [Portal Open]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nset [treasure found: v] to [0]\nset [y v] to [0]\nset [x v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (portal closed v)\n    Clone at x: [1420] y: [-50]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (portal closed v)\n        Clone at x: [1757] y: [1040]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (portal closed v)\n            Clone at x: [1673] y: [123]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (portal closed v)\n                Clone at x: [420] y: [578]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (portal closed v)\n                    Clone at x: [0] y: [1000]\n                end\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 (portal open v)\n\nchange [treasure found: v] by (1)\ndelete this clone\n\n@Sprite1\n\nwhen flag clicked\nswitch costume to (download v)\nforever\n    if <(costume [name v]) = [download]> then\n        broadcast (Sound On v) and wait\n    end\n    if <(costume [name v]) = [download2]> then\n        broadcast (Sound Off v) and wait\n    end\nend\n\nwhen this sprite clicked\nnext costume\n\n@Sprite2\n\nwhen this sprite clicked\nnext costume\n\nwhen I receive [game start v]\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\nforever\n    if <(costume [number v]) = [1]> then\n        go to x: (216) y: (159)\n        set size to (50) %\n        set [ghost v] effect to (0)\n    end\n    if <(costume [number v]) = [2]> then\n        go to x: (0) y: (0)\n        set size to (100) %\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\nhide\n\n@Sprite3\n\nwhen flag clicked\ngo to x: (-4) y: (158)\nforever\n    if <(LEVEL) = [1]> then\n        switch costume to (costume1 v)\n    end\n    if <(LEVEL) = [2]> then\n        switch costume to (costume2 v)\n    end\n    if <(LEVEL) = [3]> then\n        switch costume to (costume3 v)\n    end\n    if <(LEVEL) = [4]> then\n        switch costume to (costume4 v)\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    show\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n@Intro\n\nwhen flag clicked\nshow\nrepeat (3)\n    repeat (9)\n        wait (0.2) seconds\n        next costume\n    end\nend\nrepeat (10)\n    wait (.1) seconds\n    change [ghost v] effect by (20)\nend\nbroadcast (Game Start v) and wait\n\n@Blank2\n\n