☁  Home || A multiplayer Scrolling Platformer

Instructions:                                    ◊  Home ◊\n-------------------------------------------------------------------------\n                  A multiplayer scrolling Platformer\n\n                                    Instructions \n                                    ----------------\n- Jump over the prongs and overcome the dangers to get to your destination, to reach home!\n- You can play together with a total of 9 other players!\n- Space to restart\n- have fun!\n\n- Springe über die Zacken und überwinde die Gefahren, um ans ziel zu kommen, um das Zuhause zu erreichen!\n- Du kannst insgesamt mit 9 anderen Spielern gemeinsam spielen!\n- Leertaste für Neustart\n- Viel Spaß!\n\n                                        News\n                                    ----------------\n06.10.20 - UPDATE: Var. Time!\n05.10.20 - 159 Likes\n16.09.20 - 100 Likes\n09.09.20 - 50 Likes\n06.09.20 - share\n\n                                      Credits\n                                    ----------------\n- @HelloMellon for the Smoth Glide Tutorial\n- @griffpatch for the Multiplayer Tutorial and the \n   scrolling Platformer Tutorial\n\nPlease Like, Fav and Follow if you like it :)\nBitte Liken, Faven und folgen, wenn du dieses Spiel magst :)\n\n@Multiplayer @Cloud @AsterixDavid @Scrolling @Platfomer @Scrolling Platformer @Games @Multiplayer scrolling Platformer @Fun @NotAllone @Work @Great Game@Multiplayer @Cloud @AsterixDavid @Scrolling @Platfomer @Scrolling Platformer @Games @Multiplayer scrolling Platformer @Fun @NotAllone @Work @Great Game

