Where are you? - A scrolling platformer 

Instructions:                                \n                              -Where are you?-\n\nCollects bits to open the portal but be careful not to touch the spikes... 

@Stage\n\nwhen [n 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\nforever\n    play sound [5 v] until done\nend\n\nwhen [r v] key pressed\nset [exit v] to [reset]\n\nwhen I receive [finish game v]\nstop [other scripts in sprite v]\nstop all sounds\nplay sound [alone-in-space-lofi-hip-hop-beat-free-for-profit-use2 v] until done\n\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\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 (Set up v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v)\n    end\n    if <(EXIT) = [win]> then\n        Game - WIn\n    else\n        if <(EXIT) = [die]> then\n            Game - Die\n        else\n            Game - Reset\n        end\n    end\nend\n\ndefine Game On\nset [x v] to [0]\nset [y v] to [0]\nset [sy v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nclear graphic effects\nshow\nset size to (100) %\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    switch costume to (player2 v)\n    change Player x by [-8]\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    switch costume to (player v)\n    change Player x by [8]\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-2)\nchange Player y by (sy)\nTest - Die\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (5)))\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 [die]\nend\n\ndefine change Player y by (sy)\nchange [in air v] by (1)\nchange [y v] by (sy)\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    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\ndefine Game - Die\nset [exit v] to [0]\nrepeat (3)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nbroadcast (8 v)\nstart sound [death v]\nstart sound [Explosion v]\nhide\nwait (0.5) seconds\n\ndefine Test - Die\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game - WIn\nstart sound [teleporting-sound-effect-film-movie v]\nrepeat (30)\n    point towards (exit v)\n    move ((distance to [exit v]) / (5)) steps\n    change size by (-1)\n    change [ghost v] effect by (3.333333333333)\nend\nhide\nchange [level v] by (1)\nwait (1.5) seconds\n\ndefine Game - Reset\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\n\nwhen I receive [finish game v]\nstop [other scripts in sprite 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 [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [270] y: [100]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [100] 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: [190] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [400] y: [360]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [999999999999999999] y: [360]\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\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 [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [270] y: [100]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [100] 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: [190] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [400] y: [360]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [99999999999] y: [360]\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\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 [collected v] by (1)\n    if <(Collected) = (COLLECTED MAX)> then\n        start sound [smb3_nspade_match v]\n        broadcast (FlagFree v)\n    else\n        start sound [card pick v]\n    end\n    delete this clone\nend\n\nwhen I receive [set up v]\nhide\nset [collected max v] to [0]\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (dot v)\n    Clone at x: [39] y: [202]\n    Clone at x: [344] y: [264]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (dot v)\n        Clone at x: [ 223] y: [110]\n        Clone at x: [210] y: [418]\n        Clone at x: [-205] y: [128]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (dot v)\n            Clone at x: [263] y: [88]\n            Clone at x: [499] y: [91]\n            Clone at x: [666] y: [339]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (dot v)\n                Clone at x: [125] y: [331]\n                Clone at x: [191] y: [499]\n                Clone at x: [520] y: [608]\n            end\n        end\n    end\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 [collected max v] by (1)\ncreate clone of (_myself_ v)\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]) = [open]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (closed v)\n    Clone at x: [507] y: [256]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (closed v)\n        Clone at x: [335] y: [428]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (closed v)\n            Clone at x: [855] y: [63]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (closed v)\n                Clone at x: [-145] y: [245]\n            else\n                if <(LEVEL) = [5]> then\n                    broadcast (Finish Game v)\n                    switch costume to (closed v)\n                    Clone at x: [999999] y: [245]\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 [flagfree v]\nswitch costume to (open v)\n\n@Death Particles - mandrewschoon\n\nwhen I start as a clone\ngo to [back v] layer\ngo to [front v] layer\nset [yv v] to (pick random (5.0) to (15))\nset [xv v] to (pick random (-5) to (5.0))\nshow\nset size to (pick random (100) to (175)) %\nset [brightness v] effect to (pick random (0) to (25))\nforever\n    change [yv v] by (-1)\n    change x by (XV)\n    change y by (YV)\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\n\ndefine Particle (#)\nrepeat (#)\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [8 v]\ngo to (player v)\nParticle [20]\n\nturn right ((360) / (#)) degrees\n\n@Text\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\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (where are you? v)\n    Clone at x: [83] y: [280]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (some kind of void? v)\n        Clone at x: [-150] y: [285]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (how can you escape? v)\n            Clone at x: [379] y: [287]\n        else\n            if <(LEVEL) = [5]> then\n                switch costume to (how can you escape?2 v)\n                Clone at x: [-219] y: [89]\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\nend\n\n@Well done.\n\nwhen flag clicked\nhide\n\nwhen I receive [finish game v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n