Insanity multiplayer Cloud Platformer #Games

Instructions: Insanity - Cloud Multiplayer Platformer\n#44 on #games!!\n\nSequel is out!!!\nhttps://scratch.mit.edu/projects/418225789/\n\nSupports 10 players\n11 levels\nMobile friendly\nOriginal\n100 second afk kick\nThis took me 7 hours and  about 448 blocks\nTitle screen thingy - not original lots of credit to @Ryham301 for the idea for the thumbnail\nMusic is by @bubblebee3 \n\nSorry but only scratchers can play multiplayer\n\n1100+ views!!!\n96+Loves!!\n83+Faves!!\n\n@StratfordJames loved!!

@Stage\n\n@player\n\ndefine write (value) to cloud\nset [i v] to [1]\nrepeat (length of (value))\n    set [encoded v] to (join (encoded) (item # of (letter (i) of (value)) in [table v]))\n    change [i v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\nwhen flag clicked\ngo to x: (-173) y: (40)\nset [max players v] to [10]\nset [my player # v] to [0]\nset [spawn y v] to [60]\nbroadcast (setup opponents v) and wait\nbroadcast (message to join v) and wait\nbroadcast (join game v) and wait\nif <(MY PLAYER #) > [0]> then\n    broadcast (joined v) and wait\nelse\n    broadcast (full v) and wait\nend\nbroadcast (begin v)\n\ndefine set cloud # (player) to (something)\nif <(player) = [1]> then\n    set [☁ player1-data v] to (something)\nend\nif <(player) = [2]> then\n    set [☁ player2-data v] to (something)\nend\nif <(player) = [3]> then\n    set [☁ player3-data v] to (something)\nend\nif <(player) = [4]> then\n    set [☁ player4-data v] to (something)\nend\nif <(player) = [5]> then\n    set [☁ player5-data v] to (something)\nend\nif <(player) = [6]> then\n    set [☁ player6-data v] to (something)\nend\nif <(player) = [7]> then\n    set [☁ player7-data v] to (something)\nend\nif <(player) = [8]> then\n    set [☁ player8-data v] to (something)\nend\nif <(player) = [9]> then\n    set [☁ player9-data v] to (something)\nend\nif <(player) = [10]> then\n    set [☁ player10-data v] to (something)\nend\n\nwhen I receive [begin v]\nset [y v] to [0]\nforever\n    platformer engine\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 cloud\nwrite (round ((timer) * (10))) to cloud\nwrite (round (x position)) to cloud\nwrite (round (y position)) to cloud\nwrite ([costume # v] of [level v]) to cloud\nset cloud # (MY PLAYER #) to (encoded)\n\nwhen I receive [front v]\ngo to x: (-173) y: (spawn y)\n\nwhen I receive [back v]\ngo to x: (173) y: (spawn y)\n\ndefine platformer engine\nchange [y v] by (-1)\nif <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [x v] by (-1)\nend\nif <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [x v] by (1)\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (-4)\n    change x by ((x) * (-1))\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> then\n        set [y v] to [17]\n        if <(x) > [0]> then\n            set [x v] to [-10]\n        else\n            set [x v] to [10]\n        end\n    else\n        set [x v] to [0]\n    end\nend\nchange y by (y)\nif <touching (level v)?> then\n    change y by ((y) - ((y) * (2)))\n    set [y v] to [0]\nend\nchange y by (-1)\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <((mouse y) - (y position)) > [50]>>> and <touching (level v)?>> then\n    set [y v] to [15]\nend\nchange y by (1)\nif <<<touching (obstacles v)?> or <(y position) < [-175]>> or <key (r v) pressed?>> then\n    go to x: (-173) y: (40)\nend\nif <([abs v] of (x position) ) > [230]> then\n    if <(x position) > [230]> then\n        broadcast (front v)\n    else\n        broadcast (back v)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Storm by bubblebee3 v] until done\nend\n\nset [☁ player1-data v] to [0]\nset [☁ player2-data v] to [0]\nset [☁ player3-data v] to [0]\nset [☁ player4-data v] to [0]\nset [☁ player5-data v] to [0]\nset [☁ player6-data v] to [0]\nset [☁ player7-data v] to [0]\nset [☁ player8-data v] to [0]\nset [☁ player9-data v] to [0]\nset [☁ player10-data v] to [0]\n\n@opponents\n\ndefine begin decode of (encoded)\nset [encoded v] to (encoded)\nset [i v] to [1]\n\ndefine decode\nset [value v] to []\nforever\n    set [idx v] to (join (letter (((i) * (2)) - (1)) of (encoded)) (letter ((i) * (2)) of (encoded)))\n    change [i v] by (1)\n    if <(idx) < [1]> then\n        stop [this script v]\n    end\n    set [value v] to (join (value) (item (idx) of [table v]))\nend\n\ndefine setup players\nset [color v] effect to (90)\nhide\nset [player # v] to [1]\nset [offline v] to [100]\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    change [player # v] by (1)\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 variable = cloud # (player)\nif <(player) = [1]> then\n    set [value v] to (☁ player1-data)\nend\nif <(player) = [2]> then\n    set [value v] to (☁ player2-data)\nend\nif <(player) = [3]> then\n    set [value v] to (☁ player3-data)\nend\nif <(player) = [4]> then\n    set [value v] to (☁ player4-data)\nend\nif <(player) = [5]> then\n    set [value v] to (☁ player5-data)\nend\nif <(player) = [6]> then\n    set [value v] to (☁ player6-data)\nend\nif <(player) = [7]> then\n    set [value v] to (☁ player7-data)\nend\nif <(player) = [8]> then\n    set [value v] to (☁ player8-data)\nend\nif <(player) = [9]> then\n    set [value v] to (☁ player9-data)\nend\nif <(player) = [10]> then\n    set [value v] to (☁ player10-data)\nend\n\nwhen I receive [setup opponents v]\nsetup players\n\ndefine tick\nvariable = 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)\ndecode\nsay (value)\ndecode\ndecode\nset x to (value)\ndecode\nset y to (value)\ndecode\nif <(value) = ([costume # v] of [level v])> then\n    show\nelse\n    hide\nend\n\nwhen I receive [join game v]\nvariable = cloud # (player #)\nset [last value v] to (join [A] (value))\nwait (3.1) seconds\nvariable = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    set [my player # v] to (player #)\nend\n\n@Sprite1\n\nwhen I receive [message to join v]\nswitch costume to (connecting v)\n\nwhen I receive [full v]\nswitch costume to (full v)\nwait (0.1) seconds\nhide\n\nwhen I receive [joined v]\nhide\n\nwhen flag clicked\nshow\nforever\n    go to [front v] layer\nend\n\n@Level\n\nwhen I receive [front v]\nnext costume\n\nwhen I receive [back v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\nwhen I receive [starrrt v]\nshow\n\n@Sprite2\n\nwhen I receive [begin v]\nhide\nforever\n    go to [back v] layer\n    go to x: (-230) y: (pick random (-25) to (220))\n    create clone of (_myself_ v)\n    wait (1.4) seconds\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (pick random (20) to (50))\nrepeat until <(x position) > [300]>\n    change x by (5)\nend\ndelete this clone\n\n@download (6)\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@Obstacles\n\nwhen flag clicked\nhide\ngo to [back v] layer\nswitch costume to (costume1 v)\n\nwhen I receive [back v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen I receive [front v]\nnext costume\n\nwhen I receive [starrrt v]\nshow\n\n@Sprite3\n\nwhen flag clicked\ngo to [front v] layer\nshow\nwait (0.00001) seconds\nbroadcast (starrrt v)\nhide\n\n