The Valley- a scrolling platformer (Collab)#games #all #music #everything 
@Stage\n\n@Blank\n\n@Player\n\nwhen I receive [free rewards v]\nchange [coins v] by (10)\n\ndefine Game On\nset size to (100) %\nclear graphic effects\ngo to [front v] layer\nshow\nset [emojichat? v] to [0]\nset [jumpboost? v] to [0]\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 []\npoint in direction (90)\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Test - Die\nif <<<touching (danger v)?> or <touching (danger2 v)?>> and <(Lives) = [1]>> then\n    set [exit v] to [die]\nend\nif <<<touching (danger v)?> or <touching (danger2 v)?>> and <(Lives) = [2]>> then\n    change [lives v] by (-1)\nend\n\ndefine Change Player Y By (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (graphics 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 Game - Win\nset rotation style [left-right v]\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\nsend cloud data\nchange [level v] by (1)\nwait (1) seconds\n\ndefine Change Player X By (sx)\nchange [x v] by (sx)\nPosition\nif <touching (graphics v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (graphics v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-15]\n        else\n            set [sx v] to [15]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (graphics 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 rotation style [left-right v]\nset [exit v] to []\nrepeat (20)\n    change y by ((((100) - (y position)) / (4)) - (0.5))\nend\nbroadcast (effect v)\nrepeat until <(y position) < [-179]>\n    change y by ((((-180) - (y position)) / (6)) - (0.5))\n    change [ghost v] effect by (5)\nend\nhide\nwait (0.3) seconds\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [backward v] (2) layers\nend\n\ndefine Tick\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-2)\nend\nif <<<key (right arrow v) pressed?> or <key (d 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 <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <(jumpBOOST?) = [0]>> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <(jumpBOOST?) = [1]>> then\n    if <(in air) < [4]> then\n        set [sy v] to [20]\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)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (5)))\nif <(SCROLL Y) < [-100]> then\n    set [scroll y v] to [-100]\nend\nPosition\n\nwhen flag clicked\nforever\n    if <touching (water v)?> then\n        repeat (10)\n            change [sy v] by ((((0) - (sy)) / (3)) - (0.3))\n        end\n        repeat (10)\n            change [sy v] by ((((15.5) - (sy)) / (3.5)) - (0.3))\n        end\n    else\n        set rotation style [left-right v]\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nset [max players v] to [8]\nset [my player # v] to [1]\nhide\nbroadcast (setup - opponents v) and wait\nswitch backdrop to (joining v)\nbroadcast (join game v) and wait\nif <(MY PLAYER #) > [0]> then\n    switch backdrop to (joined v)\n    wait (0.8) seconds\n    switch backdrop to (blank v)\n    broadcast (begin v)\n    show\nelse\n    switch backdrop to (full v)\nend\n\ndefine write (val) to encoded\nset [letter # v] to [1]\nrepeat (length of (val))\n    set [encoded v] to (join (encoded) (item # of (letter (letter #) of (val)) in [code v]))\n    change [letter # v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\nwhen I receive [begin v]\nforever\n    if <(MY PLAYER #) > [0]> then\n        send cloud data\n    end\nend\n\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ p1 v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ p2 v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ p3 v] to (value)\n        else\n            if <(player) = [4]> then\n                set [☁ p4 v] to (value)\n            else\n                if <(player) = [5]> then\n                    set [☁ p5 v] to (value)\n                else\n                    if <(player) = [6]> then\n                        set [☁ p6 v] to (value)\n                    else\n                        if <(player) = [7]> then\n                            set [☁ p7 v] to (value)\n                        else\n                            set [☁ p8 v] to (value)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine send cloud data\nset [encoded v] to []\nwrite (join (username) (join [ ] (item (say) of [chat v]))) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite ((SCROLL X) + (x position)) to encoded\nwrite ((SCROLL Y) + (y position)) to encoded\nwrite (costume) to encoded\nset cloud # (MY PLAYER #) to (encoded)\n\nwhen I receive [begin 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) > []>\n        Tick\n        broadcast (tick v)\n    end\n    if <(EXIT) = [win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\nwhen I receive [stopclicked v]\nhide\n\nwhen I receive [touch player v]\nset [exit v] to [die]\n\nwhen flag clicked\nforever\n    set [player: in air v] to (in air)\nend\n\nwhen flag clicked\nshow list [chat v]\nset [say v] to []\n\nwhen I receive [start v]\nforever\n    if <key (t v) pressed?> then\n        ask [] and wait\n        set [say v] to (answer)\n        say (say) for (2) seconds\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <(say) > []> then\n        wait (5) seconds\n        set [say v] to []\n    end\nend\n\nwhen I receive [start v]\nif <(say) > []> then\n    think (join (join (MY PLAYER #) (join [ : ] (username))) (join [- ] (item (say) of [chat v]))) for (3.5) seconds\nelse\n    think (join (MY PLAYER #) (join [ - ] (username))) for (3.5) seconds\nend\n\nwhen [right arrow v] key pressed\npoint in direction (90)\n\nwhen [left arrow v] key pressed\npoint in direction (-90)\n\nwhen [r v] key pressed\nbroadcast (effect v)\nhide\nwait (0.3) seconds\n\nwhen flag clicked\nswitch costume to (player v)\n\nwhen flag clicked\nset [jumpboost? v] to [1]\n\nwhen flag clicked\nset [jumpboost? v] to [0]\n\nwhen flag clicked\nforever\n    if <<key (space v) pressed?> and <(EmojiCHAT?) = [1]>> then\n        wait (0.3) seconds\n        next costume\n    end\nend\n\nwhen flag clicked\nbroadcast (start v)\n\nwhen flag clicked\nforever\n    if <touching color (#00ff15)?> then\n        hide\n        wait (1) seconds\n        broadcast (You won!!! v)\n    end\nend\n\nwhen flag clicked\nset [lives v] to [1]\n\nwhen [c v] key pressed\nask [] and wait\nif <(answer) = [Jackpot]> then\n    change [coins v] by (500)\nend\n\n@Danger\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [setup v]\ngo to [back v] layer\nset [danger: x v] to [-50]\nset [danger: y 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]\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]\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\ndefine clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nposition ((Danger: x) - (SCROLL X)) ((Danger: y) - (SCROLL Y))\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nshow list [code v]\n\nwhen [c v] key pressed\nshow list [code v]\n\nhide\n\nwhen flag clicked\nshow\nset [ghost v] effect to (0)\nforever\n    if <<(Cs) = [1]> and <(costume [number v]) = [13]>> then\n        repeat (50)\n            change [ghost v] effect by (-2)\n        end\n    end\nend\n\nwhen flag clicked\nset [cs v] to [0]\nforever\n    if <<(Cs) = [1]> and <(costume [number v]) = [14]>> then\n        repeat (50)\n            change [ghost v] effect by (-2)\n        end\n        hide\n    end\nend\n\n@Graphics\n\nwhen I receive [setup v]\nrepeat (1)\n    delete this clone\nend\nclone\n\ndefine clone\nclear graphic effects\nset [@offset_x v] to [-230]\nset [@offset_y v] to [-80]\nhide\nswitch costume to (2a v)\nClone [0] [0]\nswitch costume to (2a2 v)\nClone [400] [-100]\nswitch costume to (2b v)\nClone [350] [100]\nswitch costume to (2c v)\nClone [740] [195]\nswitch costume to (2d v)\nClone [480] [-150]\nswitch costume to (2e v)\nClone [500] [200]\nswitch costume to (2f v)\nClone [450] [-100]\nswitch costume to (2g v)\nClone [560] [-50]\nswitch costume to (2h v)\nClone [500] [100]\nswitch costume to (2j v)\nClone [280] [-50]\nswitch costume to (2l v)\nClone [-690] [-100]\nswitch costume to (2k v)\nClone [170] [400]\nswitch costume to (2m v)\nClone [-600] [300]\nswitch costume to (2n v)\nClone [-600] [400]\nswitch costume to (2p v)\nClone [-640] [0]\nswitch costume to (2q v)\nClone [-670] [200]\nswitch costume to (2r v)\nClone [-670] [-300]\nswitch costume to (2s v)\nClone [-600] [100]\nswitch costume to (2t v)\nClone [-60] [450]\nswitch costume to (2u v)\nClone [700] [300]\nswitch costume to (2v v)\nClone [560] [-50]\n\nwhen I receive [tick v]\nGo to (round ((@offset_x) - (SCROLL X))) ((round ((@offset_y) - (SCROLL Y))) + (Y_SHAKE))\n\ndefine Clone (x) (y)\nchange [@offset_x v] by (x)\nchange [@offset_y v] by (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo to [back v] layer\nGo to (round ((@offset_x) - (SCROLL X))) ((round ((@offset_y) - (SCROLL Y))) + (Y_SHAKE))\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\n@Instructions\n\nwhen I receive [setup v]\nrepeat (1)\n    delete this clone\nend\nclone\n\ndefine clone\nclear graphic effects\nset [@offset_x v] to [-230]\nset [@offset_y v] to [-80]\nhide\nswitch costume to (2a v)\nClone [0] [0]\nswitch costume to (2a2 v)\nClone [400] [-100]\nswitch costume to (2b v)\nClone [350] [100]\nswitch costume to (2c v)\nClone [740] [195]\nswitch costume to (2d v)\nClone [480] [-150]\nswitch costume to (2e v)\nClone [500] [200]\nswitch costume to (2f v)\nClone [450] [-100]\nswitch costume to (2g v)\nClone [560] [-50]\nswitch costume to (2h v)\nClone [500] [100]\nswitch costume to (2j v)\nClone [280] [-50]\nswitch costume to (2l v)\nClone [-690] [-100]\nswitch costume to (2k v)\nClone [170] [400]\nswitch costume to (2m v)\nClone [-600] [300]\nswitch costume to (2n v)\nClone [-600] [400]\nswitch costume to (2p v)\nClone [-640] [0]\nswitch costume to (2q v)\nClone [-670] [200]\nswitch costume to (2r v)\nClone [-670] [-300]\nswitch costume to (2s v)\nClone [-600] [100]\nswitch costume to (2t v)\nClone [-60] [450]\nswitch costume to (2u v)\nClone [700] [300]\nswitch costume to (blank v)\n\nwhen I receive [tick v]\nGo to (round ((@offset_x) - (SCROLL X))) ((round ((@offset_y) - (SCROLL Y))) + (Y_SHAKE))\n\ndefine Clone (x) (y)\nchange [@offset_x v] by (x)\nchange [@offset_y v] by (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo to [back v] layer\nGo to (round ((@offset_x) - (SCROLL X))) ((round ((@offset_y) - (SCROLL Y))) + (Y_SHAKE))\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@End\n\nwhen I receive [setup v]\nrepeat (1)\n    delete this clone\nend\nclone\n\ndefine clone\nclear graphic effects\nset [@offset_x v] to [-230]\nset [@offset_y v] to [-80]\nhide\nswitch costume to (2a v)\nClone [0] [0]\nswitch costume to (2a2 v)\nClone [400] [-100]\nswitch costume to (2b v)\nClone [350] [100]\nswitch costume to (2c v)\nClone [740] [195]\nswitch costume to (2d v)\nClone [480] [-150]\nswitch costume to (2e v)\nClone [500] [200]\nswitch costume to (2f v)\nClone [450] [-100]\nswitch costume to (2g v)\nClone [560] [-50]\nswitch costume to (2h v)\nClone [500] [100]\nswitch costume to (2j v)\nClone [280] [-50]\nswitch costume to (2l v)\nClone [-690] [-100]\nswitch costume to (2k v)\nClone [170] [400]\nswitch costume to (2m v)\nClone [-600] [300]\nswitch costume to (2n v)\nClone [-600] [400]\nswitch costume to (2p v)\nClone [-640] [0]\nswitch costume to (2q v)\nClone [-670] [200]\nswitch costume to (2r v)\nClone [-670] [-300]\nswitch costume to (2s v)\nClone [-600] [100]\nswitch costume to (2t v)\nClone [-60] [450]\nswitch costume to (2u v)\nClone [700] [300]\nswitch costume to (blank v)\n\nwhen I receive [tick v]\nGo to (round ((@offset_x) - (SCROLL X))) ((round ((@offset_y) - (SCROLL Y))) + (Y_SHAKE))\n\ndefine Clone (x) (y)\nchange [@offset_x v] by (x)\nchange [@offset_y v] by (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo to [back v] layer\nGo to (round ((@offset_x) - (SCROLL X))) ((round ((@offset_y) - (SCROLL Y))) + (Y_SHAKE))\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (You won!!! v)\n    end\nend\n\n@Coins\n\ndefine Clone me at (x) (y)\nset [collectibles: x v] to (x)\nset [collectibles: y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\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 [tick v]\nPosition ((Collectibles: x) - (SCROLL X)) ((Collectibles: y) - (SCROLL Y))\nif <<touching (player v)?> and <(costume [number v]) = [1]>> then\n    change [coins v] by (1)\n    delete this clone\nend\nif <<touching (player v)?> and <(costume [number v]) = [2]>> then\n    change [coins v] by (10)\n    delete this clone\nend\nif <<touching (player v)?> and <(costume [number v]) = [3]>> then\n    change [cs v] by (1)\n    broadcast (Hide spikes v)\n    change [coins v] by (10)\n    delete this clone\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nforever\n    set [coins v] to (collected)\nend\n\nwhen I receive [begin v]\nhide\n\nwhen flag clicked\nset [costume# v] to [0]\n\nwhen I receive [begin v]\nset [collected v] to [0]\nset [collected max v] to < and >\nset [collectibles: x v] to [0]\nif <(LEVEL) = [1]> then\n    Clone me at [310] [150]\n    Clone me at [720] [-16]\n    Clone me at [690] [-16]\n    Clone me at [660] [-16]\n    Clone me at [2330] [-270]\n    Clone me at [2360] [-270]\n    Clone me at [2390] [-270]\n    switch costume to (2 v)\n    Clone me at [2300] [-270]\n    switch costume to (1 v)\n    Clone me at [960] [450]\n    Clone me at [950] [450]\n    Clone me at [1020] [450]\n    Clone me at [1050] [450]\n    Clone me at [1080] [450]\n    Clone me at [2850] [705]\n    Clone me at [2880] [705]\n    Clone me at [2600] [840]\n    Clone me at [2635] [840]\n    switch costume to (3 v)\n    Clone me at [5000] [-50]\n    switch costume to (1 v)\nend\nset [collectibles: x v] to [-999999]\nset [collectibles: y v] to [0]\nhide\n\n@USER_INTERFACE\n\nwhen flag clicked\nSETUP\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(openmenu?) = [0]> then\n            show\n            switch costume to (button v)\n            set [ypos_menu v] to [0]\n            repeat until <(ypos_menu) < [-35]>\n                change [ypos_menu v] by (((ypos_menu) - (2)) / (4))\n            end\n            hide\n            set [move_layering v] to [1]\n            go to [front v] layer\n            switch costume to (s000 v)\n            set [ypos_menu v] to [-225]\n            show\n            repeat until <(ypos_menu) > [-1]>\n                if <(ypos_menu) > [-60]> then\n                    change [ypos_menu v] by (((3) - (ypos_menu)) / (6))\n                else\n                    change [ypos_menu v] by (13)\n                end\n            end\n            set [openmenu? v] to [1]\n            wait until <not <mouse down?>>\n        end\n    end\n    if <<not <touching (mouse-pointer v)?>> and <mouse down?>> then\n        if <(openmenu?) = [1]> then\n            go to [front v] layer\n            switch costume to (s000 v)\n            set [ypos_menu v] to [0]\n            repeat until <(ypos_menu) < [-225]>\n                if <(y position) < [-50]> then\n                    change [ypos_menu v] by (-14)\n                else\n                    change [ypos_menu v] by (((ypos_menu) - (2)) / (4))\n                end\n            end\n            hide\n            set [move_layering v] to [0]\n            switch costume to (button v)\n            set [ypos_menu v] to [-36]\n            show\n            repeat until <(ypos_menu) > [-0.2]>\n                change [ypos_menu v] by (((1) - (ypos_menu)) / (6))\n            end\n            set [openmenu? v] to [0]\n            wait until <not <mouse down?>>\n        end\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nif <(costume [name v]) = [coins]> then\n    go to x: (0) y: (0)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nelse\n    if <(letter (1) of (@clone)) = [v]> then\n        set [ghost v] effect to (100)\n        set [brightness v] effect to (100)\n        forever\n            RenderCoin_Value\n        end\n    end\nend\n\nwhen I receive [tick v]\nlayering/movement\n\nwhen [e v] key pressed\nif <(username) = [MXNHD]> then\n    change [coins v] by (10)\nend\n\nwhen flag clicked\nforever\n    if <(openmenu?) = [1]> then\n        if <<mouse down?> and <<<(mouse x) > [72]> and <(mouse x) < [154]>> and <<(mouse y) > [-158]> and <(mouse y) < [-112]>>>> then\n            if <(coins) > [39]> then\n                set [bought v] to (join (letter (1) of (bought)) (join (letter (2) of (bought)) [1]))\n                change [coins v] by (-40)\n                set [emojichat? v] to [1]\n                check\n                set [@clone v] to [f3]\n                create clone of (_myself_ v)\n                stop [this script v]\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(openmenu?) = [1]> then\n        if <<<<(mouse x) > [72]> and <(mouse x) < [154]>> and <<(mouse y) > [-56]> and <(mouse y) < [-10]>>> and <mouse down?>> then\n            if <(coins) > [19]> then\n                set [bought v] to (join [1] (join (letter (2) of (bought)) (letter (3) of (bought))))\n                change [coins v] by (-20)\n                change [lives v] by (1)\n                check\n                wait until <not <mouse down?>>\n            end\n        end\n    end\n    if <(openmenu?) = [1]> then\n        set [clickshop v] to [1]\n    else\n        if <touching (mouse-pointer v)?> then\n            set [clickshop v] to [1]\n        else\n            set [clickshop v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nset [bought v] to [000]\nset [emojichat? v] to [0]\nset [jumpboost? v] to [0]\nset [move_layering v] to [0]\nforever\n    if <(openmenu?) = [1]> then\n        if <<mouse down?> and <<<(mouse x) > [72]> and <(mouse x) < [154]>> and <<(mouse y) > [-107]> and <(mouse y) < [-61]>>>> then\n            if <(coins) > [29]> then\n                set [bought v] to (join (letter (1) of (bought)) (join [1] (letter (3) of (bought))))\n                change [coins v] by (-30)\n                set [jumpboost? v] to [1]\n                check\n                set [@clone v] to [f2]\n                create clone of (_myself_ v)\n                stop [this script v]\n            end\n        end\n    end\nend\n\ndefine check\nset [@clone v] to [check]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(@clone) = [check]> then\n    switch costume to (zcheck v)\n    go to (mouse-pointer v)\n    set [ghost v] effect to (100)\n    show\n    set size to (10) %\n    repeat until <(size) > [90]>\n        change [ghost v] effect by (-15)\n        change size by (((size) - (5)) / (3))\n    end\n    repeat until <(size) > [135]>\n        change size by (((137) - (size)) / (2))\n    end\n    repeat until <(size) < [90]>\n        change size by (((size) - (89)) / (-3))\n    end\n    wait (0.5) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(letter (1) of (@clone)) = [f]> then\n    switch costume to (join [front] (letter (2) of (@clone)))\n    go to x: (0) y: (0)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\ndefine goto\nset y to (ypos_menu)\n\nwhen I receive [win!! v]\nrepeat (30)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [hide v]\nshow\nrepeat (30)\n    change [ghost v] effect by (-10)\nend\n\ndefine SETUP\ngo to x: (0) y: (0)\ngo to [front v] layer\nset size to (100) %\nhide\nset [lives v] to [2]\nset [@clone v] to [1]\nrepeat (5)\n    switch costume to (heart v)\n    create clone of (_myself_ v)\n    change [@clone v] by (1)\n    change x by (35)\nend\nswitch costume to (coins v)\nset [@clone v] to [coins]\ncreate clone of (_myself_ v)\nset [openmenu? v] to [0]\nset size to (35) %\nswitch costume to (3a v)\ngo to x: (190) y: (147)\nset [@clone v] to [val1]\nrepeat (3)\n    create clone of (_myself_ v)\n    set [@clone v] to (join [val] ((letter (4) of (@clone)) + (1)))\n    change x by (15)\nend\nswitch costume to (button v)\nset size to (100) %\nshow\nset [ypos_menu v] to [0]\ngo to x: (0) y: (0)\nclear graphic effects\n\ndefine RenderCoin_Value\nif <(letter (4) of (@clone)) = [1]> then\n    switch costume to (join (letter (1) of (coins)) [a])\n    change [ghost v] effect by (-10)\nelse\n    if <(letter (4) of (@clone)) = [2]> then\n        switch costume to (join (letter (2) of (coins)) [a])\n        change [ghost v] effect by (-10)\n        if <(letter (1) of (coins)) = [1]> then\n            set x to (202)\n        else\n            set x to (205)\n        end\n    else\n        if <(letter (4) of (@clone)) = [3]> then\n            switch costume to (join (letter (3) of (coins)) [a])\n            change [ghost v] effect by (-10)\n            if <<(letter (2) of (coins)) = [1]> or <(letter (1) of (coins)) = [1]>> then\n                if <<(letter (1) of (coins)) = [1]> and <(letter (2) of (coins)) = [1]>> then\n                    set x to (214)\n                else\n                    set x to (217)\n                end\n            else\n                set x to (220)\n            end\n        end\n    end\nend\n\ndefine layering/movement\nif <(costume [name v]) = [heart]> then\n    if <(@clone) > (lives)> then\n        change [ghost v] effect by (25)\n    else\n        change [ghost v] effect by (-25)\n    end\nend\nif <<(costume [name v]) = [coins]> or <(costume [name v]) = [heart]>> then\n    set y to (Y_SHAKE)\n    go to [front v] layer\n    go [backward v] (15) layers\nelse\n    if <<<<not <(costume [name v]) = [button]>> and <not <(letter (1) of (costume [name v])) = [S]>>> and <not <(costume [name v]) = [Zcheck]>>> and <not <(letter (1) of (costume [name v])) = [f]>>> then\n        set y to ((Y_SHAKE) + (147))\n    else\n        if <(letter (1) of (costume [name v])) = [S]> then\n            go to [front v] layer\n            go [backward v] (9) layers\n        else\n            if <(letter (1) of (costume [name v])) = [f]> then\n                go to [front v] layer\n                go [backward v] (4) layers\n            else\n                go to [front v] layer\n            end\n        end\n    end\nend\nif <(letter (1) of (costume [name v])) = [S]> then\n    if <<<(mouse x) > [72]> and <(mouse x) < [154]>> and <<(mouse y) > [-56]> and <(mouse y) < [-10]>>> then\n        go to [front v] layer\n        switch costume to (s100 v)\n    else\n        if <<<(mouse x) > [72]> and <(mouse x) < [154]>> and <<(mouse y) > [-107]> and <(mouse y) < [-61]>>> then\n            go to [front v] layer\n            switch costume to (s010 v)\n        else\n            if <<<(mouse x) > [72]> and <(mouse x) < [154]>> and <<(mouse y) > [-158]> and <(mouse y) < [-112]>>> then\n                go to [front v] layer\n                switch costume to (s001 v)\n            else\n                go to [front v] layer\n                switch costume to (s000 v)\n            end\n        end\n    end\nend\nif <<<(letter (1) of (costume [name v])) = [S]> or <(letter (1) of (@clone)) = [f]>> and <(move_Layering) = [1]>> then\n    goto\nend\nif <(costume [name v]) = [button]> then\n    goto\nend\n\nwhen flag clicked\nset [coins v] to [0]\n\n@Sprite2\n\nwhen flag clicked\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    wait (0.01) seconds\n    change [ghost v] effect by (10)\nend\nwait (2) seconds\nrepeat (10)\n    wait (0.01) seconds\n    change [ghost v] effect by (-10)\nend\nrepeat until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\n    wait (pick random (5) to (15)) seconds\n    Fade in\nend\n\ndefine Fade in\nrepeat (10)\n    wait (0.01) seconds\n    change [ghost v] effect by (10)\nend\nwait (2) seconds\nrepeat (10)\n    wait (0.01) seconds\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\nif <<(LOVED__) = [1]> and <(FAVED___) = [1]>> then\n    change [coins v] by (10)\n    hide\n    stop [other scripts in sprite v]\nend\n\nwhen I receive [+10 coins v]\nchange [coins v] by (10)\n\nwhen I receive [free rewards v]\nhide\nstop [other scripts in sprite v]\n\n@Water\n\nwhen flag clicked\nforever\n    go [backward v] (4) layers\n    go to x: (0) y: (0)\n    set [ghost v] effect to (60)\nend\n\ndefine Clone (x) (y)\nchange [@offset_x v] by (x)\nchange [@offset_y v] by (y)\ncreate clone of (_myself_ v)\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\ndefine clone\nclear graphic effects\nset [@offset_x v] to [-230]\nset [@offset_y v] to [-80]\nhide\nswitch costume to (1 v)\nClone [500] [80]\nswitch costume to (15 v)\nClone [3000] [-10]\n\nwhen I receive [setup v]\nrepeat (1)\n    delete this clone\nend\nclone\n\nwhen I receive [tick v]\nGo to (round ((@offset_x) - (SCROLL X))) ((round ((@offset_y) - (SCROLL Y))) + (Y_SHAKE))\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo to [back v] layer\nGo to (round ((@offset_x) - (SCROLL X))) ((round ((@offset_y) - (SCROLL Y))) + (Y_SHAKE))\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@You WIn!!!\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen I receive [you won!!! v]\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\n@Danger2\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [setup v]\ngo to [back v] layer\nset [danger: x v] to [-50]\nset [danger: y 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]\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]\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\ndefine clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nposition ((Danger: x) - (SCROLL X)) ((Danger: y) - (SCROLL Y))\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nshow list [code v]\n\nwhen [c v] key pressed\nshow list [code v]\n\nhide\n\nwhen flag clicked\nshow\nset [ghost v] effect to (0)\nforever\n    if <<(Cs) = [1]> and <(costume [number v]) = [13]>> then\n        repeat (50)\n            change [ghost v] effect by (-2)\n        end\n    end\nend\n\nwhen flag clicked\nset [cs v] to [0]\nforever\n    if <<(Cs) = [1]> and <(costume [number v]) = [14]>> then\n        repeat (50)\n            change [ghost v] effect by (-2)\n        end\n        hide\n    end\nend\n\nwhen I receive [hide spikes v]\nrepeat (50)\n    change [ghost v] effect by (-2)\n    hide\n    delete this clone\nend\n\nwhen I start as a clone\nset [ghost v] effect to (0)\n\nwhen flag clicked\nset [ghost v] effect to (0)\n\n@multiplayer v3.0\n\ndefine decode (i)\nset [multiplayer v3.0: c1 v] to [1]\nrepeat until <(multiplayer v3.0: c1) > (length of (i))>\n    set [output v] to []\n    repeat until <(join (letter (multiplayer v3.0: c1) of (i)) (letter ((multiplayer v3.0: c1) + (1)) of (i))) < [1]>\n        switch costume to ((join (letter (multiplayer v3.0: c1) of (i)) (letter ((multiplayer v3.0: c1) + (1)) of (i))) - (9))\n        set [output v] to (join (output) (letter (1) of (costume [name v])))\n        change [multiplayer v3.0: c1 v] by (2)\n    end\n    add (output) to [cloud_data v]\n    change [multiplayer v3.0: c1 v] by (2)\nend\n\ndefine encode (i)\nset [multiplayer v3.0: c1 v] to [1]\nrepeat until <(multiplayer v3.0: c1) > (length of (i))>\n    switch costume to (join (letter (multiplayer v3.0: c1) of (i)) [x])\n    set [output v] to (join (output) ((costume [number v]) + (9)))\n    change [multiplayer v3.0: c1 v] by (1)\nend\nset [output v] to (join (output) [00])\n\nwhen flag clicked\ncreate clone of (_myself_ v)\nsetup\nwait until <(w_Tick) > [3]>\nwait (0.1) seconds\ndetermine_ID\nbroadcast (cloud_players v)\n\ndefine setup\nset [@c v] to [0]\nset [playerid v] to [null]\nset [w_tick v] to [0]\ndelete all of [active_tick v]\ndelete all of [cloud_data v]\ndelete all of [active_check v]\ndelete all of [last_val v]\nset [names v] to [0]\nset [active check v] to [0]\nrepeat (10)\n    add [4] to [active_tick v]\n    add [null] to [active_check v]\n    add [9999] to [last_val v]\nend\nimport_clouddata\nbroadcast (cloud_start v)\n\nwhen I receive [cloud_start v]\nif <(@c) = [0]> then\n    forever\n        process [0]\n        wait (0.4) seconds\n        process [1]\n    end\nend\n\ndefine process (i)\nif <(i) = [0]> then\n    set [multiplayer v3.0: c1 v] to [0]\n    repeat (10)\n        change [multiplayer v3.0: c1 v] by (1)\n        replace item (multiplayer v3.0: c1) of [last_val v] with (item (((multiplayer v3.0: c1) * (6)) - (3)) of [cloud_data v])\n    end\nelse\n    set [multiplayer v3.0: c1 v] to [0]\n    repeat (10)\n        change [multiplayer v3.0: c1 v] by (1)\n        if <(item (((multiplayer v3.0: c1) * (6)) - (3)) of [cloud_data v]) = (item (multiplayer v3.0: c1) of [last_val v])> then\n            if <(item (multiplayer v3.0: c1) of [active_tick v]) < [4]> then\n                replace item (multiplayer v3.0: c1) of [active_tick v] with ((item (multiplayer v3.0: c1) of [active_tick v]) + (1))\n            end\n        else\n            replace item (multiplayer v3.0: c1) of [active_tick v] with [0]\n        end\n        replace item (multiplayer v3.0: c1) of [active_check v] with ((1) - <(item (multiplayer v3.0: c1) of [active_tick v]) = [4]>)\n    end\n    if <(w_Tick) < [4]> then\n        change [w_tick v] by (1)\n    end\nend\n\nwhen I receive [cloud_start v]\nif <(@c) = [0]> then\n    forever\n        broadcast (cloud_tick v)\n    end\nend\n\ndefine export_clouddata\nset [output v] to []\nencode (round ((SCROLL X) + ([x position v] of [player v])))\nencode (round ((SCROLL Y) + ([y position v] of [player v])))\nencode (pick random (1000) to (9999))\nencode (username)\nencode (chat item)\nencode ([costume name v] of [player v])\nif <(playerID) = [1]> then\n    set [☁ cloud1 v] to (output)\nelse\n    if <(playerID) = [2]> then\n        set [☁ cloud2 v] to (output)\n    else\n        if <(playerID) = [3]> then\n            set [☁ cloud3 v] to (output)\n        else\n            if <(playerID) = [4]> then\n                set [☁ cloud4 v] to (output)\n            else\n                if <(playerID) = [5]> then\n                    set [☁ cloud5 v] to (output)\n                else\n                    if <(playerID) = [6]> then\n                        set [☁ cloud6 v] to (output)\n                    else\n                        if <(playerID) = [7]> then\n                            set [☁ cloud7 v] to (output)\n                        else\n                            if <(playerID) = [8]> then\n                                set [☁ cloud8 v] to (output)\n                            else\n                                if <(playerID) = [9]> then\n                                    set [☁ cloud9 v] to (output)\n                                else\n                                    if <(playerID) = [10]> then\n                                        set [☁ cloud10 v] to (output)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nstop [this script v]\n\ndefine import_clouddata\ndelete all of [cloud_data v]\ndecode (☁ Cloud1)\ndecode (☁ Cloud2)\ndecode (☁ Cloud3)\ndecode (☁ Cloud4)\ndecode (☁ Cloud5)\ndecode (☁ Cloud6)\ndecode (☁ Cloud7)\ndecode (☁ Cloud8)\ndecode (☁ Cloud9)\ndecode (☁ Cloud10)\nset [active check v] to [0]\nset [multiplayer v3.0: c1 v] to [0]\nrepeat (10)\n    change [multiplayer v3.0: c1 v] by (1)\n    if <(item (multiplayer v3.0: c1) of [active_check v]) = [1]> then\n        change [active check v] by (1)\n    end\nend\n\ndefine determine_ID\nset [multiplayer v3.0: c1 v] to [0]\nrepeat (10)\n    change [multiplayer v3.0: c1 v] by (1)\n    if (item (multiplayer v3.0: c1) of [active_check v]) then\nend\nset [playerid v] to [full]\n\nwhen I receive [cloud_players v]\nif <(@c) = [0]> then\n    wait (0.3) seconds\n    forever\n        check\n    end\nend\n\nwhen I receive [cloud_players v]\nif <(@c) = [0]> then\n    forever\n        export_clouddata\n    end\nend\n\ndefine check\nif <<(username) = (item (((playerID) * (6)) - (2)) of [cloud_data v])> or <<(playerID) = [null]> or <<(playerID) = [full]> or <(playerID) = [error]>>>> then\nif <<key (any v) pressed?> or <mouse down?>> then\n    set [tick_afk v] to [0]\nend\n\nwhen I receive [cloud_start v]\nif <(@c) = [0]> then\n    forever\n        import_clouddata\n    end\nend\n\nwhen I receive [localfade v]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nset [@c v] to [1]\nset [ghost v] effect to (100)\nshow\ngo to x: (0) y: (80)\nswitch costume to (connecting v)\nwait (0.4) seconds\nrepeat until <(y position) < [1]>\n    change y by (((-2) - (y position)) / (9))\n    change [ghost v] effect by (-10)\nend\nwait until <(w_Tick) > [3]>\nwait (0.6) seconds\nif <(playerID) = [error]> then\nelse\n    if <(playerID) = [full]> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        switch costume to (full v)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait (3) seconds\n        repeat until <(y position) > [80]>\n            change y by (((y position) - (-12)) / (8))\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    else\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        switch costume to (connected v)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait (3) seconds\n        repeat until <(y position) > [80]>\n            change y by (((y position) - (-12)) / (8))\n            change [ghost v] effect by (8)\n        end\n    end\nend\n\nwhen I receive [cloud_tick v]\nif <(@c) = [1]> then\n    go to [front v] layer\nend\n\nwhen I receive [cloud_error v]\nif <(@c) = [1]> then\n    stop [other scripts in sprite v]\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    switch costume to (error v)\n    go to x: (0) y: (0)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (3) seconds\n    repeat until <(y position) > [80]>\n        change y by (((y position) - (-12)) / (8))\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nset [tick_afk v] to [0]\nforever\n    wait (1) seconds\n    change [tick_afk v] by (1)\n    if <(tick_afk) > [60]> then\n        if <<(playerID) = [full]> or <(playerID) = [error]>> then\n    end\nend\n\n@@PLAYERS\n\nwhen I receive [cloud_players v]\nswitch costume to (blank v)\nset [@id v] to [1]\nrepeat (10)\n    if <(@ID) = (playerID)> then\n    change [@id v] by (1)\nend\ngo to x: (999) y: (999)\n\nwhen I start as a clone\nswitch costume to (3a v)\nset [ghost v] effect to (100)\nsay []\nset rotation style [all around v]\ngo to [front v] layer\n\nwhen flag clicked\nhide\nset [names v] to [0]\n\ndefine @Position XY (@player)\nif <(costume [name v]) = [blank]> then\n    hide\nelse\n    if <(costume [name v]) = [arrow]> then\n        move ((0) - (d)) steps\n    end\n    change x by (((((item (((@player) * (6)) - (5)) of [cloud_data v]) + (([x position v] of [player v]) * (-0.25))) - (SCROLL X)) - (x position)) / (2.5555555))\n    change y by (((((item (((@player) * (6)) - (4)) of [cloud_data v]) + (((-28) - ([y position v] of [player v])) * (0.12))) - (SCROLL Y)) - (y position)) / (2.5555555))\n    go to x: (round (x position)) y: (round (y position))\n    switch costume to (join (item ((@player) * (6)) of [cloud_data v]) [a])\n    show\n    if <<<(x position) < [-250]> or <(x position) > [250]>> or <<(y position) < [-190]> or <(y position) > [190]>>> then\n        switch costume to (arrow v)\n        point in direction (([atan v] of ((x position) / (y position)) ) + (<not <[0] > (y position)>> * (180)))\n        set [d v] to ((32) + ((([abs v] of (x position) ) / (20)) + (([abs v] of (y position) ) / (25))))\n        move (d) steps\n    else\n        if <<<(x position) > [-250]> and <(x position) < [250]>> and <<(y position) < [190]> and <(y position) > [-190]>>> then\n            switch costume to (item ((@player) * (6)) of [cloud_data v])\n            point in direction (90)\n        end\n    end\n    if <(item (@player) of [active_check v]) = [1]> then\n        change [ghost v] effect by (-20)\n        if <<(item (((@player) * (6)) - (1)) of [cloud_data v]) > [9]> or <(item (((@player) * (6)) - (1)) of [cloud_data v]) = [0]>> then\n            if <<(names) = [1]> or <touching (mouse-pointer v)?>> then\n                say (item (((@player) * (6)) - (2)) of [cloud_data v])\n            else\n                if <not <(costume [name v]) = [arrow]>> then\n                    say (item (((@player) * (6)) - (2)) of [cloud_data v])\n                else\n                    say []\n                end\n            end\n        else\n            say (item (item (((@player) * (6)) - (1)) of [cloud_data v]) of [chat list v])\n        end\n    else\n        change [ghost v] effect by (20)\n        say []\n    end\nend\nstop [this script v]\n\nwhen I receive [cloud_tick v]\n@Position XY (@ID)\n\n@Detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nbroadcast (FREE REWARDS v)\n\ngo to x: (0) y: (0)\nshow\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    show\nend\n\n
Reshared to due to mass reporting\nFINALLY! After 15+ hours of work over 2 weeks, countless minutes spent programming and fixing bugs, it's finally finished: The valley- a multiplayer scrolling platformer!\nDon't report. This and @MXNHD are the original. There was a project who copied mine and came in trending\nThis is a collab between me and @MXNHD\n\nCONTROLS:\n-Arrow keys to move\n-Avoid spikes\n-Collect coins to buy things from the shop\n-T to open chat\n-Love and favorite to get 10 coins for free!\n-There is a little cheat that you can activate to get 500 coins, just for fun ;)\n\nIf you enjoyed it, don't forget to ❤️, ⭐, and follow @WorkshopX!