Crystal Valley - A Multiplayer Scrolling Platformer

Instructions: Crystal Valley - A Multiplayer Scrolling Platformer\nA Collab With @-Mr-A-\n\n******Spam the green flag several times*************\nRe-shared on 12th Feb for a bug update\n\nInfo -\nHi There! your Job is to find a rare crystal which is\nDeep inside the valley also avoid crystal saws and don't fall down...\n\nInstructions -\n- Use Arrow keys/WAD/Mobile Controls to Move\n- Up arrow/w/Mobile Controls - Jump\n- Left arrow/a/Mobile Controls - To go left\n- Right arrow/d/Mobile Controls - To go right\n- r - red skin\n- b - blue skin\n- g - green skin\n\nCredits -\n-Platform art - @InfinitelyUseless\n-Grass and tree art - @AUMSUMTHEGREATHULK\n-Checkpoint art - @Suhalo_351\n-Parallax code - @StratfordJames\n-Music - @-Xaf-\nText - CollText\nCheck out -Mr-A-'s version too - https://scratch.mit.edu/projects/470495145/\n\nFeatures -\n- Multiplayer , Scrolling\n- Change skins\n- Chat\n- Emoji Chat\n- Arrows\n- Background Arts\n- Moving Platfomers\n\nTags -\n#all#all#all#all#all#all#all#all#all#all#all#all#all#all#all#Games#Games#Games#Games#Games#Games#Games#Games#Games#Games#Games#Games#Platformer#Platformer#Platformer#Platformer#Platformer#Platformer#Platformer#Platformer#Platformer#Platformer#Platformer#Platformer#Collab#Collab#Collab#Collab#Collab#Collab#Collab#Collab#Collab#GunaSwmainatan#GunaSwmainatan#GunaSwmainatan#GunaSwmainatan#GunaSwmainatan#GunaSwmainatan#AngadKocharRocksYT#AngadKocharRocksYT#AngadKocharRocksYT#AngadKocharRocksYT#AngadKocharRocksYT#AngadKocharRocksYT#AngadKocharRocksYT#AngadKocharRocksYT#AngadKocharRocksYT#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Guna#Trending