@Stage\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\n\nwhen I receive [tick v]\nif <(Night?) = [1]> then\n    switch backdrop to (bühnenbild3 v)\nelse\n    switch backdrop to (bühnenbild2 v)\nend\n\n@Player\n\nbroadcast (Green v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [green v]\nhide\ngo to [back v] layer\n\nwhen I receive [begin v]\nGame - Die\nset [level v] to [1]\nforever\n    broadcast (reset v) and wait\n    broadcast (setup v) and wait\n    Game on\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n        go to [front v] layer\n        go [backward v] (20) layers\n    end\n    if <(EXIT) = [win]> then\n        Game win\n    else\n        Game - Die\n    end\nend\n\ndefine Game on\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [time v] to [0]\nreset timer\nset [scroll y v] to [0]\nset [sy v] to [0]\nset [sx v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nif <not <(EXIT) = [win]>> then\n    set [time v] to (timer)\nend\nif <<key (left arrow 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 <<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.8]> then\n    Change Player X by (round (sx))\nend\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n    if <(in air) < [4]> then\n        if <(JB?) = [0]> then\n            set [sy v] to [16]\n        else\n            set [sy v] to [20]\n        end\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player Y by (sy)\nTest - Die\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (10)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nPosition\nif <(SCROLL Y) < [-360]> then\n    set [scroll y v] to [-360]\nend\nif <(y) < [-600]> then\n    set [exit v] to [die]\nend\nif <(SCROLL X) > [5200]> then\n    set [night? v] to [1]\n    broadcast (night v)\nelse\n    set [night? v] to []\nend\nif <(SCROLL X) > [7200]> then\n    set [night? v] to []\n    broadcast (night v)\nend\nif <(Chat) > []> then\n    say (item (Chat) of [chat v])\nelse\n    say []\nend\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 Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player X by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> 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\ndefine Game - Die\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine Test - Die\nif <touching (movingdanger v)?> then\n    set [exit v] to [die]\nend\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game win\nhide\nbroadcast (end v)\n\nwhen flag clicked\nset [time v] to [0]\nhide variable [time v]\nset [max players v] to [10]\nset [my player # v] to [0]\nbroadcast (setup - opponents v) and wait\nbroadcast (join game v) and wait\nif <(MY PLAYER #) > [0]> then\n    broadcast (joined v)\nelse\n    broadcast (full v) and wait\nend\nbroadcast (begin v)\nshow variable [time v]\n\nbroadcast (full v)\n\n\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) to encoded\nset cloud # (MY PLAYER #) to (encoded)\n\nwhen I receive [begin v]\nshow\nforever\n    if <(MY PLAYER #) > [0]> then\n        send cloud data\n        broadcast (Tick-Opponents v)\n    end\n    set [☁ 1 v] to (☁ 1)\n    set [☁ 2 v] to (☁ 2)\n    set [☁ 3 v] to (☁ 3)\n    set [☁ 4 v] to (☁ 4)\n    set [☁ 5 v] to (☁ 5)\n    set [☁ 6 v] to (☁ 6)\n    set [☁ 7 v] to (☁ 7)\n    set [☁ 8 v] to (☁ 8)\n    set [☁ 9 v] to (☁ 9)\n    set [☁ 10 v] to (☁ 10)\nend\n\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ 1 v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ 2 v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ 3 v] to (value)\n        else\n            if <(player) = [4]> then\n                set [☁ 4 v] to (value)\n            else\n                if <(player) = [5]> then\n                    set [☁ 5 v] to (value)\n                else\n                    if <(player) = [6]> then\n                        set [☁ 6 v] to (value)\n                    else\n                        if <(player) = [7]> then\n                            set [☁ 7 v] to (value)\n                        else\n                            if <(player) = [8]> then\n                                set [☁ 8 v] to (value)\n                            else\n                                if <(player) = [9]> then\n                                    set [☁ 9 v] to (value)\n                                else\n                                    set [☁ 10 v] to (value)\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]\n\nif <not <(sy) = [16]>> then\n\nset [sy v] to [16]\nset [y v] to [16]\n\nhide\n\nwhen I receive [night v]\n\nwhen I receive [begin v]\n\nwhen I receive [shopopen v]\n\nwhen [space v] key pressed\nbroadcast (begin v)\n\n@MovingDanger\n\nwhen I receive [green v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nchange [y v] by (-10)\nif <(LEVEL) = [1]> then\n    switch costume to (blank v)\n    Clone at x [0] y [0]\n    Clone at x [590] y [0]\n    Clone at x [600] y [-330]\n    switch costume to (level 1 3 v)\n    Clone at x [400] y [-300]\n    switch costume to (level 1 4 v)\n    Clone at x [600] y [300]\n    Clone at x [679] y [0]\n    switch costume to (level 1 6 v)\n    Clone at x [700] y [0]\n    switch costume to (level 1 7 v)\n    Clone at x [700] y [100]\n    switch costume to (level 1 8 v)\n    Clone at x [0] y [0]\n    switch costume to (level 1 9 v)\n    Clone at x [700] y [0]\n    Clone at x [500] y [0]\n    Clone at x [500] y [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x [0] y [300]\n        Clone at x [460] y [0]\n    else\n        switch costume to (level 3 1 v)\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x (x) y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen flag clicked\n\nwhen I receive [begin v]\n\n@Moutain\n\nwhen I receive [green v]\nset [night? v] to []\nswitch costume to (kostüm2 v)\nhide\nclear graphic effects\n\nwhen I receive [tick v]\nPosition ((x) - ((SCROLL X) / (3))) (y)\n\nwhen I receive [setup v]\nswitch costume to (kostüm2 v)\ngo to [back v] layer\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x [0] y [0]\n    Clone at x [500] y [0]\n    Clone at x [500] y [0]\n    Clone at x [500] y [0]\n    Clone at x [500] y [0]\n    Clone at x [500] y [0]\n    Clone at x [500] y [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x [0] y [300]\n        Clone at x [460] y [0]\n    else\n        switch costume to (level 3 1 v)\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\nif <(Night?) = [1]> then\n    switch costume to (kostüm3 v)\nelse\n    switch costume to (kostüm2 v)\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)\n\nwhen I receive [night v]\n\nclear graphic effects\nrepeat (50)\n    change [brightness v] effect by (10)\nend\n\nset [color v] effect to (100)\n\nnext costume\n\nswitch costume to (kostüm3 v)\n\n@Chat2\n\nwhen flag clicked\nset [jb? v] to [0]\ngo to x: (-180) y: (-148)\nswitch costume to (kostüm1 v)\nset [ghost v] effect to (20)\nset size to (100) %\n\nwhen I start as a clone\n\n\n\nset size to (50) %\n\nset size to (40) %\n\nwhen I receive [tick v]\npoint in direction (90)\nif <(costume [number v]) = [1]> then\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        go to [front v] layer\n        set size to (110) %\n        if <mouse down?> then\n            broadcast (shopopen v)\n            go to [front v] layer\n        end\n    else\n        set size to (100) %\n    end\n    go to [front v] layer\n    set [ghost v] effect to (20)\n    go to x: (-180) y: (-148)\nend\nif <<mouse down?> and <not <touching (mouse-pointer v)?>>> then\n    if <(costume [number v]) = [2]> then\n        glide (0.5) secs to x: (36) y: (-200)\n        go to x: (-180) y: (-148)\n        switch costume to (kostüm1 v)\n        set [ghost v] effect to (20)\n        set size to (100) %\n    end\nend\n\nwhen I receive [shopopen v]\nswitch costume to (kostüm2 v)\nset size to (100) %\nset [ghost v] effect to (20)\ngo to x: (36) y: (-100)\nglide (0.5) secs to x: (36) y: (28)\n\nwhen I receive [flying v]\nwait (10) seconds\n\nwhen I receive [flying v]\ngo to x: (-180) y: (-148)\nswitch costume to (kostüm1 v)\nset [ghost v] effect to (20)\nset size to (100) %\n\nif <(costume [number v]) = [3]> then\n    if <touching (mouse-pointer v)?> then\n        set size to (50) %\n        if <mouse down?> then\n            set [jb? v] to [1]\n            change [collected v] by (-10)\n        end\n    else\n        set size to (40) %\n    end\nend\n\nhide\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nshow\n\n@Chat\n\nwhen flag clicked\nhide\n\nwhen I receive [tick v]\nif <key (1 v) pressed?> then\n    set [chat v] to [1]\nend\nif <key (2 v) pressed?> then\n    set [chat v] to [2]\nend\nif <key (3 v) pressed?> then\n    set [chat v] to [3]\nend\nif <key (4 v) pressed?> then\n    set [chat v] to [4]\nend\nif <key (5 v) pressed?> then\n    set [chat v] to [5]\nend\nif <key (6 v) pressed?> then\n    set [chat v] to [6]\nend\nif <key (7 v) pressed?> then\n    set [chat v] to [7]\nend\n\nwhen flag clicked\nset [chat v] to []\nforever\n    if <<<<<<<key (1 v) pressed?> or <key (7 v) pressed?>> or <key (6 v) pressed?>> or <key (2 v) pressed?>> or <key (4 v) pressed?>> or <key (3 v) pressed?>> or <key (5 v) pressed?>> then\n        wait (10) seconds\n        set [chat v] to []\n    end\nend\n\n@Slides\n\nwhen I receive [join game v]\nswitch costume to (joining v)\ngo to [front v] layer\n\nwhen I receive [joined v]\nswitch costume to (joined! v)\n\nwhen I receive [full v]\nswitch costume to (full v)\ngo to [front v] layer\nforever\n\nwhen flag clicked\nswitch costume to (blank v)\nshow\nclear graphic effects\n\nhide\n\nwhen I receive [begin v]\nwait (2) seconds\nhide\n\nwhen flag clicked\ngo to x: (13) y: (7)\nreset timer\nforever\n    set y to ((([sin v] of ((timer) * (200)) ) * (10)) + (1))\nend\n\nrepeat (10)\n\n@Collectables\n\nwhen I receive [green v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    change [collected v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open Portal v)\n    end\n    switch costume to (kostüm1 v)\n    set [ghost v] effect to (0)\n    set size to (100) %\n    switch costume to (kostüm1 v)\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset size to (100) %\nclear graphic effects\nset [collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to ( v)\n    Clone at x [50] y [-50]\n    Clone at x [100] y [0]\n    Clone at x [320] y [0]\n    Clone at x [716] y [0]\n    Clone at x [716] y [60]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to ( v)\n        Clone at x [-115] y [-70]\n        Clone at x [94] y [-8]\n        Clone at x [-67] y [79]\n        Clone at x [-161] y [177]\n        Clone at x [145] y [254]\n    end\nend\nset [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)\nswitch costume to (1 v)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nrepeat (20)\n    change size by (-1)\nend\n\nchange [ghost v] effect by (10)\nchange y by (0.5)\n\nset size to (100) %\n\n@Danger\n\nwhen I receive [green v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nchange [y v] by (-10)\nif <(LEVEL) = [1]> then\n    switch costume to (blank v)\n    Clone at x [0] y [0]\n    Clone at x [590] y [0]\n    Clone at x [600] y [-330]\n    Clone at x [700] y [0]\n    Clone at x [679] y [0]\n    Clone at x [679] y [0]\n    Clone at x [700] y [0]\n    Clone at x [700] y [100]\n    Clone at x [0] y [0]\n    Clone at x [700] y [0]\n    Clone at x [500] y [0]\n    Clone at x [500] y [0]\n    Clone at x [0] y [300]\n    Clone at x [500] y [0]\n    Clone at x [500] y [-200]\n    Clone at x [500] y [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x [0] y [300]\n        Clone at x [460] y [0]\n    else\n        switch costume to (level 3 1 v)\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x (x) y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen flag clicked\n\n@Platforms\n\nwhen I receive [green v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (kostüm2 v)\n    Clone at x [0] y [0]\n    Clone at x [590] y [0]\n    Clone at x [600] y [-300]\n    switch costume to (level 1 3 v)\n    Clone at x [400] y [-300]\n    switch costume to (level 1 4 v)\n    Clone at x [600] y [300]\n    Clone at x [679] y [0]\n    Clone at x [700] y [0]\n    Clone at x [700] y [100]\n    Clone at x [0] y [0]\n    Clone at x [700] y [0]\n    Clone at x [500] y [0]\n    Clone at x [500] y [0]\n    Clone at x [0] y [300]\n    Clone at x [500] y [0]\n    Clone at x [500] y [-200]\n    Clone at x [500] y [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x [0] y [300]\n        Clone at x [460] y [0]\n    else\n        Clone at x [0] y [0]\n        switch costume to (level 3 1 v)\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <not <<(x) = (x position)> and <(y) = (y position)>>> then\n    hide\nelse\n    show\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x (x) y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Background\n\nwhen I receive [green v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x [0] y [0]\n    switch costume to (level 1 1 v)\n    Clone at x [600] y [0]\n    Clone at x [600] y [-300]\n    switch costume to (level 1 3 v)\n    Clone at x [400] y [-300]\n    switch costume to (level 1 4 v)\n    Clone at x [600] y [300]\n    Clone at x [679] y [0]\n    switch costume to (level 1 6 v)\n    Clone at x [700] y [0]\n    switch costume to (level 1 7 v)\n    Clone at x [700] y [100]\n    switch costume to (level 1 8 v)\n    Clone at x [0] y [0]\n    switch costume to (level 1 9 v)\n    Clone at x [700] y [0]\n    Clone at x [500] y [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x [0] y [300]\n        Clone at x [460] y [0]\n    else\n        switch costume to (level 3 1 v)\n    end\nend\n\ndefine Position (x) (y)\ngo to [back v] layer\ngo [forward v] (5) layers\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x (x) y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Opponents\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\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\nwhen I receive [tick v]\nif <(MY PLAYER #) = (player #)> then\n    set [offline v] to [100]\n    hide\nelse\n    Tick\nend\n\nforever\nend\n\ndefine value = cloud # (player)\nif <(player) = [1]> then\n    set [value v] to (☁ 1)\nelse\n    if <(player) = [2]> then\n        set [value v] to (☁ 2)\n    else\n        if <(player) = [3]> then\n            set [value v] to (☁ 3)\n        else\n            if <(player) = [4]> then\n                set [value v] to (☁ 4)\n            else\n                if <(player) = [5]> then\n                    set [value v] to (☁ 5)\n                else\n                    if <(player) = [6]> then\n                        set [value v] to (☁ 6)\n                    else\n                        if <(player) = [7]> then\n                            set [value v] to (☁ 7)\n                        else\n                            if <(player) = [8]> then\n                                set [value v] to (☁ 8)\n                            else\n                                if <(player) = [9]> then\n                                    set [value v] to (☁ 9)\n                                else\n                                    set [value v] to (☁ 10)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [setup - opponents v]\nsetup players\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\nset [user v] to (value)\nvalue = read from encoded\nvalue = read from encoded\nset [x v] to (value)\nvalue = read from encoded\nset [y v] to (value)\nvalue = read from encoded\nsay (join (user) (join [ ] (item (value) of [chat v])))\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 Position (x) (y)\ngo to x: (x) y: (y)\nif <touching (_edge_ v)?> then\n    set [ghost v] effect to (100)\nelse\n    set [ghost v] effect to (0)\nend\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [begin v]\nhide\n\nif <<(x) = (x position)> and <(y) = (y position)>> then\nelse\nend\n\nshow\n\n@Portal1\n\nwhen I receive [green v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\nturn right (2) degrees\n\nwhen I receive [setup v]\nhide\nset size to (100) %\nclear graphic effects\nset [collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to ( v)\n    Clone at x [7606] y [51]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to ( v)\n        Clone at x [-115] y [-70]\n        Clone at x [94] y [-8]\n        Clone at x [-67] y [79]\n        Clone at x [-161] y [177]\n        Clone at x [145] y [254]\n    end\nend\nset [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)\nswitch costume to (1 v)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nrepeat (20)\n    change size by (-1)\nend\n\nchange [ghost v] effect by (10)\nchange y by (0.5)\n\nset size to (100) %\n\n@Portal2\n\nwhen I receive [green v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [exit v] to [win]\nelse\n    turn left (2) degrees\nend\n\nwhen I receive [setup v]\nhide\nset size to (100) %\nclear graphic effects\nset [collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to ( v)\n    Clone at x [7606] y [51]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to ( v)\n        Clone at x [-115] y [-70]\n        Clone at x [94] y [-8]\n        Clone at x [-67] y [79]\n        Clone at x [-161] y [177]\n        Clone at x [145] y [254]\n    end\nend\nset [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)\nswitch costume to (1 v)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nrepeat (20)\n    change size by (-1)\nend\n\nchange [ghost v] effect by (10)\nchange y by (0.5)\n\nset size to (100) %\n\n@Win!\n\ndefine Smooth Glide: (x) (y) (speed)\nrepeat until <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\ngo to [front v] layer\nshow\ngo to x: (20) y: (200)\nSmooth Glide: [20] [0] [20]\n\nhide\n\nwhen this sprite clicked\nhide\n\n@Thumbnail\n\nwhen flag clicked\nclear graphic effects\ngo to [front v] layer\nset [ghost v] effect to (100)\n\nhide\n\nreset timer\nset [stop v] to [0]\n\nhide\n\nif <(EXIT) = []> then\n    clear graphic effects\nend\n\ngo to x: (0) y: (200)\n\nwhen I receive [tick v]\n\nset [stop v] to [1]\ngo to [front v] layer\nset [ghost v] effect to (100)\nhide\nreset timer\n\nwhen I receive [end v]\nshow\n\ngo [backward v] (1) layers\n\nbroadcast (end v)\n\nforever\nend\n\nwait (1) seconds\n\n@Figur2\n\n