☁cloud multiplayer a frosty platformer
@Stage\n\nwhen [7 v] key pressed\nset [player v] to [1]\nwait (1) seconds\nset [player v] to [2]\nwait (1) seconds\nset [player v] to [3]\nwait (1) seconds\nset [player v] to [4]\nwait (1) seconds\n\nwhen [7 v] key pressed\n\n@mon jouer\n\nwhen flag clicked\nforever\n    if <<key (up arrow v) pressed?> and <key (right arrow v) pressed?>> then\n        switch costume to (4a v)\n    end\n    if <<key (up arrow v) pressed?> and <key (left arrow v) pressed?>> then\n        switch costume to (5a v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<key (up arrow v) pressed?> and <key (right arrow v) pressed?>> then\n        switch costume to (4a v)\n    end\n    if <<key (up arrow v) pressed?> and <key (left arrow v) pressed?>> then\n        switch costume to (5a v)\n    end\nend\n\nwhen flag clicked\nforever\n    set rotation style [left-right v]\nend\n\ndefine encoder (nombre de encoder)\nset [position dans nombre v] to [1]\nrepeat (length of (nombre de encoder))\n    set [nombre encodé v] to (join (nombre encodé) (item # of (letter (position dans nombre) of (nombre de encoder)) in [encodage v]))\n    change [position dans nombre v] by (1)\nend\nset [nombre encodé v] to (join (nombre encodé) [00])\n\ndefine commencer a decoder (numéro player)\nset [position a décodé v] to [1]\nset [nombre décocodé v] to []\nif <(numéro player) = [1]> then\n    set [a décoder v] to (☁ player 1)\nend\nif <(numéro player) = [2]> then\n    set [a décoder v] to (☁ player 2)\nend\nif <(numéro player) = [3]> then\n    set [a décoder v] to (☁ player 3)\nend\nif <(numéro player) = [4]> then\n    set [a décoder v] to (☁ player 4)\nend\n\ndefine commencer a encoder\nset [nombre encodé v] to []\n\ndefine Finir d'encoder pour (numéro player)\nif <(numéro player) = [1]> then\n    set [☁ player 1 v] to (nombre encodé)\nend\nif <(numéro player) = [2]> then\n    set [☁ player 2 v] to (nombre encodé)\nend\nif <(numéro player) = [3]> then\n    set [☁ player 3 v] to (nombre encodé)\nend\nif <(numéro player) = [4]> then\n    set [☁ player 4 v] to (nombre encodé)\nend\n\nwhen flag clicked\nset [level v] to [0]\nswitch backdrop to (arrière plan2 v)\nset [player v] to [0]\nset [nombre maximum players v] to [4]\nse conecté\nbroadcast (créer clone v) and wait\nif <(player) > [0]> then\n    switch backdrop to (arrière plan3 v)\n    wait (1) seconds\n    switch backdrop to (arrière plan1 v)\n    broadcast (setup v)\nelse\n    switch backdrop to (arrière plan4 v)\nend\n\nwhen I receive [setup v]\nforever\n    if <(player) > [0]> then\n        show\n        mouvement\n        encoder mouvement\n    else\n        hide\n    end\nend\n\ndefine Decoder\nset [nombre décocodé v] to []\nset [chiffre codé v] to [01]\nrepeat until <(chiffre codé) = [00]>\n    set [chiffre codé v] to (join (letter (position a décodé) of (a décoder)) (letter ((position a décodé) + (1)) of (a décoder)))\n    set [nombre décocodé v] to (join (nombre décocodé) (item (chiffre codé) of [encodage v]))\n    change [position a décodé v] by (2)\nend\n\ndefine se conecté\nset [player 1 v] to (☁ player 1)\nset [player2 v] to (☁ player 2)\nset [player3 v] to (☁ player 3)\nset [player4 v] to (☁ player 4)\nwait (3) seconds\nif <(☁ player 1) = (player 1)> then\n    set [player v] to [1]\nelse\n    if <(☁ player 2) = (player2)> then\n        set [player v] to [2]\n    else\n        if <(☁ player 3) = (player3)> then\n            set [player v] to [3]\n        else\n            if <(☁ player 4) = (player4)> then\n                set [player v] to [4]\n            end\n        end\n    end\nend\n\ndefine mouvement\nif <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>>> then\n    change [gauche v] by (1)\n    switch costume to (1a v)\nelse\n    if <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>>> then\n        change [gauche v] by (-1)\n        switch costume to (2a v)\n    end\nend\nset [gauche v] to ((gauche) * (0.9))\nchange x by (gauche)\nif <touching (platform v)?> then\n    change y by (1)\n    if <touching (platform v)?> then\n        change y by (1)\n        if <touching (platform v)?> then\n            change y by (1)\n            if <touching (platform v)?> then\n                change y by (1)\n            end\n            if <touching (platform v)?> then\n                change y by (1)\n            end\n        end\n    end\nend\nif <touching (platform v)?> then\n    change x by ((gauche) * (-1))\n    change y by (-5)\n    if <key (up arrow v) pressed?> then\n        if <(gauche) > [0]> then\n            set [gauche v] to [-5]\n        else\n            set [gauche v] to [5]\n        end\n        set [droite v] to [10]\n    else\n        set [droite v] to [0]\n    end\nend\nchange [droite v] by (-1)\nchange y by (droite)\nif <touching (platform v)?> then\n    change y by ((droite) * (-1))\n    set [droite v] to [0]\nend\nchange y by (-1)\nif <touching (platform v)?> then\n    if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<(y position) < (mouse y)> and <mouse down?>>>> then\n        switch costume to (6a v)\n        set [droite v] to [15]\n    end\nend\nchange y by (1)\nif <<touching (spikes v)?> or <(y position) < [-170]>> then\n    repeat (10)\n        change [ghost v] effect by (10)\n        wait (0) seconds\n    end\n    go to x: (-203) y: (14)\n    repeat (10)\n        change [ghost v] effect by (-10)\n        wait (0) seconds\n    end\nend\nif <(x position) > [239]> then\n    go to x: (-203) y: (14)\n    broadcast (vite v)\nend\n\ndefine encoder mouvement\ncommencer a encoder\nencoder (round (x position))\nencoder (round (y position))\nencoder (level)\nencoder (join (join (player) [:]) (username))\nencoder (timer)\nencoder []\nFinir d'encoder pour (player)\n\nwhen I receive [vite v]\nchange [level v] by (1)\n\nwhen flag clicked\ngo to x: (-203) y: (14)\n\nwhen I receive [reset v]\ngo to x: (-203) y: (14)\n\nwhen flag clicked\nforever\n    play sound [Exlo - Free v] until done\nend\n\n@opposant\n\ndefine commencer a decoder (numéro player)\nset [position a décodé v] to [1]\nset [nombre décocodé v] to []\nif <(numéro player) = [1]> then\n    set [a décoder v] to (☁ player 1)\n    switch costume to (player 1 v)\nend\nif <(numéro player) = [2]> then\n    set [a décoder v] to (☁ player 2)\n    switch costume to (player 2 v)\nend\nif <(numéro player) = [3]> then\n    set [a décoder v] to (☁ player 3)\n    switch costume to (player 3 v)\nend\nif <(numéro player) = [4]> then\n    set [a décoder v] to (☁ player 4)\n    switch costume to (player 4 v)\nend\n\ndefine Decoder\nset [nombre décocodé v] to []\nset [chiffre codé v] to [01]\nrepeat until <(chiffre codé) = [00]>\n    set [chiffre codé v] to (join (letter (position a décodé) of (a décoder)) (letter ((position a décodé) + (1)) of (a décoder)))\n    set [nombre décocodé v] to (join (nombre décocodé) (item (chiffre codé) of [encodage v]))\n    change [position a décodé v] by (2)\nend\n\ndefine setup clones\nset [numéro player v] to [1]\nrepeat (nombre maximum players)\n    create clone of (_myself_ v)\n    change [numéro player v] by (1)\nend\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nshow\nforever\n    if <(player) = (numéro player)> then\n        set [offline v] to [101]\n        hide\n    else\n        commencer a decoder (numéro player)\n        Decoder\n        set x to (nombre décocodé)\n        Decoder\n        set y to (nombre décocodé)\n        Decoder\n        set [level oppansant v] to (nombre décocodé)\n        Decoder\n        think (nombre décocodé)\n        Decoder\n        if <(level) = (level oppansant)> then\n            show\n        else\n            hide\n        end\n        Decoder\n        deconecter (numéro player)\n    end\nend\n\ndefine Finir d'encoder pour (numéro player)\nif <(numéro player) = [1]> then\n    set [☁ player 1 v] to (nombre encodé)\nend\nif <(numéro player) = [2]> then\n    set [☁ player 2 v] to (nombre encodé)\nend\nif <(numéro player) = [3]> then\n    set [☁ player 3 v] to (nombre encodé)\nend\nif <(numéro player) = [4]> then\n    set [☁ player 4 v] to (nombre encodé)\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\n\nwhen I receive [créer clone v]\nsetup clones\n\ndefine deconecter (numero player)\nif <(numero player) = [1]> then\n    if <(derniere position) = (join [A] (☁ player 1))> then\n        change [offline v] by (1)\n    else\n        set [derniere position v] to (join [A] (☁ player 1))\n        set [offline v] to [0]\n    end\nend\nif <(numero player) = [2]> then\n    if <(derniere position) = (join [A] (☁ player 2))> then\n        change [offline v] by (1)\n    else\n        set [derniere position v] to (join [A] (☁ player 2))\n        set [offline v] to [0]\n    end\nend\nif <(numero player) = [3]> then\n    if <(derniere position) = (join [A] (☁ player 3))> then\n        change [offline v] by (1)\n    else\n        set [derniere position v] to (join [A] (☁ player 3))\n        set [offline v] to [0]\n    end\nend\nif <(numero player) = [4]> then\n    if <(derniere position) = (join [A] (☁ player 4))> then\n        change [offline v] by (1)\n    else\n        set [derniere position v] to (join [A] (☁ player 4))\n        set [offline v] to [0]\n    end\nend\nif <<(offline) = [0]> and <(level oppansant) = (level)>> then\n    show\nend\nif <(offline) > [100]> then\n    hide\nend\n\nwhen flag clicked\nforever\n\n@platform\n\nwhen flag clicked\nset size to (90) %\nhide\n\nwhen I receive [vite v]\nnext costume\n\nwhen flag clicked\nswitch costume to (level 1 v)\nwait (3) seconds\nshow\nforever\n    go to [front v] layer\nend\n\n@spikes\n\nwhen I receive [vite v]\nnext costume\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\n@decor\n\nwhen flag clicked\nset size to (90) %\nhide\n\nwhen I receive [vite v]\nnext costume\n\nwhen flag clicked\nswitch costume to (level 1 v)\nwait (3) seconds\nshow\nforever\n    go to [back v] layer\nend\n\n@detector\n\nwhen flag clicked\ngo to [front v] layer\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\nshow\ngo to x: (0) y: (50)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\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
hi my new project is here \npls love and fav and follow @programmerflochat \nit tooks me 8+ hours \n575+ bocks =D \nno pub !!\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\ncontrols:\narrows or touch to move or wasd\nT to chat (coming soon )\nHave fun !!!!\n#1 on trending !!!! Thanks 0-0\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nPropose this project to be feutured https://scratch.mit.edu/studios/4228481/comments/