@Stage\n\nwhen [m v] key pressed\nif <<(username) = [AngadTest]> or <<(username) = [AngadKocharRocksYT]> or <<(username) = [GunaSwaminatan]> or <(username) = [GS_test]>>>> then\n    show variable [mouse x,y v]\n    set [mouse x,y v] to (join ((mouse x) + (SCROLL X)) (join [,] ((mouse y) + (SCROLL Y))))\nend\n\nwhen flag clicked\nforever\n    play sound [Super World v] until done\nend\n\n@Player\n\ndefine Reset\nif <(CHECKPOINT) = [0]> then\n    set [x v] to [0]\n    set [y v] to [0]\n    set [scroll y v] to (y)\n    set [scroll x v] to (x)\nelse\n    if <(CHECKPOINT) = [1]> then\n        set [x v] to [1900]\n        set [y v] to [20]\n        set [scroll y v] to (y)\n        set [scroll x v] to (x)\n    else\n        if <(CHECKPOINT) = [2]> then\n            set [x v] to [3200]\n            set [y v] to [-80]\n            set [scroll y v] to (y)\n            set [scroll x v] to (x)\n        else\n            if <(CHECKPOINT) = [3]> then\n                set [x v] to [5600]\n                set [y v] to [-80]\n                set [scroll y v] to (y)\n                set [scroll x v] to (x)\n            else\n                if <(CHECKPOINT) = [4]> then\n                    set [x v] to [6600]\n                    set [y v] to [-80]\n                    set [scroll y v] to (y)\n                    set [scroll x v] to (x)\n                else\n                    if <(CHECKPOINT) = [5]> then\n                        set [x v] to [8600]\n                        set [y v] to [-80]\n                        set [scroll y v] to (y)\n                        set [scroll x v] to (x)\n                    end\n                end\n            end\n        end\n    end\nend\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [10]\nset [timeout v] to [1000]\nset [exit v] to []\nset size to (100) %\nshow\nset rotation style [left-right v]\n\nwhen I receive [begin v]\nset [chat2 v] to [0]\nshow list [chat v]\nforever\n    Chat\nend\n\nwhen I receive [play game v]\nset [connected? v] to [0]\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\ndefine Change Player x by (sx)\npoint in direction (90)\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 <<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w 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 flag clicked\npoint in direction (90)\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\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 Game On\nset [y v] to [0]\nset [x v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [ghost v] effect to (0)\n\ndefine Test - Die\nif <touching ( crystal saws v)?> then\n    start sound [Hurt v]\n    set [exit v] to [die]\n    Reset\nend\n\ndefine Game - Die\nset [exit v] to []\nstart sound [Hurt v]\nReset\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 [level2 v] by (1)\nwait (1) seconds\n\ndefine Tick\nif <<<(mouse x) < (x position)> and <mouse down?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    change [sx v] by (-2)\nend\nif <<<(x position) < (mouse x)> and <mouse down?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> 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 <<<(y position) < (mouse y)> and <mouse down?>> or <<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\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    start sound [Hurt v]\n    set [exit v] to [die]\n    Reset\nend\nif <(x) < [-220]> then\n    set [x v] to [-220]\nend\n\nwhen flag clicked\nhide\nset [max players v] to [8]\nset [my player # v] to [0]\nbroadcast (Connecting v)\nbroadcast (Setup Others v) and wait\nbroadcast (Join Game v) and wait\nif <(MY PLAYER #) > [0]> then\n    broadcast (Connected v)\n    start sound [Connect v]\nelse\n    broadcast (Full v)\n    start sound [Disconnect v]\nend\nbroadcast (Begin v)\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                            if <(player) = [8]> then\n                                set [☁ p8 v] to (value)\n                            else\n                                if <(player) = [9]> then\n                                    set [☁ p9 v] to (value)\n                                else\n                                    if <(player) = [10]> then\n                                        set [☁ p10 v] to (value)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\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 send cloud data\nset [encoded v] to []\nwrite (username) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite (x) to encoded\nwrite (y) to encoded\nwrite (Chat Words) to encoded\nset cloud # (MY PLAYER #) to (encoded)\n\ndefine Chat\nif <key (1 v) pressed?> then\n    set [chat words v] to [1]\n    say [Hi!]\n    wait (2) seconds\n    say []\n    set [chat words v] to [0]\nelse\n    if <key (2 v) pressed?> then\n        set [chat words v] to [2]\n        say [Bye!]\n        wait (2) seconds\n        say []\n        set [chat words v] to [0]\n    else\n        if <key (3 v) pressed?> then\n            set [chat words v] to [3]\n            say [Yes]\n            wait (2) seconds\n            say []\n            set [chat2 v] to [0]\n        else\n            if <key (4 v) pressed?> then\n                set [chat words v] to [4]\n                say [Help Please!]\n                wait (2) seconds\n                say []\n                set [chat words v] to [0]\n            else\n                if <key (5 v) pressed?> then\n                    set [chat words v] to [5]\n                    say [No]\n                    wait (2) seconds\n                    say []\n                    set [chat words v] to [0]\n                else\n                    if <key (6 v) pressed?> then\n                        set [chat words v] to [6]\n                        say [This Way!]\n                        wait (2) seconds\n                        say []\n                        set [chat words v] to [0]\n                    else\n                        if <key (7 v) pressed?> then\n                            set [chat words v] to [7]\n                            say [Lol!]\n                            wait (2) seconds\n                            say []\n                            set [chat words v] to [0]\n                        else\n                            if <key (8 v) pressed?> then\n                                set [chat words v] to [8]\n                                say [I Am Lagging :\(]\n                                wait (2) seconds\n                                say []\n                                set [chat words v] to [0]\n                            else\n                                if <key (9 v) pressed?> then\n                                    set [chat words v] to [9]\n                                    say [Got To Go!]\n                                    wait (2) seconds\n                                    say []\n                                    set [chat words v] to [0]\n                                else\n                                    if <key (g v) pressed?> then\n                                        set [chat words v] to [g]\n                                        say [😀]\n                                        wait (2) seconds\n                                        say []\n                                        set [chat words v] to [0]\n                                    else\n                                        if <key (h v) pressed?> then\n                                            set [chat words v] to [h]\n                                            say [😎]\n                                            wait (2) seconds\n                                            say []\n                                            set [chat words v] to [0]\n                                        else\n                                            if <key (j v) pressed?> then\n                                                set [chat words v] to [j]\n                                                say [😊]\n                                                wait (2) seconds\n                                                say []\n                                                set [chat words v] to [0]\n                                            else\n                                                if <key (k v) pressed?> then\n                                                    set [chat words v] to [k]\n                                                    say [😚]\n                                                    wait (2) seconds\n                                                    say []\n                                                    set [chat words v] to [0]\n                                                else\n                                                    if <key (l v) pressed?> then\n                                                        set [chat words v] to [l]\n                                                        say [🤯]\n                                                        wait (2) seconds\n                                                        say []\n                                                        set [chat words v] to [0]\n                                                    else\n                                                        set [chat words v] to [0]\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [connected v]\nset [connected? v] to [1]\nshow\n\nwhen I receive [connecting v]\nhide\n\nwhen I receive [play game v]\nforever\n    if <(Connected?) = [1]> then\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\n    end\nend\n\nwhen I receive [connected v]\nset [level2 v] to [1]\n\nbroadcast (Begin v)\n\nwhen I receive [begin v]\nswitch costume to (black v)\nforever\n    if <key (r v) pressed?> then\n        switch costume to (red v)\n    end\n    if <key (g v) pressed?> then\n        switch costume to (green v)\n    end\n    if <key (b v) pressed?> then\n        switch costume to (blue v)\n    end\n    broadcast (Tick v)\nend\n\nwhen I receive [blue v]\nswitch costume to (blue v)\n\nwhen I receive [green v]\nswitch costume to (green v)\n\nwhen I receive [red v]\nswitch costume to (red v)\n\nwhen I receive [tick v]\nset size to (90) %\n\n@Others\n\nwhen I receive [begin v]\nset [names v] to [1]\nforever\n    if <key (n v) pressed?> then\n        if <(names) = [1]> then\n            wait until <not <key (n v) pressed?>>\n            set [names v] to [0]\n        else\n            wait until <not <key (n v) pressed?>>\n            set [names v] to [1]\n        end\n    end\nend\n\nwhen I receive [setup others v]\nsetup players\n\ndefine setup players\nhide\nset [offline v] to [100]\nset [player # v] to [1]\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    change [player # v] by (1)\nend\n\ndefine value = cloud # (player)\nif <(player) = [1]> then\n    set [value v] to (☁ P1)\nelse\n    if <(player) = [2]> then\n        set [value v] to (☁ P2)\n    else\n        if <(player) = [3]> then\n            set [value v] to (☁ P3)\n        else\n            if <(player) = [4]> then\n                set [value v] to (☁ P4)\n            else\n                if <(player) = [5]> then\n                    set [value v] to (☁ P5)\n                else\n                    if <(player) = [6]> then\n                        set [value v] to (☁ P6)\n                    else\n                        if <(player) = [7]> then\n                            set [value v] to (☁ P7)\n                        else\n                            if <(player) = [8]> then\n                                set [value v] to (☁ P8)\n                            else\n                                if <(player) = [9]> then\n                                    set [value v] to (☁ P9)\n                                else\n                                    if <(player) = [10]> then\n                                        set [value v] to (☁ P10)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <(MY PLAYER #) = (player #)> then\n        set [offline v] to [100]\n        hide\n    else\n        Tick\n    end\nend\n\ndefine Tick\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    change [offline v] by (1)\n    if <(offline) = [100]> then\n        hide\n    end\nelse\n    set [last value v] to (join [A] (value))\n    if <(offline) > [99]> then\n        show\n    end\n    set [offline v] to [0]\nend\nbegin decode of (value)\nvalue = read from encoded\nif <(names) = [1]> then\n    say (join (player #) (join [:] (value)))\nelse\n    say []\nend\nvalue = read from encoded\nvalue = read from encoded\nset x to ((value) - (SCROLL X))\nvalue = read from encoded\nset y to (((value) - (SCROLL Y)) + (8))\nvalue = read from encoded\nbroadcast (Decode Chat v)\n\ndefine begin decode of (encoded)\nset [encoded v] to (encoded)\nset [letter # v] to [1]\n\ndefine value = read from encoded\nset [value v] to []\nforever\n    set [idx v] to (join (letter (letter #) of (encoded)) (letter ((letter #) + (1)) of (encoded)))\n    change [letter # v] by (2)\n    if <(idx) < [1]> then\n        stop [this script v]\n    end\n    set [value v] to (join (value) (item (idx) of [code v]))\nend\n\nwhen I receive [join game v]\nvalue = cloud # (player #)\nset [last value v] to (join [A] (value))\nwait (3) seconds\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    set [my player # v] to (player #)\nend\n\ndefine Decode Chat (chat)\nif <(chat) = [1]> then\n    say [Hi!] for (2) seconds\nelse\n    if <(chat) = [2]> then\n        say [Bye!] for (2) seconds\n    else\n        if <(chat) = [3]> then\n            say [Yes] for (2) seconds\n        else\n            if <(chat) = [4]> then\n                say [Help Please!] for (2) seconds\n            else\n                if <(chat) = [5]> then\n                    say [No] for (2) seconds\n                else\n                    if <(chat) = [6]> then\n                        say [This Way!] for (2) seconds\n                    else\n                        if <(chat) = [7]> then\n                            say [Lol!] for (2) seconds\n                        else\n                            if <(chat) = [8]> then\n                                say [I Am Lagging :\(] for (2) seconds\n                            else\n                                if <(chat) = [9]> then\n                                    say [Got To Go!] for (2) seconds\n                                else\n                                    if <(chat) = [g]> then\n                                        say [😀] for (2) seconds\n                                    else\n                                        if <(chat) = [h]> then\n                                            say [😎] for (2) seconds\n                                        else\n                                            if <(chat) = [j]> then\n                                                say [😊] for (2) seconds\n                                            else\n                                                if <(chat) = [k]> then\n                                                    say [😚] for (2) seconds\n                                                else\n                                                    if <(chat) = [l]> then\n                                                        say [🤯] for (2) seconds\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [decode chat v]\nDecode Chat (value)\n\n@Background art\n\nwhen I start as a clone\nif <<(costume [number v]) = [14]> or <(costume [number v]) = [17]>> then\n    forever\n        repeat (170)\n            change [platforms: x v] by (2)\n        end\n        repeat (170)\n            change [platforms: x v] by (-2)\n        end\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\ngo to [back v] layer\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nswitch costume to (level 1 1 v)\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\n\ndefine Position (x) (y)\nset size to (100) %\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 [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nswitch costume to (level 1 1 v)\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\n\ndefine Position (x) (y)\nset size to (100) %\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 [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nwhen I start as a clone\nif <<(costume [number v]) = [14]> or <(costume [number v]) = [17]>> then\n    forever\n        repeat (170)\n            change [platforms: x v] by (2)\n        end\n        repeat (170)\n            change [platforms: x v] by (-2)\n        end\n    end\nend\n\n@ Crystal Saws\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nturn right (10) degrees\nPosition ((Saws: x) - (SCROLL X)) ((Saws: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [saws: x v] to [0]\nset [saws: y v] to [0]\nClone at x: [150] y: [-50]\nClone at x: [450] y: [-110]\nClone at x: [600] y: [-110]\nClone at x: [900] y: [-50]\nClone at x: [1050] y: [-50]\nClone at x: [1350] y: [-110]\nClone at x: [1500] y: [-110]\nClone at x: [3350] y: [-110]\nClone at x: [3500] y: [-110]\nClone at x: [5350] y: [-110]\nClone at x: [5500] y: [-110]\nClone at x: [5750] y: [-110]\nClone at x: [5900] y: [-110]\nClone at x: [6780] y: [-110]\nClone at x: [7130] y: [-50]\nClone at x: [7280] y: [-50]\nClone at x: [8280] y: [-50]\nClone at x: [8980] y: [-110]\nClone at x: [9130] y: [-110]\nClone at x: [9280] y: [-110]\nClone at x: [9430] y: [-110]\nClone at x: [9580] y: [-110]\nClone at x: [9730] y: [-110]\nClone at x: [9880] y: [-110]\nClone at x: [10030] y: [-110]\nClone at x: [10230] y: [-110]\nClone at x: [10380] y: [-110]\nClone at x: [10580] y: [-110]\nClone at x: [10730] y: [-110]\nClone at x: [11000] y: [-110]\nClone at x: [11150] y: [-110]\nClone at x: [11300] y: [-110]\nClone at x: [11450] y: [-110]\nset [saws: x v] to [-999999]\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 [saws: x v] to (x)\nset [saws: y v] to (y)\ncreate clone of (_myself_ v)\n\n@The Rare Diamond\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\ngo to [front v] layer\nPosition ((Collectables: x) - (SCROLL X)) ((Collectables: y) - (SCROLL Y))\nif <touching (player v)?> then\n    start sound [Coin v]\n    change [collected v] by (1)\n    broadcast (Game Win v)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [coins v] to [0]\nhide\nset [collectables: x v] to [0]\nset [collectables: y v] to [0]\nswitch costume to (crystal-a v)\nClone at x: [11700] y: [-80]\nset [collectables: x v] to [-9999999999]\n\ncreate clone of (_myself_ v)\n\nnext costume\nnext costume\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 [collectables: x v] to (x)\nset [collectables: y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\npoint in direction (90)\n\n@Chat\n\nwhen I receive [tick v]\ngo to [front v] layer\nif <(Chat2) = [1]> then\n    show\nelse\n    hide\nend\nif <(Chat2) = [1]> then\n    if <<mouse down?> and <not <touching (mouse-pointer v)?>>> then\n        broadcast (Chat Close v)\n        hide\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [chat open v]\nset [chat2 v] to [1]\n\nwhen I receive [chat close v]\nset [chat2 v] to [0]\n\n@Chat Button\n\nwhen I receive [tick v]\ngo to [front v] layer\nif <<mouse down?> and <touching (mouse-pointer v)?>> then\n    broadcast (Chat Open v)\n    hide\nend\n\nwhen I receive [chat close v]\nshow\n\nwhen I receive [begin v]\nshow\n\nwhen flag clicked\ngo to x: (-193) y: (-156)\nset size to (100) %\n\n@Love fave\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    if <not <<(LOVED__) = [1]> and <(FAVED___) = [1]>>> then\n        wait (pick random (30) to (40)) seconds\n        switch costume to (costume1 v)\n        go to x: (0) y: (50)\n        show\n        go to [front v] layer\n        start sound [pop v]\n        repeat (9)\n            change y by (-6)\n        end\n        repeat (5)\n            change y by (3)\n        end\n        repeat (5)\n            change y by (-1)\n        end\n        wait (2) seconds\n        repeat (15)\n            change y by (7)\n        end\n        hide\n    end\n    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\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\nchange [collected v] by (10)\nbroadcast (Thanks v)\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@Thanks\n\nwhen I receive [thanks v]\nswitch costume to (costume2 v)\ngo to x: (-210) y: (50)\nshow\ngo to [front v] layer\nrepeat (9)\n    change y by (-6)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (5)\n    change y by (-3)\nend\nwait (1) seconds\nrepeat (10)\n    change y by (6)\nend\nhide\n\nwhen flag clicked\nhide\nset [costume v] to [0.9]\n\nwhen I receive [begin v]\nset [costume v] to [0.9]\nwait (0.1) seconds\nset [costume v] to [0.9]\nwait (0.2) seconds\nset [costume v] to [0.9]\n\n@parallaxCollectables\n\nwhen I receive [tick v]\nGo to (((((@ID) * (480)) - ((SCROLL X) / (6))) mod (960)) - (480)) (Y_SHAKE)\ngo to [back v] layer\n\nwhen I start as a clone\npoint in direction (90)\nset [@id v] to [0]\nswitch costume to (item0 v)\nhide\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\ngo to [back v] layer\n\nwhen flag clicked\ngo to x: (0) y: (0)\ncreate clone of (_myself_ v)\nset [@id v] to [-1]\nswitch costume to (item1 v)\n\n@win animation\n\nwhen I receive [game win v]\nwait (1) seconds\nswitch costume to (win screen v)\ngo to [back v] layer\nset [win v] to [1]\nbroadcast (Score v)\nset [ghost v] effect to (100)\nswitch costume to (blank v)\ngo to [back v] layer\nclear graphic effects\ngo to x: (0) y: (0)\nshow\nswitch costume to (win screen v)\nset size to (150) %\nrepeat until <(size) < [101]>\n    go to [front v] layer\n    switch costume to (blank v)\n    change size by (((100) - (size)) / (7))\n    switch costume to (win screen v)\n    change [ghost v] effect by (-5)\n    set x to (((((pick random (0) to (1)) * (2)) - (1)) * ((size) - (100))) * (0.75))\n    set y to (((((pick random (0) to (1)) * (2)) - (1)) * ((size) - (100))) * (0.75))\nend\nshow variable [:timer v]\ngo to x: (0) y: (0)\nwait (4) seconds\nstop [all v]\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\nwhen I receive [continue playing v]\nhide\n\nwhen flag clicked\nhide variable [:timer v]\n\nwhen I receive [game win v]\nset [:timer v] to (timer)\nstop [this script v]\n\n@Joining\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nhide\n\nwhen I receive [connecting v]\nswitch costume to (joining v)\nshow\n\nwhen I receive [connected v]\ngo [forward v] (1322) layers\nstart sound [Connect v]\nswitch costume to (connected v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [full v]\nswitch costume to (full  v)\nshow\n\n@Loading\n\nwhen flag clicked\ngo [forward v] (213) layers\nset size to (100) %\nhide\npoint in direction (90)\nclear graphic effects\ngo to x: (0) y: (-80)\n\nwhen I receive [connecting v]\nrepeat (11)\n    create clone of (_myself_ v)\n    turn right (40) degrees\nend\n\nwhen I receive [connected v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (100)\nforever\n    repeat (20)\n        turn right (7.5) degrees\n        change [ghost v] effect by (-6)\n        change size by (1)\n    end\n    repeat (20)\n        turn right (7.5) degrees\n        change [ghost v] effect by (6)\n        change size by (-1)\n    end\nend\n\n@Sun\n\nwhen I receive [tick v]\ngo to [back v] layer\nforever\n    go to x: (([sin v] of ((timer) * (100)) ) * (20)) y: (([sin v] of ((timer) * (100)) ) * (20))\nend\n\n@Checkpoint\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [,] (join [ ] ((mouse y) + (SCROLL Y)))))\nshow variable [mouse v]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((Checkpoint: x) - (SCROLL X)) ((Checkpoint: y) - (SCROLL Y))\nif <(costume [name v]) = [off]> then\n    if <touching (player v)?> then\n        switch costume to (on v)\n        change [checkpoint v] by (1)\n        play sound [CHECKPOINT v] until done\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\ndefine Clone at (x) (y)\nset [checkpoint: x v] to (x)\nset [checkpoint: y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\nset [checkpoint v] to [0]\nset [checkpoint: x v] to [0]\nset [checkpoint: y v] to [0]\nswitch costume to (off v)\nClone at [1900] [20]\nClone at [3200] [-80]\nClone at [5600] [-80]\nClone at [6600] [-80]\nClone at [8600] [-80]\nset [checkpoint: x v] to [-99999]\n\n@G\n\nwhen this sprite clicked\nbroadcast (Blue v)\n\nwhen this sprite clicked\nbroadcast (Green v)\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nwhen flag clicked\nshow\n\n@B\n\nwhen this sprite clicked\nbroadcast (Blue v)\n\n@R\n\nwhen this sprite clicked\nbroadcast (Red v)\n\n