The Outside || A Cloud Scrolling Platformer

Instructions: If the game is full, try the following server:\nNew game! https://scratch.mit.edu/projects/421495621/\n===============<Disclaimer>===============\nThis was NOT reshared for fame. Please note that I have added a new feature, which is the cloud arrows. See for yourself! Now if the other players aren't showing on your screen, there will be an arrow pointing towards their direction! ^_^ Please understand :)\n===============<Information>===============\nBehold, ladies and gentlemen, to my masterpiece, The Outside || A Cloud Scrolling Platformer...... You have to collect all 45 coins and all 6 diamonds in order to win the game. Also, be sure to DOUBLE CLICK that green tree to prevent lag. The controls are normal, which are arrow keys and mobile touchscreen... Hope you enjoy! Also, please leave a love, fave, and follow if you enjoyed! ^_^\n#1 On trending! Wow...... Top Loved!?!?\n\n=================<Credits>=================\n1. @GravityV for the cloud engine, and the art inspiration\n2. @StratfordJames for the joining, cloud, and the player\n3. @Griffpatch for the scrolling platformer tutorial\n4. @Red_Sweatshirt for the mountains and trees art\n5. @TimMcCool for the pillar art and diamonds\n6. @-XAF- for the music “Unlimited”\n7. Me, @0014049, for everything else in the game\n\n==================<Tags>==================\n#Games #All #Scrolling #Cloud #Multiplayer #Platformer

