Earth A Cloud Multiplayer Platformer

Instructions: Arrow Keys To Move Play With Your Friends\nR to Restart \nYou Can Wall Jump

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\n@Cloud Engine\n\ndefine Decode (data)\ndelete all of [cloud list v]\nset [output v] to []\nset [i v] to [0]\nrepeat ((length of (data)) / (2))\n    change [i v] by (2)\n    switch costume to (join (letter ((I) - (1)) of (data)) (letter (I) of (data)))\n    if <(costume [name v]) = [~]> then\n        add (Output) to [cloud list v]\n        set [output v] to []\n    else\n        set [output v] to (join (Output) (costume [name v]))\n    end\nend\n\ndefine Encode\nset [output v] to []\nset [n v] to [0]\nrepeat (length of [my list v])\n    set [i v] to [0]\n    change [n v] by (1)\n    repeat (length of (item (n) of [my list v]))\n        change [i v] by (1)\n        switch costume to (letter (I) of (item (n) of [my list v]))\n        if <(costume [number v]) < [10]> then\n            set [output v] to (join (Output) (join [0] (costume [number v])))\n        else\n            set [output v] to (join (Output) (costume [number v]))\n        end\n    end\n    set [output v] to (join (Output) [53])\nend\n\ndefine Update Players List (id)\nif <(id) = [1]> then\n    set [player list v] to [0]\n    delete all of [check v]\n    repeat (10)\n        change [player list v] by (1)\n        add (item (((Player List) * (4)) - (1)) of [cloud list v]) to [check v]\n    end\nelse\n    if <(id) = [2]> then\n        set [player list v] to [0]\n        repeat (10)\n            change [player list v] by (1)\n            if <not <(@PlayerSlot) = (Player List)>> then\n                if <(item (Player List) of [check v]) = (item (((Player List) * (4)) - (1)) of [cloud list v])> then\n                    replace item (Player List) of [active check v] with [Off]\n                else\n                    replace item (Player List) of [active check v] with [On]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [initialise  v]\ndelete all of [active check v]\nrepeat (10)\n    add [off] to [active check v]\nend\n\nwhen I receive [start v]\nforever\n    Update Players List [1]\n    wait (1.1) seconds\n    Update Players List [2]\nend\n\nwhen I receive [get data v]\nDecode Data\n\ndefine Save Data (id)\nEncode\nif <(id) = [1]> then\n    set [☁ p1 v] to (Output)\nelse\n    if <(id) = [2]> then\n        set [☁ p2 v] to (Output)\n    else\n        if <(id) = [3]> then\n            set [☁ p3 v] to (Output)\n        else\n            if <(id) = [4]> then\n                set [☁ p4 v] to (Output)\n            else\n                if <(id) = [5]> then\n                    set [☁ p5 v] to (Output)\n                else\n                    if <(id) = [6]> then\n                        set [☁ p6 v] to (Output)\n                    else\n                        if <(id) = [7]> then\n                            set [☁ p7 v] to (Output)\n                        else\n                            if <(id) = [8]> then\n                                set [☁ p8 v] to (Output)\n                            else\n                                if <(id) = [9]> then\n                                    set [☁ p9 v] to (Output)\n                                else\n                                    if <(id) = [10]> then\n                                        set [☁ p10 v] to (Output)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nDecode Data\nSave Data (@PlayerSlot)\nDetermine Players\n\ndefine Decode Data\nDecode (join (☁ P1) (join (☁ P2) (join (☁ P3) (join (☁ P4) (join (☁ P5) (join (☁ P6) (join (☁ P7) (join (☁ P8) (join (☁ P9) (☁ P10))))))))))\n\ndefine Determine Players\nset [players v] to [1]\nset [i v] to [0]\nrepeat (10)\n    change [i v] by (1)\n    if <(item (I) of [active check v]) = [On]> then\n        change [players v] by (1)\n    end\nend\n\n@Banners\n\nwhen I receive [start v]\nif <(Full?) = [True]> then\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\n    switch costume to (full v)\n    repeat (10)\n        change [brightness v] effect by (10)\n    end\n    clear graphic effects\n    wait (1) seconds\n    hide\nelse\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nend\n\nwhen I receive [initialise  v]\nswitch costume to (connecting v)\nshow\nclear graphic effects\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [full? v] to [False]\nset [kick v] to [False]\nset [moved? v] to [800]\nset [tick v] to [0]\n\nwhen I receive [you have been booted. v]\nswitch costume to (booted v)\nshow\nclear graphic effects\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen flag clicked\nbroadcast (Initialise  v) and wait\nGet Player Slot\nset [moved? v] to [600]\nif <not <(@PlayerSlot) > [0]>> then\n    set [full? v] to [True]\nend\nbroadcast (start v)\nforever\n    broadcast (Tick v) and wait\n    change [tick v] by (1)\nend\n\ndefine Get Player Slot\nset [@playerslot v] to [0]\nbroadcast (Get Data v) and wait\nset [moved? v] to [0]\ndelete all of [check v]\nrepeat (10)\n    change [moved? v] by (1)\n    add (item (((Moved?) * (4)) - (2)) of [cloud list v]) to [check v]\nend\nwait (1.5) seconds\nbroadcast (Get Data v) and wait\nset [moved? v] to [0]\nrepeat (10)\n    change [moved? v] by (1)\n    if <(item (Moved?) of [check v]) = (item (((Moved?) * (4)) - (2)) of [cloud list v])> then\n        set [@playerslot v] to (Moved?)\n        stop [this script v]\n    end\nend\n\n@Spikes\n\nwhen I receive [initialise  v]\nset [level? v] to [1]\nhide\n\nwhen I receive [tick v]\nshow\nswitch costume to (Level?)\n\n@HitboxLevel\n\nwhen I receive [initialise  v]\nset [level? v] to [1]\nhide\n\nwhen I receive [tick v]\nshow\nswitch costume to (Level?)\n\n@Players\n\ndefine Movement (id)\nplatform physics (14) (-0.8) (0.9) (0.65) (8) (8)\nSave My Data\nswitch costume to (player v)\nshow\nthink (username)\nif <<(x position) > [235]> and <not <(Level?) = [9]>>> then\n    change [level? v] by (1)\n    go to x: (-180) y: (0)\nend\nif <<<touching (spikes v)?> or <key (r v) pressed?>> or <(y position) < [-180]>> then\n    go to x: (-180) y: (0)\nend\n\nwhen I receive [initialise  v]\ngo to x: (-180) y: (0)\nhide\nset [username v] to (username)\nset [clone id v] to [0]\nrepeat (10)\n    change [clone id v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [tick v]\nTick\n\ndefine (id)\nif <(item (id) of [active check v]) = [Off]> then\n    hide\nelse\n    think (item ((id) * (5)) of [cloud list v])\n    go to x: (item (((id) * (5)) - (4)) of [cloud list v]) y: (item (((id) * (5)) - (3)) of [cloud list v])\n    switch costume to (join [P] (id))\n    if <(Level?) = (item (((id) * (5)) - (1)) of [cloud list v])> then\n        show\n    else\n        hide\n    end\nend\n\ndefine Save My Data\ndelete all of [my list v]\nadd (x position) to [my list v]\nadd (y position) to [my list v]\nadd (pick random (9999) to (999999)) to [my list v]\nadd (Level?) to [my list v]\nadd (username) to [my list v]\n\ndefine Tick\nif <(Clone ID) = (@PlayerSlot)> then\n    Movement (Clone ID)\nelse\n    (Clone ID)\nend\n\ndefine platform physics (jump height) (gravity) (friction) (movement speed) (wall jump vm) (wall jump hm)\nset [ghost v] effect to (30)\nchange y by (y vel)\nif <touching (hitboxlevel v)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching (hitboxlevel v)?> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<<<((mouse y) - (y position)) > [50]> and <mouse down?>> or <key (up arrow v) pressed?>> and <not <(y vel) > [0]>>> then\n        set [y vel v] to (jump height)\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [x vel v] by (movement speed)\nend\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    change [x vel v] by ((-1) * (movement speed))\nend\nchange x by (x vel)\nif <touching (hitboxlevel v)?> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching (hitboxlevel v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (hitboxlevel v)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching (hitboxlevel v)?> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        if <<<((mouse y) - (y position)) > [50]> and <mouse down?>> or <key (up arrow v) pressed?>> then\n            if <(x vel) < [0]> then\n                set [x vel v] to [0]\n                if <<key (left arrow v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>> then\n                    point in direction (-90)\n                    set [x vel v] to (wall jump hm)\n                    set [y vel v] to (wall jump vm)\n                end\n            else\n                set [x vel v] to [0]\n                if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n                    point in direction (90)\n                    set [x vel v] to ((-1) * (wall jump hm))\n                    set [y vel v] to (wall jump vm)\n                end\n            end\n        end\n    end\nend\nset [x vel v] to ((x vel) * (friction))\n\nwhen I receive [tick v]\nif <key (right arrow v) pressed?> then\n    point in direction (90)\nend\nif <key (left arrow v) pressed?> then\n    point in direction (-90)\nend\n\nwhen flag clicked\nforever\n    play sound [TheFatRat - Unity.mp3 v] until done\nend\n\n@Art\n\nwhen I receive [tick v]\nshow\ngo to [back v] layer\nswitch costume to (Level?)\n\nwhen I receive [initialise  v]\nset [level? v] to [1]\nhide\n\n@Shadows\n\nwhen I receive [tick v]\nshow\nset [ghost v] effect to (45)\ngo to [back v] layer\nswitch costume to (Level?)\n\nwhen I receive [initialise  v]\nset [level? v] to [1]\nhide\n\n@Thumbnail\n\nwhen flag clicked\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.01)\nshow\nclear graphic effects\ngo to [front v] layer\ngo to x: (0) y: (0)\n\n