Lost || A scrolling platformer  

Instructions: arrow keys to move.\nAvoid spikes and lave.\nGet to the portal to progress to the next level.\nThere are four levels: desert , ice , jungle , mountain.\nFirst 5000 to love and fav will receive a follow from me.\nplease love and fave I spent 8 months on this 

@Stage\n\nwhen I receive [thum v]\nswitch backdrop to (savanna v)\n\nwhen I receive [play. game v]\nshow variable [timer v]\nset [timer v] to [0]\nforever\n    wait (1) seconds\n    change [timer v] by (1)\nend\n\nwhen flag clicked\nset [timer v] to [0]\n\nwhen I receive [game done.com v]\nwait (8) seconds\nstop [all v]\n\n@Sprite1\n\nwhen [m v] key pressed\nset [mouse v] to (join ((SCROLL X) + (mouse x)) (join [, ] ((SCROLL Y) + (mouse y))))\nshow variable [mouse v]\n\nwhen flag clicked\nset [in v] to [0]\nhide variable [mouse v]\nhide variable [collected max v]\nhide variable [e v]\n\nwhen I receive [play. game v]\nforever\n    play sound [Inferno  v] until done\nend\n\n@player \n\nwhen flag clicked\nhide\nset [menu v] to [0]\nset size to (30) %\nset [ghost v] effect to (0)\nset [x v] to [0]\nset [y v] to [0]\nbroadcast (green flag v) and wait\nif <not <(username) = [aa-464733]>> then\n    broadcast (intro v) and wait\n    wait until <(in) = [1]>\nend\nbroadcast (menu v) and wait\nwait until <(menu) = [done]>\nbroadcast (play. game v) and wait\n\nwhen I receive [play. game v]\nset [hj v] to [0]\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) > []>\n        tick\n        broadcast (tick v) and wait\n    end\n    if <(Exit) = [win]> then\n        Game win\n    else\n        Game-Die\n    end\nend\n\ndefine Game on\nif <(LEVEL) = [2]> then\n    switch backdrop to (backdrop2 v)\nend\nif <(LEVEL) = [1]> then\n    switch backdrop to (savanna v)\nend\nif <(LEVEL) = [3]> then\n    switch backdrop to (backdrop1 \(2\) v)\nend\nif <(LEVEL) = [4]> then\n    switch backdrop to (backdrop1 \(3\) v)\nend\nset [x v] to [-220]\nset [y v] to [-100]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [sx v] to [0]\nshow\n\ndefine tick\nif <key (left arrow v) pressed?> then\n    change [sx v] by (-2)\nend\nif <key (right arrow v) pressed?> then\n    change [sx v] by (2)\nend\nset [sx v] to ((sx) * (0.8))\nif <[0.9] < ([abs v] of (sx) )> then\n    Change player x by (round (sx))\nend\nif <key (up arrow v) pressed?> then\n    if <(In air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <[-20] < (sy)> then\n    change [sy v] by (-2)\nend\nChange player y by (sy)\nset [scroll x v] to (X)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nchange [scroll y v] by (round (((Y) - (SCROLL Y)) / (10)))\nPosition\nif <(LEVEL) = [2]> then\n    if <touching color (#ff0000)?> then\n        set [exit v] to [die]\n    end\nend\nif <(Y) < [-240]> then\n    set [exit v] to [die]\nend\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nTest die\nrepeat until <not <touching (platform 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\nTest die\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform 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 (platform 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 Test die\nif <<touching color (#2c56ff)?> or <<touching color (#3f3f3f)?> or <<touching (platform2 v)?> or <touching (platform3 v)?>>>> then\n    set [exit v] to [die]\nend\n\ndefine Game win\nset rotation style [all around v]\nrepeat (50)\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal 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\nshow\nset size to (30) %\nset [ghost v] effect to (0)\nset rotation style [left-right v]\n\ndefine Game-Die\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\nwhen flag clicked\nset [tim v] to [.1]\nforever\n    set [tim v] to ((timer) + (.1))\nend\n\nwhen [timer v] > (tim)\nbroadcast (k v)\nbroadcast (thum v)\n\nwhen I receive [k v]\nhide\n\nwhen [s v] key pressed\nset [in v] to [1]\n\nwhen I receive [thum v]\nhide\n\n@platform\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [-11]\nset [y v] to [-30]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [500] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [115] y: [600]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1  v)\n        Clone at x: [500] y: [0]\n        Clone at x: [800] y: [0]\n        Clone at x: [640] y: [150]\n        Clone at x: [950] y: [-13]\n        Clone at x: [930] y: [-13]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [480] y: [0]\n            Clone at x: [550] y: [0]\n            Clone at x: [480] y: [0]\n            Clone at x: [480] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 1-1 \(2\) v)\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\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\nwhen I receive [green flag v]\nhide\n\nwhen I receive [k v]\nhide\n\nwhen I receive [play. game v]\nforever\n    if <(costume [number v]) = [29]> then\n        broadcast (game done.com v)\n    end\nend\n\n@coins\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 MAX) = (collected)> then\n        broadcast (op v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide variable [mouse v]\nset [collected v] to [0]\nhide\nset [y v] to [-16]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 \(1\) v)\n    Clone at x: [-134] y: [-36]\n    Clone at x: [376] y: [-95]\n    Clone at x: [1106] y: [-25]\n    Clone at x: [1329] y: [-5]\n    Clone at x: [1481] y: [-17]\n    Clone at x: [1748] y: [-14]\n    Clone at x: [1814] y: [-4]\n    Clone at x: [1860] y: [-14]\n    Clone at x: [2037] y: [40]\n    Clone at x: [990] y: [-32]\n    Clone at x: [1214] y: [-35]\n    Clone at x: [2015] y: [-29]\n    Clone at x: [571] y: [287]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 1 1 v)\n        Clone at x: [347] y: [-66]\n        Clone at x: [608] y: [-18]\n        Clone at x: [737] y: [34]\n        Clone at x: [65] y: [-14]\n        Clone at x: [1445] y: [0]\n        Clone at x: [568] y: [179]\n        Clone at x: [1819] y: [83]\n        Clone at x: [1819] y: [-8]\n        Clone at x: [1819] y: [-100]\n        Clone at x: [2588] y: [78]\n        Clone at x: [2886] y: [78]\n        Clone at x: [3188] y: [78]\n        Clone at x: [3519] y: [78]\n        Clone at x: [3816] y: [78]\n        Clone at x: [4121] y: [78]\n        Clone at x: [2285] y: [78]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 1 2 v)\n            Clone at x: [-9] y: [-25]\n            Clone at x: [429] y: [71]\n            Clone at x: [871] y: [-96]\n            Clone at x: [934] y: [17]\n            Clone at x: [853] y: [138]\n            Clone at x: [1208] y: [214]\n            Clone at x: [1451] y: [221]\n            Clone at x: [1613] y: [114]\n            Clone at x: [1884] y: [110]\n            Clone at x: [1884] y: [142]\n            Clone at x: [1884] y: [174]\n        end\n    end\nend\nset [x v] to [6656446455455645]\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)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nchange [collected max v] by (1)\n\nwhen I receive [k v]\nhide\n\nwhen [r v] key pressed\nbroadcast (reset v)\nbroadcast (setup v)\nbroadcast (play. game v)\n\n@portal\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\nif <<touching (player  v)?> and <(costume [name v]) = [open]>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide variable [mouse v]\nset [collected max v] to [0]\nset [collected v] to [0]\nhide\nset [y v] to [-16]\nif <(LEVEL) = [1]> then\n    switch costume to (open2 v)\n    Clone at x: [2860] y: [913]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (open2 v)\n        Clone at x: [4302] y: [49]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (open2 v)\n            Clone at x: [2323] y: [69]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (costume1 v)\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: ((y) + (pr))\nif <<(x) = (x position)> and <((y) + (pr)) = (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 [op v]\nswitch costume to (open v)\n\nwhen I receive [k v]\nhide\n\nwhen flag clicked\nforever\n    set [pr v] to [7]\n    forever\n        repeat (15)\n            change [pr v] by (0.5)\n        end\n        wait (0.1) seconds\n        repeat (15)\n            change [pr v] by (-0.5)\n        end\n        wait (0.1) seconds\n    end\nend\n\n@platform2\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [-11]\nset [y v] to [-30]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 4 v)\n    Clone at x: [500] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [30] y: [400]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 1 2 v)\n        Clone at x: [500] y: [0]\n        Clone at x: [800] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (costume1 v)\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (costume1 v)\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\nwhen I receive [k v]\nhide\n\nwhen flag clicked\nhide\n\n@Sprite2\n\nwhen I receive [menu v]\nset [ghost v] effect to (100)\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\ngo to x: (-26) y: (8)\n\nwhen flag clicked\nhide\n\nwhen I receive [g v]\nrepeat (70)\n    wait (0.0000000001) seconds\n    change [ghost v] effect by (2)\nend\n\nwhen I receive [k v]\nhide\n\nwhen I receive [thum v]\nhide\n\n@Sprite3\n\nwhen this sprite clicked\nbroadcast (g v)\nrepeat (70)\n    wait (0.00000000000000001) seconds\n    change [ghost v] effect by (2)\nend\nwait (0.5) seconds\nset [menu v] to [done]\n\nwhen I receive [menu v]\nset [ghost v] effect to (100)\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\ngo to x: (-26) y: (8)\n\nwhen I receive [k v]\nhide\n\nwhen flag clicked\nswitch backdrop to (savanna3 v)\n\nwhen flag clicked\nhide\n\nwhen I receive [thum v]\nhide\n\n@player 2\n\nwhen I receive [k v]\nhide\n\nwhen I receive [intro v]\npoint in direction (-90)\nhide\nwait (1) seconds\nshow\ngo to x: (-4) y: (-169)\nset size to (30) %\nset [ghost v] effect to (0)\nwait (9) seconds\nglide (2) secs to x: (-179) y: (-169)\nwait (8) seconds\nglide (2.5) secs to x: (30) y: (-169)\nwait (1.5) seconds\npoint in direction (90)\nwait (1.5) seconds\npoint in direction (-90)\nwait (1.5) seconds\npoint in direction (90)\nwait (1.5) seconds\npoint in direction (-90)\nhide\nswitch backdrop to (savanna v)\nset [in v] to [1]\n\n@player 3\n\nwhen I receive [k v]\nhide\n\nwhen I receive [intro v]\nhide\nwait (1) seconds\nshow\ngo to x: (79) y: (-127)\nset size to (30) %\nset [ghost v] effect to (0)\nwait (13) seconds\npoint in direction (-90)\nset rotation style [left-right v]\nwait (1) seconds\nglide (3) secs to x: (274) y: (-127)\nhide\n\n@Butterfly 1\n\nwhen flag clicked\nforever\n    if <(in) = [1]> then\n        hide\n    end\nend\n\nwhen I receive [k v]\nhide\n\nwhen I receive [intro v]\nhide\ngo to x: (-3) y: (-75)\nwait (3) seconds\nshow\nwait (2) seconds\ngo to x: (-15) y: (-73)\nglide (2) secs to x: (-151) y: (-69)\n\n@platform3\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [-11]\nset [y v] to [-50]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 4 v)\n    Clone at x: [500] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [650] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 1 2 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (costume1 v)\n            Clone at x: [480] y: [0]\n            Clone at x: [600] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (costume1 v)\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: ((y) + (lr))\nif <<(x) = (x position)> and <((y) + (lr)) = (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\nwhen I receive [k v]\nhide\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <<(LEVEL) = [2]> or <<(LEVEL) = [3]> or <(LEVEL) = [1]>>> then\n        set [lr v] to [4]\n        forever\n            repeat (10)\n                change [lr v] by (2)\n            end\n            wait (0.1) seconds\n            repeat (10)\n                change [lr v] by (-2)\n            end\n            wait (0.1) seconds\n        end\n    end\nend\n\n@Sprite4\n\nwhen flag clicked\nhide\n\nwhen I receive [k v]\nshow\n\nshow\n\n