@Stage\n\nwhen flag clicked\nhide variable [??? v]\nswitch backdrop to (1 v)\nforever\n    play sound (pick random (1) to (2)) until done\nend\n\nwhen I receive [reset v]\nif <(backdrop [number v]) = [3]> then\n    set [ghost v] effect to (20)\nend\n\nwhen I receive [win v]\nhide variable [time v]\nset [??? v] to (TIME)\nshow variable [??? v]\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [tick v]\nif <(_MUSIC) = [True]> then\n    set volume to (20) %\nelse\n    set volume to (0) %\nend\n\n@1. Level\n\nwhen I start as a clone\n\nwhen I receive [green flag v]\nhide\nswitch backdrop to (1 v)\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [reset v]\ndelete this clone\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 [setip v]\nhide\nset [x v] to [0]\nset [y v] to [360]\nswitch costume to (level 1-1 v)\ngo [backward v] (4) layers\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [0]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [0] y: [0]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [-960] y: [360]\nClone at x: [-480] y: [360]\nif <(Lock::1) = [1]> then\n    broadcast (Picklock one v)\nend\nif <(Lock::2) = [1]> then\n    broadcast (Picklock two v)\nend\n\ndefine Clone at x: (x) y: (y)\ngo [forward v] (1) layers\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [win v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\n\nwhen I receive [picklock one v]\nif <(costume [number v]) = [4]> then\n    delete this clone\nend\n\nwhen flag clicked\nset [lock::1 v] to [0]\nset [lock::2 v] to [0]\n\nwhen I receive [picklock two v]\nif <(costume [number v]) = [10]> then\n    delete this clone\nend\n\n@2. Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setip 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\ndefine Game on\npoint in direction (90)\nset rotation style [left-right v]\nset [x v] to (STARTX)\nset [y v] to ((STARTY) + (40))\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [scroll x v] to (STARTX)\nset [scroll y v] to ((STARTY) + (90))\nset size to (100) %\nclear graphic effects\nshow\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [speed x v] by (-2)\n    point in direction (-90)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [speed x v] by (2)\n    point in direction (90)\nend\nset [speed x v] to ((Speed x) * (0.8))\nif <([abs v] of (Speed x) ) > [0.9]> then\n    Change player x by (round (Speed x))\nend\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <not <touching (8. water v)?>> then\n        if <(in air) < [4]> then\n            set [speed y v] to [16]\n        end\n    end\nend\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <touching (8. water v)?> then\n        if <[20] > (Speed y)> then\n            change [speed y v] by (1.5)\n        end\n    end\nend\nif <<key (down arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n    if <touching (8. water v)?> then\n        if <(Speed y) > [-20]> then\n            change [speed y v] by (-1.5)\n        end\n    end\nend\nif <(Speed y) > [-20]> then\n    if <touching (8. water v)?> then\n        change [speed y v] by (-0.1)\n    else\n        change [speed y v] by (-2)\n    end\nend\nChange player y by (Speed y)\nTest - Die\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL X) > [3360]> then\n    set [scroll x v] to [3360]\nend\nif <touching (6. bouncy v)?> then\n    set [speed y v] to [28]\n    start sound [Big Boing v]\nend\nif <<touching (3. spikes v)?> or <<touching (11. saws v)?> or <(y) < [-170]>>> then\n    set [exit v] to [Die]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (5)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (1. level 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 [speed y v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (1. level v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (1. level 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 <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <(sx) > [0]> then\n            set [speed x v] to [-16]\n        else\n            set [speed x v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [speed x v] to [0]\n    end\n    repeat until <not <touching (1. level 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\nstart sound [Crunch v]\nclear graphic effects\nset rotation style [all around v]\nrepeat (20)\n    turn right (15) degrees\n    change y by (10)\n    change [ghost v] effect by (5)\nend\nset [exit v] to []\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 (-2)\n    change [ghost v] effect by (2)\nend\nhide\nclear graphic effects\nchange [level v] by (1)\nwait (1) seconds\n\ndefine Test - Die\n\nwhen I receive [win v]\nif  then\n    hide\nend\nstop [other scripts in sprite v]\n\nif <(SCROLL Y) < [0]> then\n\nwhen I receive [tick v]\n\nif <(LEVEL) = [5]> then\n    set [scroll x v] to [0]\n    set [scroll y v] to [0]\nend\n\nwhen I receive [die v]\nset [exit v] to [Die]\n\nwhen flag clicked\nset [startx v] to [639]\nset [starty v] to [411]\n\nwhen flag clicked\nforever\n    wait until <touching (8. water v)?>\n    start sound [Splash v]\n    wait until <not <touching (8. water v)?>>\nend\n\nwhen I receive [tick v]\nif <(_MUSIC) = [True]> then\n    set volume to (80) %\nelse\n    set volume to (0) %\nend\n\nwhen flag clicked\nset [___timeout v] to [1000]\nforever\n    if <<<key (up arrow v) pressed?> or <<key (down arrow v) pressed?> or <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>>>> or <mouse down?>> then\n        set [___timeout v] to [1000]\n    end\n    change [___timeout v] by (-1)\n    if <(___timeout) = [0]> then\n        stop [all v]\n    end\nend\n\n@3. Spikes\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setip v]\nswitch costume to (level 1-1 v)\nhide\nset [x v] to [0]\nset [y v] to [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [-480] y: [360]\nClone at x: [480] y: [0]\nClone at x: [-480] y: [0]\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 [win v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\n\n@4. Shadows\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setip v]\nhide\nset [x v] to [0]\nset [y v] to [360]\nswitch costume to (level 1-4 v)\nset [ghost v] effect to (10)\ngo to [back v] layer\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: ((480) * (2)) y: [0]\nClone at x: [480] y: [0]\n\ndefine Position (x) (y)\ngo to [back v] layer\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 [win v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\n\n@5. Thumb\n\nwhen [timer v] > (0.01)\nif <(___timeout) = [0]> then\n    switch costume to (costume4 v)\nelse\n    if <(__full) = [1]> then\n        switch costume to (costume3 v)\n    else\n        if <(_EXIT) = [True]> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume1 v)\n        end\n    end\nend\nclear graphic effects\nshow\nset [ghost v] effect to (100)\nrepeat (20)\n    go to [front v] layer\n    change [ghost v] effect by (-5)\nend\ngo to [front v] layer\n\nwhen flag clicked\nset [_exit v] to [False]\nforever\n    hide\n    set [ghost v] effect to (100)\n    reset timer\nend\n\nwhen [timer v] > (0.01)\nforever\n    if <(_EXIT) = [True]> then\n        play sound [Pixelland.mp3 v] until done\n    end\nend\n\n@6. Bouncy\n\nwhen I receive [green flag v]\nhide\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\nif <touching (2. player v)?> then\n    switch costume to (close flag3 v)\nelse\n    switch costume to (close flag v)\nend\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [setip v]\nhide\ngo to [back v] layer\nClone at x: [1241] y: [300]\nClone at x: [1432] y: [300]\nClone at x: [1564] y: [-90]\nClone at x: [2187] y: [-90]\nClone at x: [2307] y: [130]\nClone at x: [2543] y: [130]\nClone at x: [2762] y: [130]\nClone at x: [2650] y: [275]\nClone at x: [2073] y: [619]\nClone at x: [1900] y: [579]\nset [x v] to [-100]\nset [y v] to [-100]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nswitch costume to (close flag3 v)\nswitch costume to (close flag2 v)\nswitch costume to (close flag v)\n\nrepeat (2)\n    next costume\nend\nrepeat (2)\n    switch costume to ((costume [number v]) - (1))\nend\n\nClone at x: [1347] y: [-20]\n\nwhen I receive [tick v]\nif <(_MUSIC) = [True]> then\n    set volume to (80) %\nelse\n    set volume to (0) %\nend\n\n@7. Coins\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nnext costume\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (2. player v)?> then\n    change [collected v] by (1)\n    if <(COLLECTED) = (COLLECT MAX)> then\n        broadcast (Open exit v)\n    end\n    start sound [Coin v]\n    delete this clone\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)\nset [x v] to (x)\nset [y v] to (y)\nchange [collect max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nforever\n    set [display value v] to (join (COLLECTED) (join [ / ] (COLLECT MAX)))\nend\n\nwhen [space v] key pressed\nset [mesee v] to (join ((mouse x) + (SCROLL X)) (join [,] ((mouse y) + (SCROLL Y))))\n\nwhen flag clicked\nhide\nset [collected v] to [0]\nset [collect max v] to [0]\nClone at x: [494] y: [248]\ngo to [front v] layer\nClone at x: [424] y: [248]\nClone at x: [354] y: [248]\nClone at x: [17] y: [431]\nClone at x: [-112] y: [344]\nClone at x: [-112] y: [274]\nClone at x: [-112] y: [204]\nClone at x: [-112] y: [134]\nClone at x: [-112] y: [64]\nClone at x: [70] y: [31]\nClone at x: [325] y: [25]\nClone at x: [800] y: [85]\nClone at x: [800] y: [35]\nClone at x: [800] y: [-15]\nClone at x: [1337] y: [500]\nClone at x: [1480] y: [308]\nClone at x: [1595] y: [308]\nClone at x: [1595] y: [238]\nClone at x: [1595] y: [168]\nClone at x: [1595] y: [98]\nClone at x: [1595] y: [28]\nClone at x: [1079] y: [309]\nClone at x: [1773] y: [-24]\nClone at x: [1952] y: [-81]\nClone at x: [1863] y: [-81]\nClone at x: [2024] y: [-24]\nClone at x: [2240] y: [-81]\nClone at x: [2542] y: [-7]\nClone at x: [2657] y: [-52]\nClone at x: [2773] y: [-7]\nClone at x: [2349] y: [-24]\nClone at x: [2648] y: [320]\nClone at x: [2379] y: [284]\nClone at x: [2465] y: [284]\nClone at x: [2759] y: [192]\nClone at x: [2869] y: [137]\nClone at x: [2928] y: [219]\nClone at x: [2997] y: [140]\nClone at x: [3315] y: [116]\nClone at x: [3160] y: [94]\nClone at x: [3462] y: [80]\nClone at x: [2512] y: [471]\nClone at x: [2253] y: [548]\nClone at x: [2416] y: [471]\nClone at x: [1988] y: [761]\nset [x v] to [-9999]\nset [y v] to [0]\n\nwhen I receive [tick v]\nif <(_MUSIC) = [True]> then\n    set volume to (80) %\nelse\n    set volume to (0) %\nend\n\n@8. Water\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setip v]\nhide\nset [x v] to [0]\nset [y v] to [360]\nset [ghost v] effect to (60)\ngo to [front v] layer\nswitch costume to (level 1-1 v)\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: ((4) * (480)) y: [0]\ncreate clone of (_myself_ v)\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [win v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\n\nwhen I start as a clone\ngo to [back v] layer\nforever\n    set [ghost v] effect to (60)\n    repeat (20)\n        change [y v] by (-0.5)\n    end\n    repeat (20)\n        change [y v] by (0.5)\n    end\nend\n\n@9. Lazers\n\nwhen I receive [green flag v]\nhide\nswitch backdrop to (1 v)\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [reset v]\ndelete this clone\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 [x v] by (x)\nchange [y v] by (y)\nchange [count v] by (2)\n\nwhen I receive [win v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\n\nwhen I receive [tick v]\nif <((current [second v]) mod (4)) < [2]> then\n    switch costume to (count)\n    if <touching (2. player v)?> then\n        broadcast (die v)\n    end\nelse\n    switch costume to ((count) + (1))\nend\n\nwhen I receive [setip v]\nhide\nset [count v] to [1]\nset [x v] to [0]\nset [y v] to [360]\nswitch costume to (level-1 v)\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: ((480) * (3)) y: [0]\n\nwhen I receive [tick v]\nif <(_MUSIC) = [True]> then\n    set volume to (100) %\nelse\n    set volume to (0) %\nend\n\n@10. Grass\n\nwhen I receive [green flag v]\nhide\nswitch backdrop to (1 v)\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [reset v]\ndelete this clone\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 [setip v]\nhide\nset [x v] to [0]\nset [y v] to [360]\nswitch costume to (level 1-1 v)\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [360]\nClone at x: [0] y: [-360]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [-960] y: [360]\nClone at x: [-480] y: [360]\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 [win v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\n\nset [scroll x v] to [0]\n\nwhen I start as a clone\ngo [backward v] (2) layers\n\n@11. Saws\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nturn left (10) degrees\nnext costume\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setip v]\nif  then\n    delete this clone\nend\nhide\nset [x v] to [-9999]\nset [y v] to [0]\nClone at x: [230] y: [200]\nClone at x: [-180] y: [501]\nClone at x: [-180] y: [-42]\nClone at x: [970] y: [-165]\nClone at x: [1340] y: [286]\nClone at x: [1236] y: [-43]\nClone at x: [1996] y: [601]\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)\npoint in direction (90)\nset [x v] to (x)\nset [y v] to (y)\nchange [collect max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nforever\n    set [display value v] to (join (COLLECTED) (join [ / ] (COLLECT MAX)))\nend\n\n@12. Key(1)\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nnext costume\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen [space v] key pressed\nset [mesee v] to (join ((mouse x) + (SCROLL X)) (join [,] ((mouse y) + (SCROLL Y))))\n\nwhen I start as a clone\nforever\n    repeat (20)\n        change [y v] by (-0.5)\n    end\n    repeat (20)\n        change [y v] by (0.5)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (2. player v)?> then\n        start sound [Magic Spell v]\n        if <(x) = [479]> then\n            set [lock::1 v] to [1]\n            broadcast (Picklock one v)\n        else\n            if <(x) = [1410]> then\n                set [lock::2 v] to [1]\n                broadcast (Picklock two v)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\nClone at x: [479] y: [30]\nClone at x: [1410] y: [132]\nset [x v] to [-9999]\nset [y v] to [0]\n\nwhen I receive [picklock one v]\nif <(x) = [479]> then\n    delete this clone\nend\n\nwhen I receive [picklock two v]\nif <(x) = [1410]> then\n    delete this clone\nend\n\nwhen I receive [tick v]\nif <(_MUSIC) = [True]> then\n    set volume to (80) %\nelse\n    set volume to (0) %\nend\n\n@13. Diam\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nnext costume\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (2. player v)?> then\n    start sound [Wand v]\n    change [#diamonds v] by (1)\n    delete this clone\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)\ngo to [front v] layer\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen [space v] key pressed\nset [mesee v] to (join ((mouse x) + (SCROLL X)) (join [,] ((mouse y) + (SCROLL Y))))\n\nwhen I start as a clone\nforever\n    repeat (20)\n        change [y v] by (-0.5)\n    end\n    repeat (20)\n        change [y v] by (0.5)\n    end\nend\n\nwhen flag clicked\nhide\nset [collected v] to [0]\nset [collect max v] to [0]\nClone at x: [640] y: [248]\nClone at x: [1139] y: [105]\nClone at x: [1345] y: [-39]\nClone at x: [2875] y: [-25]\nClone at x: [3545] y: [102]\nClone at x: [2225] y: [830]\nset [x v] to [-9999]\nset [y v] to [0]\n\nwhen I receive [tick v]\nif <(_MUSIC) = [True]> then\n    set volume to (80) %\nelse\n    set volume to (0) %\nend\n\n@14. Display\n\nwhen flag clicked\nset size to (70) %\ngo to x: (-72) y: (50.5)\nClone\ngo to x: (0) y: (0)\nswitch costume to (def v)\nset size to (100) %\n\ndefine Digit (number)\nset y to (50)\nif <not <touching (18. other v)?>> then\n    go to [front v] layer\nend\nset size to (70) %\nset [brightness v] effect to (100)\nif <<[4] > (number)> and <(number) > [0]>> then\n    switch costume to (join [A] (letter (number) of (COLLECTED)))\n    if <<not <(number) = [1]>> and <(costume [number v]) = [A]>> then\n        show\n    else\n        show\n    end\nend\nif <<[7] > (number)> and <(number) > [3]>> then\n    switch costume to (join [A] (letter ((number) - (3)) of (#Diamonds)))\n    if <<not <(number) = [1]>> and <(costume [number v]) = [A]>> then\n        show\n    else\n        show\n    end\nend\n\nwhen I receive [tick v]\nif <not <(???CLONE???) = [7]>> then\n    Digit (???CLONE???)\nend\n\ndefine Clone\nset [???clone??? v] to [1]\nrepeat until <(???CLONE???) = [4]>\n    switch costume to (join [A] (letter (???CLONE???) of (COLLECTED)))\n    go to [front v] layer\n    create clone of (_myself_ v)\n    change [???clone??? v] by (1)\n    change x by (13)\nend\nchange x by (50)\nrepeat until <(???CLONE???) = [7]>\n    switch costume to (join [A] (letter ((???CLONE???) - (3)) of (#Diamonds)))\n    go to [front v] layer\n    create clone of (_myself_ v)\n    change [???clone??? v] by (1)\n    change x by (13)\nend\n\nshow\n\nwhen flag clicked\nset [#diamonds v] to [0]\n\nset [#diamonds v] to [10]\n\nset [collected v] to [104]\nset [#diamonds v] to [104]\n\nwhen I receive [setip v]\nif <not <touching (18. other v)?>> then\n    go to [front v] layer\nend\n\nwhen I receive [reset v]\nif <not <touching (18. other v)?>> then\n    go to [front v] layer\nend\n\nwhen I receive [setip v]\nwait (0.01) seconds\ngo to [front v] layer\n\n@15. Music\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [_music v] to [True]\n\nwhen I receive [tick v]\nif <(_MUSIC) = [True]> then\n    switch costume to (costume1 v)\nelse\n    switch costume to (costume2 v)\nend\nif <touching (mouse-pointer v)?> then\n    set [brightness v] effect to (50)\nelse\n    clear graphic effects\nend\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(_MUSIC) = [True]> then\n            set [_music v] to [False]\n            switch costume to (costume2 v)\n        else\n            set [_music v] to [True]\n            switch costume to (costume1 v)\n        end\n    end\n    wait until <not <mouse down?>>\nend\n\nwhen I receive [tick v]\ngo to [front v] layer\n\n@17. Checkpoints\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (2. player v)?> then\n    if <not <[1730] = (x)>> then\n        if <not <(STARTX) = (x)>> then\n            point in direction (135)\n            start sound [Ding - Sound Effect \[HD\] v]\n        end\n        set [startx v] to (x)\n        set [starty v] to (y)\n    end\n    if <<[1730] = (x)> and <<(COLLECTED) = [45]> and <(#Diamonds) = [6]>>> then\n        set [_exit v] to [True]\n        stop [all v]\n    end\nend\nif <<(STARTX) = (x)> and <not <[1730] = (x)>>> then\n    switch costume to (checkpoint1 v)\nelse\n    if <[1730] = (x)> then\n        if <<(COLLECTED) = [45]> and <(#Diamonds) = [6]>> then\n            switch costume to (checkpoint3 v)\n        else\n            switch costume to (checkpoint2 v)\n        end\n    else\n        switch costume to (checkpoint2 v)\n    end\nend\n\ndefine Position (x) (y)\nturn right (((90) - (direction)) / (5)) degrees\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)\ngo to [back v] layer\nswitch costume to (checkpoint2 v)\nset [x v] to (x)\nset [y v] to (y)\nchange [collect max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nforever\n    set [display value v] to (join (COLLECTED) (join [ / ] (COLLECT MAX)))\nend\n\nwhen [space v] key pressed\nset [mesee v] to (join ((mouse x) + (SCROLL X)) (join [,] ((mouse y) + (SCROLL Y))))\n\nwhen flag clicked\nhide\nClone at x: [639] y: [411]\nClone at x: [1651] y: [-105]\nClone at x: [2830] y: [112]\nClone at x: [1730] y: [717]\nset [y v] to [-500]\n\nwhen I receive [tick v]\nif <(_MUSIC) = [True]> then\n    set volume to (80) %\nelse\n    set volume to (0) %\nend\n\n@18. Other\n\ndefine encode string (val) and add to encoded value (new encode section?) (boolean)\nswitch costume to (lowercase v)\nif <(boolean) = [true]> then\n    set [encoded value v] to []\nend\nset [readdata# v] to [1]\nrepeat (length of (val))\n    set [word v] to (letter (readdata#) of (val))\n    switch costume to (join (word) [\)])\n    set [word v] to (item # of (word) in [run:data v])\n    if <(costume [name v]) = [lowercase]> then\n        if <not <(word) = [0]>> then\n            set [encoded value v] to (join (encoded value) (word))\n        else\n            set [encoded value v] to (join (encoded value) (item # of [*] in [run:data v]))\n        end\n    else\n        if <not <(word) = [0]>> then\n            set [encoded value v] to (join (encoded value) ((word) + (26)))\n        else\n            set [encoded value v] to (join (encoded value) (item # of [*] in [run:data v]))\n        end\n    end\n    switch costume to (lowercase v)\n    change [readdata# v] by (1)\nend\nset [encoded value v] to (join (encoded value) [000])\n\ndefine decode string (code) and add to value (new decode section?) (boolean)\nset [decoded result v] to []\nif <(boolean) = [true]> then\n    set [encoded value v] to (code)\n    set [readdata# v] to [1]\nend\nforever\n    set [decode idx v] to (join (letter (readdata#) of (encoded value)) (join (letter ((readdata#) + (1)) of (encoded value)) (letter ((readdata#) + (2)) of (encoded value))))\n    change [readdata# v] by (3)\n    if <(decode IDX) < [1]> then\n        stop [this script v]\n    end\n    set [decoded result v] to (join (decoded result) (item (decode IDX) of [run:data v]))\nend\n\ndefine clone (amount)\nset [offline v] to [100]\nset [clone# v] to [1]\nrepeat ((amount) - (1))\n    create clone of (_myself_ v)\n    change [clone# v] by (1)\nend\n\ndefine send cloud (#) (data)\nif <(#) = [1]> then\n    set [☁ new p1 v] to (data)\nelse\n    if <(#) = [2]> then\n        set [☁ new p2 v] to (data)\n    else\n        if <(#) = [3]> then\n            set [☁ new p3 v] to (data)\n        else\n            if <(#) = [4]> then\n                set [☁ p4 v] to (data)\n            else\n                if <(#) = [5]> then\n                    set [☁ p5 v] to (data)\n                else\n                    if <(#) = [6]> then\n                        set [☁ p6 v] to (data)\n                    else\n                        if <(#) = [7]> then\n                            set [☁ p7 v] to (data)\n                        else\n                            if <(#) = [8]> then\n                                set [☁ p8 v] to (data)\n                            else\n                                if <(#) = [9]> then\n                                    set [☁ p9 v] to (data)\n                                else\n                                    if <(#) = [10]> then\n                                        set [☁ p10 v] to (data)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine value = cloud (#)\nif <(#) = [1]> then\n    set [decoded result v] to (☁ NEW P1)\nelse\n    if <(#) = [2]> then\n        set [decoded result v] to (☁ New P2)\n    else\n        if <(#) = [3]> then\n            set [decoded result v] to (☁ NEW P3)\n        else\n            if <(#) = [4]> then\n                set [decoded result v] to (☁ P4)\n            else\n                if <(#) = [5]> then\n                    set [decoded result v] to (☁ P5)\n                else\n                    if <(#) = [6]> then\n                        set [decoded result v] to (☁ P6)\n                    else\n                        if <(#) = [7]> then\n                            set [decoded result v] to (☁ P7)\n                        else\n                            if <(#) = [8]> then\n                                set [decoded result v] to (☁ P8)\n                            else\n                                if <(#) = [9]> then\n                                    set [decoded result v] to (☁ P9)\n                                else\n                                    if <(#) = [10]> then\n                                        set [decoded result v] to (☁ P10)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [__full v] to [0]\nset [@my player id@ v] to [0]\nhide\nclone [10]\nbroadcast (join game v) and wait\nif <(@MY PLAYER ID@) = [0]> then\n    set [__full v] to [1]\n    stop [all v]\nend\nbroadcast (begin v)\n\nwhen I receive [join game v]\nset [connected? v] to [false]\nvalue = cloud (clone#)\nset [_last val v] to (join [A] (decoded result))\nwait (2) seconds\nvalue = cloud (clone#)\nset [_disconnection_last val v] to (join [A] (decoded result))\nif <(join [A] (decoded result)) = (_last val)> then\n    set [@my player id@ v] to (clone#)\nend\nset [connected? v] to [true]\n\nwhen I receive [begin v]\nforever\n    if <(@MY PLAYER ID@) = (clone#)> then\n        go to [front v] layer\n        hide\n        encode string (round ([x v] of [2. player v])) and add to encoded value (new encode section?) [true]\n        encode string (round ([y v] of [2. player v])) and add to encoded value (new encode section?) []\n        encode string (username) and add to encoded value (new encode section?) []\n        encode string (round ((days since 2000) * (1000000))) and add to encoded value (new encode section?) []\n        send cloud (@MY PLAYER ID@) (encoded value)\n    else\n        value = cloud (clone#)\n        disconnection timeout [20]\n        decode string (decoded result) and add to value (new decode section?) [true]\n        set [x v] to (decoded result)\n        set x to ((x) - (SCROLL X))\n        decode string [] and add to value (new decode section?) []\n        set [y v] to (decoded result)\n        set y to ((y) - (SCROLL Y))\n        decode string [] and add to value (new decode section?) []\n        think (join (clone#) (join [:] (decoded result)))\n        switch costume to (player_0 v)\n        clear graphic effects\n        set rotation style [left-right v]\n        if <<not <(x position) = ((x) - (SCROLL X))>> or <not <(y position) = ((y) - (SCROLL Y))>>> then\n            switch costume to (arrow3 v)\n            point towards (middle v)\n            set rotation style [all around v]\n            move (40) steps\n            think []\n        end\n        go to [front v] layer\n    end\nend\n\ndefine disconnection timeout (frames)\nvalue = cloud (clone#)\nif <(join [A] (decoded result)) = (_disconnection_last val)> then\n    change [offline v] by (-1)\n    if <(offline) < (frames)> then\n        hide\n    end\nelse\n    set [offline v] to [100]\n    set [_disconnection_last val v] to (join [A] (decoded result))\n    if <(connected?) = [true]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\n@19. CTC\n\nwhen I receive [join game v]\nshow\nswitch costume to (connecting v)\nclear graphic effects\ngo to x: (0) y: (0)\n\nwhen I receive [tick v]\ngo to [front v] layer\n\nwhen I receive [begin v]\nswitch costume to (connected v)\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Middle\n\n