☁ Cloud Platformer Race ⚔️ | #games #all #cloud
@Stage\n\nwhen flag clicked\nswitch backdrop to (bg v)\n\nset [☁ p1 v] to [11111111111111111111111111111111111111111111111111111111111110]\nset [☁ p2 v] to [11111111111111111111111111111111111111111111111111111111111110]\nset [☁ p3 v] to [11111111111111111111111111111111111111111111111111111111111110]\nset [☁ p4 v] to [11111111111111111111111111111111111111111111111111111111111110]\nset [☁ p5 v] to [11111111111111111111111111111111111111111111111111111111111110]\nset [☁ p6 v] to [11111111111111111111111111111111111111111111111111111111111110]\nset [☁ p7 v] to [11111111111111111111111111111111111111111111111111111111111110]\nset [☁ p8 v] to [11111111111111111111111111111111111111111111111111111111111110]\nset [☁ map v] to [1]\n\nwhen I receive [new round v]\nswitch backdrop to (background v)\n\nwhen I receive [singleplayer game start v]\nswitch backdrop to (background v)\n\n@ \n\nwhen flag clicked\nif <(kicked) = [1]> then\n    stop [all v]\nend\n\nset [kicked v] to [0]\n\n@thumbnail\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\n    go to [front v] layer\n    show\nend\n\n@lag\n\nwhen I receive [slot full v]\ngo to [front v] layer\nswitch costume to (cst2 v)\nshow\ngo to x: (0) y: (0)\nstop [all v]\n\nwhen I receive [loop v]\nhide\nforever\n    reset timer\n    set [fps v] to [0]\n    repeat (30)\n        change [fps v] by (1)\n    end\n    if <([abs v] of ((timer) - (1)) ) > [0.8]> then\n        go to [front v] layer\n        switch costume to (cst v)\n        show\n        go to x: (0) y: (0)\n        stop [all v]\n    end\nend\n\nwhen flag clicked\nhide\n\n@player\n\nwhen flag clicked\nset [_ v] to [0]\nset [_coin v] to [0]\nset [round played v] to [0]\nhide\n\nwhen I receive [new round v]\ndelete all of [coords v]\nforever\n    add (join (join ([floor v] of (((P: x) + (240)) / (100)) ) (join ([floor v] of ((((P: x) + (240)) mod (100)) / (10)) ) (((P: x) + (240)) mod (10)))) (join (join ([floor v] of (((P: y) + (180)) / (100)) ) (join ([floor v] of ((((P: y) + (180)) mod (100)) / (10)) ) (((P: y) + (180)) mod (10)))) [])) to [coords v]\n    wait (0.02) seconds\nend\n\nwhen I receive [new round v]\nchange [round played v] by (1)\ndelete all of [coords v]\ngo to x: (-220) y: (-60)\nshow\nset [vy v] to [0]\nset [vx v] to [0]\nforever\n    if <(anyPlayerGoalReached?) = [0]> then\n        switch costume to (join [oppo] (((P: id) - (1)) mod (4)))\n        player tick\n        if <(length of [active player id v]) > [1]> then\n            change [racing-hour v] by (1)\n            if <(racing-hour) > [299.5]> then\n                change [racing-hour v] by (-300)\n                change [_coin v] by (5)\n            end\n        end\n        if <<(inSpectator?) = [0]> and <touching (goal v)?>> then\n            set [p: goalreached v] to [1]\n            hide\n            broadcast (goal reached! v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [loop v]\nset [racing-hour v] to [0]\nset [round played v] to [0]\nbroadcast (new round v)\n\nwhen I receive [singleplayer game start v]\ngo to x: (-220) y: (-60)\nshow\nset [vy v] to [0]\nset [vx v] to [0]\nforever\n    switch costume to (oppo0 v)\n    player tick\n    if <touching (goal v)?> then\n        go to x: (-220) y: (-60)\n        broadcast (singleplayer next map v)\n    end\nend\n\ndefine player tick\nset [p: x v] to ([floor v] of (x position) )\nset [p: y v] to ([floor v] of (y position) )\nset [z-leftarr v] to <<key (left arrow v) pressed?> or <key (a v) pressed?>>\nset [z-rightarr v] to <<key (right arrow v) pressed?> or <key (d v) pressed?>>\nset [z-uparr v] to <<key (up arrow v) pressed?> or <key (w v) pressed?>>\nif <(z-rightArr) = [1]> then\n    if <(-player-speedBoost) = [1]> then\n        change [vx v] by (1)\n    else\n        change [vx v] by (0.6)\n    end\nend\nif <(z-leftArr) = [1]> then\n    if <(-player-speedBoost) = [1]> then\n        change [vx v] by (-1)\n    else\n        change [vx v] by (-0.6)\n    end\nend\nset [vx v] to ((vx) * (0.9))\nchange x by (vx)\nif <touching (platformer v)?> then\n    change y by (1)\n    if <touching (platformer v)?> then\n        change y by (1)\n        if <touching (platformer v)?> then\n            change y by (1)\n            if <touching (platformer v)?> then\n                change y by (1)\n                if <touching (platformer v)?> then\n                    change y by (1)\n                    if <touching (platformer v)?> then\n                        change x by ((vx) * (-1))\n                        change y by (-5)\n                        set [vx v] to [0]\n                    end\n                end\n            end\n        end\n    end\nend\nchange [vy v] by (-1)\nchange y by (vy)\nif <touching (platformer v)?> then\n    change y by ((-1) * (vy))\n    set [vy v] to [0]\nend\nchange y by (-3)\nif <touching (platformer v)?> then\n    if <(z-upArr) = [1]> then\n        if <(-player-jumpBoost) = [1]> then\n            set [vy v] to [13]\n        else\n            set [vy v] to [9]\n        end\n    end\nend\nchange y by (3)\nif <(y position) < [-95]> then\n    go to x: (-220) y: (-58)\nend\n\n@opponent\n\nwhen I start as a clone\nshow\nset [last timing v] to [-1]\nset [update? v] to [1]\n\nglide (0.003) secs to x: ((join (letter (1) of (item (id) of [fulldecoded v])) (join (letter (2) of (item (id) of [fulldecoded v])) (letter (3) of (item (id) of [fulldecoded v])))) - (240)) y: ((join (letter (4) of (item (id) of [fulldecoded v])) (join (letter (5) of (item (id) of [fulldecoded v])) (letter (6) of (item (id) of [fulldecoded v])))) - (180))\nglide (0.003) secs to x: ((join (letter (10) of (item (id) of [fulldecoded v])) (join (letter (11) of (item (id) of [fulldecoded v])) (letter (12) of (item (id) of [fulldecoded v])))) - (240)) y: ((join (letter (13) of (item (id) of [fulldecoded v])) (join (letter (14) of (item (id) of [fulldecoded v])) (letter (15) of (item (id) of [fulldecoded v])))) - (180))\nglide (0.003) secs to x: ((join (letter (16) of (item (id) of [fulldecoded v])) (join (letter (17) of (item (id) of [fulldecoded v])) (letter (18) of (item (id) of [fulldecoded v])))) - (240)) y: ((join (letter (19) of (item (id) of [fulldecoded v])) (join (letter (20) of (item (id) of [fulldecoded v])) (letter (21) of (item (id) of [fulldecoded v])))) - (180))\n\nwhen flag clicked\nhide\nset [id v] to [0]\nrepeat (8)\n    change [id v] by (1)\n    create clone of (_myself_ v)\n    wait (0) seconds\nend\nset [id v] to [0]\n\nwhen I receive [tick v]\nswitch costume to (join [oppo] (((id) - (1)) mod (4)))\nif <(frame cycle) = [0]> then\n    if <<not <(last timing) = (join (letter (7) of (item (id) of [fulldecoded v])) (join (letter (8) of (item (id) of [fulldecoded v])) (letter (9) of (item (id) of [fulldecoded v]))))>> and <not <(letter (1) of (item (id) of [fulldecoded v])) = [9]>>> then\n        set [update? v] to [1]\n        go to x: ((join (letter (1) of (item (id) of [fulldecoded v])) (join (letter (2) of (item (id) of [fulldecoded v])) (letter (3) of (item (id) of [fulldecoded v])))) - (240)) y: ((join (letter (4) of (item (id) of [fulldecoded v])) (join (letter (5) of (item (id) of [fulldecoded v])) (letter (6) of (item (id) of [fulldecoded v])))) - (180))\n        set [last timing v] to (join (letter (7) of (item (id) of [fulldecoded v])) (join (letter (8) of (item (id) of [fulldecoded v])) (letter (9) of (item (id) of [fulldecoded v]))))\n    else\n        set [update? v] to [0]\n    end\nelse\n    if <(frame cycle) = [1]> then\n        if <(update?) = [1]> then\n            go to x: ((join (letter (10) of (item (id) of [fulldecoded v])) (join (letter (11) of (item (id) of [fulldecoded v])) (letter (12) of (item (id) of [fulldecoded v])))) - (240)) y: ((join (letter (13) of (item (id) of [fulldecoded v])) (join (letter (14) of (item (id) of [fulldecoded v])) (letter (15) of (item (id) of [fulldecoded v])))) - (180))\n        end\n    else\n        if <(update?) = [1]> then\n            go to x: ((join (letter (16) of (item (id) of [fulldecoded v])) (join (letter (17) of (item (id) of [fulldecoded v])) (letter (18) of (item (id) of [fulldecoded v])))) - (240)) y: ((join (letter (19) of (item (id) of [fulldecoded v])) (join (letter (20) of (item (id) of [fulldecoded v])) (letter (21) of (item (id) of [fulldecoded v])))) - (180))\n        end\n    end\nend\nif <<<[active player id v] contains (id)?> and <not <<(P: id) = (id)> and <(inSpectator?) = [0]>>>> and <not <(letter (1) of (item (id) of [fulldecoded v])) = [9]>>> then\n    show\nelse\n    hide\nend\n\n@blackout\n\nwhen flag clicked\nset [roundend? v] to [0]\nhide\n\nwhen I receive [goal reached! v]\nif <(☁ map) < (-max-map)> then\n    change [☁ map v] by (1)\nelse\n    set [☁ map v] to [1]\nend\nset [roundend? v] to [1]\ngo to [front v] layer\nshow\nwait (1) seconds\nprocess\n\nwhen I receive [player goal reached! v]\nset [roundend? v] to [1]\ngo to [front v] layer\nshow\nprocess\n\ndefine process\nwait (9) seconds\nset [anyplayergoalreached? v] to [0]\nset [p: goalreached v] to [0]\nhide\nset [roundend? v] to [0]\nbroadcast (new round v)\nstop [this script v]\n\nwhen I receive [bypass v]\nset [anyplayergoalreached? v] to [0]\nset [p: goalreached v] to [0]\nhide\nset [roundend? v] to [0]\nbroadcast (new round v)\nstop [other scripts in sprite v]\nstop [this script v]\n\n@menu\n\nwhen flag clicked\nshow\nwait (1) seconds\ngo to x: (0) y: (20)\nset [yv v] to [10]\npoint in direction (90)\nrepeat (20)\n    turn right (18) degrees\n    change y by (yv)\n    change [yv v] by (-1)\nend\nwait (0.5) seconds\nbroadcast (intro off v)\nwait (0.5) seconds\n\nwhen I receive [start game v]\nhide\n\nwhen I receive [intro off v]\nrepeat (5)\n    change [ghost v] effect by (20)\nend\n\n@platform\n\nwhen I receive [start game v]\nhide\n\nwhen flag clicked\ngo to x: (0) y: (-13)\nshow\n\nwhen I receive [intro off v]\nrepeat (5)\n    change [ghost v] effect by (20)\nend\n\n@cloud\n\ndefine encode datastream\nset [index v] to [1]\nset [stock_encoded v] to []\nrepeat (length of [fulldecoded v])\n    set [stock_encoded v] to (join (stock_Encoded) (item (index) of [fulldecoded v]))\n    change [index v] by (1)\nend\nset [fullencoded v] to (stock_Encoded)\n\ndefine clear encoding\nset [fullencoded v] to []\n\ndefine decode (datastream copy)\ndelete all of [fulldecoded v]\ndelete all of [username v]\ndelete all of [status v]\nset [index2 v] to [1]\nset [stockdecoded v] to []\nrepeat until <(index2) > (length of (datastream copy))>\n    set [stockdecoded v] to (join (stockDecoded) (letter (index2) of (datastream copy)))\n    if <(length of (stockDecoded)) = [21]> then\n        set [temp stock v] to (stockDecoded)\n        get string (datastream copy) from ((index2) + (1)) : ((index2) + (40))\n        decode nonprompt (_r)\n        add (temp stock) to [fulldecoded v]\n        add (_r: username) to [username v]\n        add (letter ((index2) + (41)) of (datastream copy)) to [status v]\n        set [stockdecoded v] to []\n        change [index2 v] by (41)\n    end\n    change [index2 v] by (1)\nend\n\ndefine get index of letter (s) in (str)\ndelete all of [_ v]\nset [_ v] to [1]\nrepeat (length of (str))\n    add (letter (_) of (str)) to [_ v]\n    change [_ v] by (1)\nend\nset [_r v] to (item # of (s) in [_ v])\n\ndefine get string (s) from (i1) : (i2)\nset [_r v] to []\nif <(i1) = []> then\n    set [_ v] to [1]\n    if <(i2) = []> then\n        set [_r v] to (s)\n    else\n        repeat (((i2) - (1)) + (1))\n            set [_r v] to (join (_r) (letter (_) of (s)))\n            change [_ v] by (1)\n        end\n    end\nelse\n    set [_ v] to (i1)\n    if <(i2) = []> then\n        repeat (((length of (s)) - (i1)) + (1))\n            set [_r v] to (join (_r) (letter (_) of (s)))\n            change [_ v] by (1)\n        end\n    else\n        repeat (((i2) - (i1)) + (1))\n            set [_r v] to (join (_r) (letter (_) of (s)))\n            change [_ v] by (1)\n        end\n    end\nend\n\ndefine count (s) in (str)\nset [_ v] to [1]\nset [_r v] to [0]\nrepeat (length of (str))\n    if <(letter (_) of (str)) = (s)> then\n        change [_r v] by (1)\n    end\n    change [_ v] by (1)\nend\n\ndefine get index of word (substr) in (str)\nif <(length of (substr)) = [1]> then\n    get index of letter (substr) in (str)\nelse\n    set [_r v] to [0]\n    if < (str) contains (substr)?> then\n        set [_ v] to [-100]\n        set [_r v] to [0]\n        set [z.temp v] to (str)\n        set [z.temp2 v] to [0]\n        repeat until <(_) = (length of (substr))>\n            change [z.temp2 v] by (_r)\n            get string (z.temp) from ((_r) + (1)) : []\n            set [z.temp v] to (_r)\n            get index of letter (letter (1) of (substr)) in (_r)\n            set [_ v] to [1]\n            repeat until <(_) > ((length of (substr)) - (1))>\n                if <not <(letter ((_) + (1)) of (substr)) = (letter ((_r) + (_)) of (z.temp))>> then\n                    set [_ v] to ((length of (substr)) + (1))\n                end\n                change [_ v] by (1)\n            end\n        end\n        change [z.temp2 v] by (_r)\n        set [_r v] to (z.temp2)\n    end\nend\n\ndefine update encode to cloud\nif <(length of [active player id v]) = [1]> then\n    change [lag delay counter v] by (1)\n    if <(lag delay counter) > [1]> then\n        set player data (P: id) (P: my data)\n        set [lag delay counter v] to [0]\n    end\nelse\n    set player data (P: id) (P: my data)\n    set [lag delay counter v] to [0]\nend\n\ndefine check active players\ndelete all of [active player id v]\nset [index4 v] to [1]\nrepeat (length of [fulldecoded v])\n    if <<(P: id) = (index4)> or <(item (index4) of [backup check active player id v]) = [1]>> then\n        add (index4) to [active player id v]\n    end\n    change [index4 v] by (1)\nend\n\ndefine join as player\nset [last data v] to (join (join (join (join (join (join (join (☁ P1) (☁ P2)) (☁ P3)) (☁ P4)) (☁ P5)) (☁ P6)) (☁ P7)) (☁ P8))\nset [p: id v] to [0]\njoin as player rwsr1\nwait (1) seconds\njoin as player rwsr2\nif <<[status v] contains [91]?> or <[status v] contains [11]?>> then\n    set [_status v] to [3]\n    repeat until <not <<[status v] contains [91]?> or <[status v] contains [11]?>>>\n        set [last data v] to (join (join (join (join (join (join (join (☁ P1) (☁ P2)) (☁ P3)) (☁ P4)) (☁ P5)) (☁ P6)) (☁ P7)) (☁ P8))\n        set [p: id v] to [0]\n        join as player rwsr1\n        wait (1) seconds\n        join as player rwsr2\n    end\nend\nif <not <[active player id v] contains [1]?>> then\n    set [p: id v] to [1]\nelse\n    if <not <[active player id v] contains [2]?>> then\n        set [p: id v] to [2]\n    else\n        if <not <[active player id v] contains [3]?>> then\n            set [p: id v] to [3]\n        else\n            if <not <[active player id v] contains [4]?>> then\n                set [p: id v] to [4]\n            else\n                if <not <[active player id v] contains [5]?>> then\n                    set [p: id v] to [5]\n                else\n                    if <not <[active player id v] contains [6]?>> then\n                        set [p: id v] to [6]\n                    else\n                        if <not <[active player id v] contains [7]?>> then\n                            set [p: id v] to [7]\n                        else\n                            if <not <[active player id v] contains [8]?>> then\n                                set [p: id v] to [8]\n                            else\n                                broadcast (slot full v)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine copy fullDecoded\ndelete all of [last fulldecoded v]\nset [index4 v] to [1]\nrepeat (length of [fulldecoded v])\n    add (item (index4) of [fulldecoded v]) to [last fulldecoded v]\n    change [index4 v] by (1)\nend\n\ndefine check backup active\nset [index4 v] to [1]\nrepeat (length of [backup check active player id v])\n    if <((500) - ([abs v] of (([abs v] of ((join (letter (7) of (item (index4) of [last fulldecoded v])) (join (letter (8) of (item (index4) of [last fulldecoded v])) (letter (9) of (item (index4) of [last fulldecoded v])))) - (join (letter (7) of (item (index4) of [fulldecoded v])) (join (letter (8) of (item (index4) of [fulldecoded v])) (letter (9) of (item (index4) of [fulldecoded v]))))) ) - (500)) )) > [0.5]> then\n        if <(join (letter (7) of (item (index4) of [fulldecoded v])) (join (letter (8) of (item (index4) of [fulldecoded v])) (letter (9) of (item (index4) of [fulldecoded v])))) > (join (letter (7) of (item (index4) of [last fulldecoded v])) (join (letter (8) of (item (index4) of [last fulldecoded v])) (letter (9) of (item (index4) of [last fulldecoded v]))))> then\n            replace item (index4) of [backup check active player id v] with [1]\n        else\n            if <(((join (letter (7) of (item (index4) of [fulldecoded v])) (join (letter (8) of (item (index4) of [fulldecoded v])) (letter (9) of (item (index4) of [fulldecoded v])))) + (1000)) - (join (letter (7) of (item (index4) of [last fulldecoded v])) (join (letter (8) of (item (index4) of [last fulldecoded v])) (letter (9) of (item (index4) of [last fulldecoded v]))))) > [0.5]> then\n                replace item (index4) of [backup check active player id v] with [1]\n            else\n                replace item (index4) of [backup check active player id v] with [0]\n            end\n        end\n    else\n        replace item (index4) of [backup check active player id v] with [0]\n    end\n    change [index4 v] by (1)\nend\n\ndefine clouds\nif <((P: mytick) mod (5)) = [4]> then\n    check backup active\nend\ncheck active players\nif <((P: mytick) mod (5)) = [2]> then\n    copy fullDecoded\nend\nclear encoding\ndecode (join (join (join (join (join (join (join (☁ P1) (☁ P2)) (☁ P3)) (☁ P4)) (☁ P5)) (☁ P6)) (☁ P7)) (☁ P8))\nadd activeness to status\nif <not <<(item (P: id) of [username v]) = (username)> or <(inSpectator?) = [1]>>> then\n    stop [all v]\nend\nif <(item (P: id) of [status v]) = [21]> then\n    set [kicked v] to [1]\n    stop [all v]\nend\nif <[status v] contains [91]?> then\n    set [player reached goal v] to (item # of [91] in [status v])\n    if <<<<not <(P: id) = (player reached goal)>> and <(last anyPlayerStatus) = [0]>> and <(anyPlayerGoalReached?) = [0]>> and <(P: goalReached) = [0]>> then\n        set [anyplayergoalreached? v] to [1]\n        broadcast (player goal reached! v)\n    end\n    set [last anyplayerstatus v] to [1]\nelse\n    set [last anyplayerstatus v] to [0]\nend\nif <(length of (P: my data)) = [21]> then\n    encode username (username)\n    if <(P: goalReached) = [1]> then\n        set [p: my data v] to (join (join (join (join [999999] (join (letter (7) of (P: my data)) (join (letter (8) of (P: my data)) (letter (9) of (P: my data))))) [999999999999]) (stock_Encoded)) [9])\n    else\n        if <(roundEnd?) = [1]> then\n            set [p: my data v] to (join (join (join (join [999999] (join (letter (7) of (P: my data)) (join (letter (8) of (P: my data)) (letter (9) of (P: my data))))) [999999999999]) (stock_Encoded)) [1])\n        else\n            set [p: my data v] to (join (join (P: my data) (stock_Encoded)) [0])\n        end\n    end\nend\nif <(inSpectator?) = [0]> then\n    update encode to cloud\nend\nchange [p: mytick v] by (1)\n\nwhen I receive [loop v]\nset [player reached goal v] to [0]\nset [frame cycle v] to [0]\nset [p: my data v] to []\nset [lag delay counter v] to [0]\nset [p: goalreached v] to [0]\nset [anyplayergoalreached? v] to [0]\nset [roundend? v] to [0]\nforever\n    broadcast (tick v)\n    wait (0.02) seconds\nend\n\ndefine player tick\nif <not <(length of [coords v]) = [0]>> then\n    if <(frame cycle) = [0]> then\n        set [p: my data v] to (join (item (length of [coords v]) of [coords v]) (join ([floor v] of ((([floor v] of ((days since 2000) * (1000000)) ) mod (1000)) / (100)) ) (join (([floor v] of ((([floor v] of ((days since 2000) * (1000000)) ) mod (1000)) / (10)) ) mod (10)) (([floor v] of ((days since 2000) * (1000000)) ) mod (10)))))\n    else\n        set [p: my data v] to (join (P: my data) (item (length of [coords v]) of [coords v]))\n    end\n    delete (length of [coords v]) of [coords v]\n    change [frame cycle v] by (1)\n    if <(frame cycle) > [2.5]> then\n        clouds\n        set [frame cycle v] to [0]\n    end\nend\n\nwhen I receive [loop v]\nforever\n    set [people online v] to (join (length of [active player id v]) [ player\(s\) online])\nend\n\ndefine encode username (username)\nset [stock_encoded v] to []\nset [index5 v] to [1]\nrepeat (length of (username))\n    set [stock_encoded v] to (join (stock_Encoded) (join ([floor v] of ((item # of (letter (index5) of (username)) in [supporting string v]) / (10)) ) ((item # of (letter (index5) of (username)) in [supporting string v]) mod (10))))\n    change [index5 v] by (1)\nend\nrepeat ((20) - (length of (username)))\n    set [stock_encoded v] to (join (stock_Encoded) [00])\nend\n\ndefine decode nonprompt (data\(len 40\))\nset [stockdecoding v] to []\nset [stockdecoded v] to []\nset [index5 v] to [1]\nset [_r: username v] to []\nrepeat (length of (data\(len 40\)))\n    set [stockdecoding v] to (join (stockDecoding) (letter (index5) of (data\(len 40\))))\n    if <((index5) mod (2)) = [0]> then\n        if <not <(stockDecoding) = [0]>> then\n            set [stockdecoded v] to (join (stockDecoded) (item (stockDecoding) of [supporting string v]))\n        end\n        if <((index5) mod (40)) = [0]> then\n            set [_r: username v] to (stockDecoded)\n            set [stockdecoded v] to []\n        end\n        set [stockdecoding v] to []\n    end\n    change [index5 v] by (1)\nend\n\nset [__status v] to [0]\n\ndefine set player data (id) (data)\nif <(id) = [1]> then\n    set [☁ p1 v] to (data)\nelse\n    if <(id) = [2]> then\n        set [☁ p2 v] to (data)\n    else\n        if <(id) = [3]> then\n            set [☁ p3 v] to (data)\n        else\n            if <(id) = [4]> then\n                set [☁ p4 v] to (data)\n            else\n                if <(id) = [5]> then\n                    set [☁ p5 v] to (data)\n                else\n                    if <(id) = [6]> then\n                        set [☁ p6 v] to (data)\n                    else\n                        if <(id) = [7]> then\n                            set [☁ p7 v] to (data)\n                        else\n                            set [☁ p8 v] to (data)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndelete all of [coords' v]\nadd (P: my data) to [coords' v]\n\ndefine join as player rwsr1\ndecode (join (join (join (join (join (join (join (☁ P1) (☁ P2)) (☁ P3)) (☁ P4)) (☁ P5)) (☁ P6)) (☁ P7)) (☁ P8))\ncopy fullDecoded\n\ndefine join as player rwsr2\ndecode (join (join (join (join (join (join (join (☁ P1) (☁ P2)) (☁ P3)) (☁ P4)) (☁ P5)) (☁ P6)) (☁ P7)) (☁ P8))\ncheck backup active\ncheck active players\nadd activeness to status\n\nwhen I receive [tick v]\nplayer tick\n\ndefine check if ID in used\ndelete all of [last fulldecoded v]\nset [p: mytick v] to [0]\nset [id in used? v] to [0]\nrepeat (10)\n    check if ID in used rwsr1\n    wait (0.06) seconds\n    check if ID in used rwsr2\nend\n\ndefine check if ID in used rwsr1\nencode username (username)\nset [p: my data v] to (join [999999] (join (join (join (pick random (0) to (9)) (pick random (0) to (9))) (pick random (0) to (9))) [999999999999]))\nset player data (P: id) (join (join (P: my data) (stock_Encoded)) [0])\n\ndefine check if ID in used rwsr2\ndecode (join (join (join (join (join (join (join (☁ P1) (☁ P2)) (☁ P3)) (☁ P4)) (☁ P5)) (☁ P6)) (☁ P7)) (☁ P8))\nif <not <(P: my data) = (item (P: id) of [fulldecoded v])>> then\n    set [id in used? v] to [1]\nend\n\nwhen I receive [start game v]\nset [p: id v] to [0]\nset [people online v] to [-]\ndelete all of [active player id v]\ndelete all of [backup check active player id v]\nrepeat (8)\n    add [1] to [backup check active player id v]\nend\nswitch costume to (none v)\nhide\nset [_status v] to [1]\nwait (1) seconds\nset [_status v] to [2]\njoin as player\nset [_status v] to [4]\ncheck if ID in used\nif <(id in used?) = [0]> then\n    set [_status v] to [6]\n    delete all of [last fulldecoded v]\n    set [p: mytick v] to [0]\nelse\n    repeat until <(id in used?) = [0]>\n        set [_status v] to [5]\n        wait ((pick random (1) to (5)) * (0.3)) seconds\n        join as player\n        check if ID in used\n    end\n    set [_status v] to [6]\n    delete all of [last fulldecoded v]\n    set [p: mytick v] to [0]\nend\nbroadcast (loop v)\n\ndefine add activeness to status\nset [index7 v] to [1]\nrepeat (length of [status v])\n    replace item (index7) of [status v] with (join (item (index7) of [status v]) (<<[active player id v] contains (index7)?> = [1]> + (0)))\n    change [index7 v] by (1)\nend\n\ndefine count (status) in status list\nset [index8 v] to [1]\nset [_r v] to [0]\nrepeat (length of [status v])\n    change [_r v] by (<(item (index8) of [status v]) = (status)> + (0))\n    change [index8 v] by (1)\nend\n\nwhen [space v] key pressed\nif <(username) = [jenniferandjim]> then\n    ask [] and wait\n    if <not <(answer) = []>> then\n        set player data (answer) [11111111111111111111111111111111111111111111111111111111111112]\n    end\nend\n\nwhen flag clicked\nset [inspectator? v] to [0]\n\nwhen [p v] key pressed\nif <(username) = [jenniferandjim]> then\n    set [inspectator? v] to [1]\nend\n\nwhen I receive [countdown v]\nset [bypass-countdown? v] to [0]\nwait (0.5) seconds\nrepeat until <<not <[status v] contains [91]?>> or <(roundEnd?) = [1]>>\n    set [last data v] to (join (join (join (join (join (join (join (☁ P1) (☁ P2)) (☁ P3)) (☁ P4)) (☁ P5)) (☁ P6)) (☁ P7)) (☁ P8))\n    join as player rwsr1\n    wait (1) seconds\n    join as player rwsr2\nend\nif <(roundEnd?) = [0]> then\n    set [bypass-countdown? v] to [1]\nend\n\n@margin\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo [forward v] (100) layers\n\n@typewriter\n\ndefine sucessive:print (text) size (size) at (x) (y) speed(0=default) (speed) align(left=default) (align)\nif <(align) = [center]> then\n    get half width of text (text) (size)\n    sucessive:print (text) size (size) at ((x) - (TEXTWIDTH)) (y) speed(0=default) (speed) align(left=default) []\nelse\n    if <not <<(x) = []> and <(y) = []>>> then\n        go to x: (x) y: (y)\n    end\n    set size to ((size) * (100)) %\n    set [color v] effect to (color)\n    set [brightness v] effect to (brightness)\n    set [ghost v] effect to (transparent)\n    set [textingiter v] to [1]\n    repeat (length of (text))\n        switch costume to (  v)\n        switch costume to (item (item # of (letter (TEXTINGITER) of (text)) in [caps v]) of [caps v])\n        create clone of (_myself_ v)\n        change [textingiter v] by (1)\n        set [prev_x v] to ((x position) + ((item (costume [number v]) of [text width v]) * ((size) / (100))))\n        switch costume to (item (item # of (letter ((TEXTINGITER) + (1)) of (text)) in [caps v]) of [caps v])\n        if <((prev_x) + (item (costume [number v]) of [text width v])) > [235]> then\n            change y by ((0) - (((size) * (1.5)) / (10)))\n            set x to (-235)\n        else\n            set x to (prev_x)\n        end\n        if <not <(speed) = [0]>> then\n            wait (speed) seconds\n        end\n    end\nend\n\ndefine init\nhide\nset [color v] to [0]\nset [brightness v] to [0]\nset [transparent v] to [0]\nbroadcast (del v)\ngo to x: (-235) y: (150)\n\ndefine block:print (text) size (size) at (x) (y) align(left=default) (align)\nif <(align) = [center]> then\n    get half width of text (text) (size)\n    sucessive:print (text) size (size) at ((x) - (TEXTWIDTH)) (y) speed(0=default) [0] align(left=default) []\nelse\n    sucessive:print (text) size (size) at (x) (y) speed(0=default) [0] align(left=default) []\nend\n\ndefine set colormode: Color: (color) Bright: (bright) Fade: (fade)\nset [color v] to (color)\nset [transparent v] to (fade)\nset [brightness v] to (bright)\n\ndefine colorShuffle\nset colormode: Color: (pick random (1) to (200)) Bright: [80] Fade: [0]\n\nwhen I receive [del v]\ndelete this clone\n\nwhen I start as a clone\nset [isclone v] to [1]\ngo to [front v] layer\nshow\n\ndefine dialog (text) (size)\nsucessive:print (text) size (size) at [] [] speed(0=default) [0] align(left=default) []\n\nwhen I receive [new round v]\ninit\nwait (0.2) seconds\nforever\n    set [last active player id v] to (active player ID)\n    set [last username v] to (username)\n    set [last coin v] to (_coin)\n    print\n    wait (0.1) seconds\n    wait until <not <<<(last active player ID) = (active player ID)> and <(last username) = (username)>> and <(last coin) = (_coin)>>>\nend\n\ndefine print\nbroadcast (del v)\nblock:print (_coin) size [1.8] at [-200] [150] align(left=default) []\nset [index6 v] to [1]\nrepeat (length of [active player id v])\n    if <<(item (item (index6) of [active player id v]) of [username v]) = [jenniferandjim]> and <(zz-_meetTheDev-flag) = [0]>> then\n        broadcast (_meetTheDev v)\n        set [zz-_meetthedev-flag v] to [1]\n    end\n    if <(index6) < [4.5]> then\n        block:print (join (letter ((((item (index6) of [active player id v]) - (1)) mod (4)) + (1)) of [<>\[\]]) (item (item (index6) of [active player id v]) of [username v])) size [1.5] at [-230] (((index6) * (-15)) - (105)) align(left=default) []\n    else\n        block:print (join (letter ((((item (index6) of [active player id v]) - (1)) mod (4)) + (1)) of [<>\[\]]) (item (item (index6) of [active player id v]) of [username v])) size [1.5] at [0] ((((index6) - (4)) * (-15)) - (105)) align(left=default) []\n    end\n    change [index6 v] by (1)\nend\nif <(length of [active player id v]) = [1]> then\n    block:print [waiting for other players to join] size [1.3] at [15] [-170] align(left=default) []\nend\n\nwhen flag clicked\nset [isclone v] to [0]\ninit\n\ndefine get half width of text (text) (size)\nset size to ((size) * (100)) %\nset [textwidth v] to [0]\nset [textingiter v] to [1]\nrepeat (length of (text))\n    switch costume to (  v)\n    switch costume to (item (item # of (letter (TEXTINGITER) of (text)) in [caps v]) of [caps v])\n    change [textwidth v] by ((item (costume [number v]) of [text width v]) * ((size) / (100)))\n    change [textingiter v] by (1)\nend\nset [textwidth v] to ((TEXTWIDTH) / (2))\n\ndefine clear\nbroadcast (del v)\n\nwhen I receive [start game v]\ninit\nset colormode: Color: [0] Bright: [200] Fade: [0]\nwait until <(_STATUS) < [1.5]>\nclear\nblock:print [Waiting for connecting] size [2.5] at [0] [0] align(left=default) [center]\nwait until <(_STATUS) > [1.5]>\nclear\nblock:print [Joining as player] size [2.5] at [0] [0] align(left=default) [center]\nwait until <(_STATUS) > [2.5]>\nclear\nblock:print [Waiting until round ends] size [2.5] at [0] [0] align(left=default) [center]\nwait until <(_STATUS) > [3.5]>\nclear\nblock:print [Checking if ID in used] size [2.5] at [0] [0] align(left=default) [center]\nwait until <(_STATUS) > [4.5]>\nclear\nblock:print [Trying other ID] size [2.5] at [0] [0] align(left=default) [center]\nwait until <(_STATUS) > [5.5]>\nclear\n\nwhen I receive [goal reached! v]\nstop [other scripts in sprite v]\nif <(isClone) = [1]> then\n    delete this clone\nelse\n    wait (0.1) seconds\n    init\n    block:print [You have reached the goal] size [2.5] at [0] [0] align(left=default) [center]\n    if <(length of [active player id v]) > [1]> then\n        change [_coin v] by (30)\n    end\n    wait (3.9) seconds\n    broadcast (countdown v)\nend\n\nwhen I receive [player goal reached! v]\nstop [other scripts in sprite v]\nif <(isClone) = [1]> then\n    delete this clone\nelse\n    wait (0.1) seconds\n    init\n    block:print (join (item (player reached goal) of [username v]) [ has reached the goal]) size [2.5] at [0] [0] align(left=default) [center]\n    wait (2.9) seconds\n    broadcast (countdown v)\nend\n\nwhen I receive [countdown v]\ninit\nwait (1) seconds\nblock:print [Game starting in 5] size [2] at [0] [0] align(left=default) [center]\nwait (1) seconds\ninit\nblock:print [Game starting in 4] size [2] at [0] [0] align(left=default) [center]\nwait (1) seconds\ninit\nblock:print [Game starting in 3] size [2] at [0] [0] align(left=default) [center]\nwait (1) seconds\ninit\nblock:print [Game starting in 2] size [2] at [0] [0] align(left=default) [center]\nwait (1) seconds\ninit\nblock:print [Game starting in 1] size [2] at [0] [0] align(left=default) [center]\n\nwhen I receive [loop v]\nset [zz-_meetthedev-flag v] to [0]\n\nwhen I receive [countdown v]\ninit\nwait (1) seconds\nwait until <(bypass-countdown?) = [1]>\nif <(P: goalReached) = [0]> then\n    stop [other scripts in sprite v]\n    broadcast (bypass v)\nend\n\n@goal\n\nwhen flag clicked\nhide\n\nwhen I receive [new round v]\nshow\nset goal (☁ map)\n\nwhen I receive [player goal reached! v]\nhide\n\nwhen I receive [goal reached! v]\nhide\n\nwhen I receive [singleplayer game start v]\nwait (0) seconds\nshow\nset goal (singleplayer: current map)\n\ndefine set goal (level)\nif <(level) = [1]> then\n    go to x: (235) y: (62)\nend\nif <(level) = [2]> then\n    go to x: (-214) y: (103)\nend\nif <(level) = [3]> then\n    go to x: (217) y: (45)\nend\nif <(level) = [4]> then\n    go to x: (-187) y: (102)\nend\nif <(level) = [5]> then\n    go to x: (-126) y: (54)\nend\nif <(level) = [6]> then\n    go to x: (235) y: (62)\nend\nif <(level) = [7]> then\n    go to x: (-214) y: (98.5)\nend\n\nwhen I receive [singleplayer next map v]\nwait (0) seconds\nshow\nset goal (singleplayer: current map)\n\nwhen I receive [loop v]\nforever\n    set goal (☁ map)\nend\n\n@platformer\n\nwhen I receive [goal reached! v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [new round v]\ngo to x: (0) y: (0)\nswitch costume to (☁ map)\nshow\n\nset [-max-map v] to [7]\n\nwhen I receive [player goal reached! v]\nhide\n\nset [☁ map v] to [1]\n\nwhen I receive [start game v]\nhide\ndelete this clone\n\nwhen I receive [singleplayer next map v]\nnext costume\nset [singleplayer: current map v] to (costume [number v])\n\nwhen I receive [singleplayer game start v]\ngo to x: (0) y: (0)\nset [singleplayer: current map v] to [1]\nswitch costume to (singleplayer: current map)\nshow\n\nwhen I receive [tick v]\nif <<(roundEnd?) = [0]> and <(anyPlayerGoalReached?) = [0]>> then\n    switch costume to (☁ map)\nend\n\n@platformer2\n\nwhen I receive [goal reached! v]\nhide\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I receive [new round v]\ngo to x: (0) y: (0)\nswitch costume to (☁ map)\ngo [backward v] (200) layers\nshow\n\nwhen I receive [player goal reached! v]\nhide\n\nwhen I receive [singleplayer next map v]\nwait (0) seconds\nnext costume\nset [singleplayer: current map v] to (costume [number v])\n\nwhen I receive [singleplayer game start v]\ngo to x: (0) y: (0)\nwait (0) seconds\nswitch costume to (singleplayer: current map)\nshow\n\nwhen I receive [tick v]\nif <<(roundEnd?) = [0]> and <(anyPlayerGoalReached?) = [0]>> then\n    switch costume to (☁ map)\nend\n\n@music\n\nwhen flag clicked\nset volume to (20) %\nforever\n    play sound [Vexento - Pixel Party v] until done\nend\n\n@title\n\nwhen flag clicked\nhide\n\nwhen I receive [intro off v]\nwait (0.5) seconds\ngo to x: (-120) y: (30)\nset size to (100) %\nshow\n\nwhen I receive [start game v]\nhide\n\nwhen I receive [singleplayer game start v]\nhide\n\n@select\n\nwhen flag clicked\nhide\n\nwhen I receive [intro off v]\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nswitch costume to (1 v)\ngo to x: (80) y: (20)\nset size to (130) %\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        if <mouse down?> then\n            broadcast (singleplayer game start v)\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I start as a clone\nwait (0.5) seconds\nswitch costume to (2 v)\ngo to x: (80) y: (20)\nset size to (130) %\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        if <mouse down?> then\n            broadcast (start game v)\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [start game v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [singleplayer game start v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@coin icon\n\nwhen I receive [loop v]\ngo to x: (-220) y: (155)\ngo to [front v] layer\nshow\n\nwhen flag clicked\nhide\n\n@speed boost\n\nwhen flag clicked\nset [-player-speedboost v] to [0]\nhide\n\nwhen I receive [loop v]\nset [-player-speedboost v] to [0]\ngo to x: (165) y: (155)\ngo to [front v] layer\nshow\nforever\n    if <<<touching (mouse-pointer v)?> or <key (z v) pressed?>> or <(-player-speedBoost) = [1]>> then\n        set [ghost v] effect to (30)\n        if <<<<mouse down?> or <key (z v) pressed?>> and <(-player-speedBoost) = [0]>> and <not <(_coin) < [30]>>> then\n            set [-player-speedboost v] to [1]\n            change [_coin v] by (-30)\n            broadcast (speed v)\n        end\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [speed v]\nwait (10) seconds\nset [-player-speedboost v] to [0]\n\nwhen I receive [player goal reached! v]\nset [-player-speedboost v] to [0]\n\nwhen I receive [goal reached! v]\nset [-player-speedboost v] to [0]\n\n@jump boost\n\nwhen flag clicked\nset [-player-jumpboost v] to [0]\nhide\n\nwhen I receive [loop v]\nset [-player-jumpboost v] to [0]\ngo to x: (215) y: (155)\ngo to [front v] layer\nshow\nforever\n    if <<<touching (mouse-pointer v)?> or <key (x v) pressed?>> or <(-player-jumpBoost) = [1]>> then\n        set [ghost v] effect to (30)\n        if <<<<mouse down?> or <key (x v) pressed?>> and <(-player-jumpBoost) = [0]>> and <not <(_coin) < [30]>>> then\n            set [-player-jumpboost v] to [1]\n            change [_coin v] by (-30)\n            broadcast (jump boost v)\n        end\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [jump boost v]\nwait (10) seconds\nset [-player-jumpboost v] to [0]\n\nwhen I receive [player goal reached! v]\nset [-player-jumpboost v] to [0]\n\nwhen I receive [goal reached! v]\nset [-player-jumpboost v] to [0]\n\nset [_coin v] to [8000]\n\n@ad\n\nwhen I receive [loop v]\nforever\n    wait (30) seconds\n    go to x: (10) y: (155)\n    go to [front v] layer\n    show\n    set [ghost v] effect to (100)\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\n    wait (5) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    hide\n    wait (30) seconds\nend\n\nwhen flag clicked\nhide\n\n@special\n\nwhen flag clicked\nhide\n\nwhen I receive [_meetthedev v]\nshow\ngo to [front v] layer\ngo to x: (365) y: (150)\nglide (1) secs to x: (95) y: (150)\nwait (3) seconds\nglide (1) secs to x: (365) y: (150)\nhide\n\n
⚔️ Welcome to ☁ Cloud Platformer Race! ⚔️\n\n⚡ Choose [Multiplayer] to play online.\n⚡ [WASD] or [Arrow Keys] to move.\n⚡ [Z] for speed power-up; [X] for jump power-up.\n⚡ Be the first one to reach the goal!\n\n⚡ Buy boosts by clicking the icon, or by the shortcut keys: [Z]/[X], they both cost 30 coins.\n⚡ Coins can be earned by winning games(+30) and by playing with other players(+5 per 10 sec); But if only any other players are online and connected.\n\n⚡ Cloud projects won't work for new scratchers.\n⚡ Up to 8 players! If you can't join multiplayer games, it might be full.\n\n⚡ Please report bugs and players in my profile.\n-------------------------------------------------------------\nIt took months to finish this project. Cloud projects are hard to make and annoying to debug. You might be tired of seeing people begging for loves, but dropping the love/fav really makes my day :)\n-------------------------------------------------------------\nFrequently Asked Questions:\nQ: Why can't I join/why does it take so long to join?\nA: Maybe because the slot is full, or the round isn't ending that fast; It might also be the game's glitch.\n\nQ: I joined, but there are no players at all!\nA: You might be a new scratcher, or you have accidentally clicked "See Inside". It might be caused by lag, but it is also possible that there's no player at all for real.\n\nQ: Some players keep disappearing.\nA: This is caused by the game's lag.\n\nQ: Some players are jumping high/moving faster than normal.\nA: The player might use the power-ups.\n\nQ: Too much lag! (Kill screen)\nA: Close turbo mode; If you are not in turbo mode, try to rejoin the server later.\n\nQ: [insert player name here] is hacking!\nA: Please report any players hacking or bugs in my profile, not in the comment. And before you actually saying someone's hacking, noted that these data are just numbers- it will be hard to modify the data to make a player looks like they actually have a good skill at the game. Most time it's just bugged. Modifying cloud data isn't that easy.\n\nQ: Some players are flying, it looks like they are jumping on an invisible platformer.\nA: You two are on different maps. It is usually to happen when you enter your first round. But if it keeps happening, please report it on my profile.\n\nQ: I am randomly sent to the thumbnail?\nA: It might be the developer's updating the game and stop the server, or you are inactive on the cloud, and another player who tried to join the server tracked you as inactive hence took your spot. In that case please refresh. If it keeps happening, try it in a few minutes.\n\nQ; The maps randomly change mid-game.\nA: It is a lag. Please stop playing and refresh that page. If it still happens, try again in a few minutes.\n\nQ: Players don't spawn at the same time.\nA: If it wasn't lag, players will spawn almost at the same time.\n\nQ: I won but didn't earn any coin.\nA: You are probably not connected.\n\nQ: May you see my project?\nA: No.\n-------------------------------------------------------------\nPropose this project to be featured:\nhttps://scratch.mit.edu/studios/4228481/comments/\n------------------------------------------------------------\nCode / Art / Design - @jenniferandjim\nText Engine: @jenniferandjim\nCloud Engine: @jenniferandjim\nArt Inspiration:\nhttps://www.kenney.nl/assets/abstract-platformer\nLevel Creation: @jenniferandjim\nInspiration - @MaxyBrian\nBig thanks to the @griffpatch cloud project tutorial.\nMusic - "Vexento - Pixel Party"\n\nBeta Testers - \n@B-S-code @_-cloud- @PMJ_MJBCS27\n@Jamnik-Klembus @mastertymw @AK356\n@Netoper @Anastazja_454 @Spider058\n\n#games #trending #all #games #trending #all\n#games #trending #all #games #trending #all\n\nThank you for playing! :D\n------------------------------------------------------------\nChangelog v21.1.5\n- Kicking now forces players to refresh the page\n- Winners now have a little delay\n- New maps\n- Bypass the waiting time when lag happens\nChangelog v.21.1.4\n- Fix character's color bug for >4 players\n- Lag / Turbo mode detector is back\n- Error screen when slot is full\n------------------------------------------------------------\nNote: This project was started before @MaxyBrian's Tower of Scratch released. I did not use any of their code or art. But the project inspired me a lot.\n---\n800/3000/7000/11000/17000/21000