Almost Spring | A Multiplayer Scrolling Platformer

Instructions: A platformer with a free and peace grassland...\n=======================================\nI spent really hard on this(20+ hours) hope you leave a like and fav!\nComment down your best result! \n=======================================\nThanks again for 3k+ views :D\n(As I promised , game tiles are opened to public and you can easily find them by viewing the "Grassland Tiles" Sprite :D)\n=======================================\ncontrols:\n[arrow keys/tap] move player\n[t] chat with opponents\n========================================\ncode: 100% by me\nart: 100% by me in the scratch vector editor :) (inspired by @TimMcCool )\ncloud engine(inspired by griffpatch)\nmusic: opengameart.org

@Stage\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nset volume to (100) %\nforever\n    play sound [a_day_from_birth v] until done\nend\n\nwhen [m v] key pressed\nset volume to (0) %\nwait until <not <key (m v) pressed?>>\nwait until <key (m v) pressed?>\nwait until <not <key (m v) pressed?>>\nset volume to (100) %\n\n@player\n\nwhen flag clicked\nshow\nset [res.x v] to [-141]\nset [res.y v] to [0]\ninit\nforever\n    game tick\nend\n\ndefine init\nset [in air? v] to [1]\nset [playerx v] to (RES.X)\nset [playery v] to (RES.Y)\nset [scrollx v] to ((playerX) + (100))\nset [scrolly v] to (playerY)\nset [sx v] to [0]\nset [sy v] to [0]\nposition player\nbroadcast (POSITION v)\n\ndefine change player x by (val)\nchange [playerx v] by (val)\nposition player\nif <<touching (level hitbox v)?> or <touching (moving platforms v)?>> then\n    repeat (12)\n        change [playery v] by (1)\n        position player\n        if <not <<touching (level hitbox v)?> or <touching (moving platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [playery v] by (-12)\n    repeat (200)\n        if <(val) < [0]> then\n            change [playerx v] by (1)\n            position player\n        else\n            change [playerx v] by (-1)\n            position player\n        end\n        set [sx v] to [0]\n        if <not <<touching (level hitbox v)?> or <touching (moving platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    if <<touching (level hitbox v)?> or <touching (moving platforms v)?>> then\n        start sound [Low Squeak2 v]\n        broadcast (die v)\n        init\n    end\nend\n\ndefine change player y by (val)\nchange [playery v] by (val)\nposition player\nif <<touching (level hitbox v)?> or <touching (moving platforms v)?>> then\n    repeat (200)\n        if <(val) > [0]> then\n            change [playery v] by (-1)\n            position player\n            set [in air? v] to [1]\n        else\n            change [playery v] by (1)\n            position player\n            set [in air? v] to [0]\n        end\n        set [sy v] to [0]\n        if <not <<touching (level hitbox v)?> or <touching (moving platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    if <<touching (level hitbox v)?> or <touching (moving platforms v)?>> then\n        start sound [Low Squeak2 v]\n        broadcast (die v)\n        init\n    end\nelse\n    if <touching (liquid v)?> then\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            change [sy v] by (1)\n        else\n            change [sy v] by (-0.1)\n        end\n    else\n        change [sy v] by (-1.2)\n    end\n    position player\n    set [in air? v] to [1]\nend\n\ndefine position player\ngo to x: ((playerX) - (SCROLLX)) y: ((playerY) - (SCROLLY))\n\ndefine game tick\nmanager mode\nswitch costume to (hitbox v)\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-1.4)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [sx v] by (1.4)\nend\nchange player x by (round (sx))\nposition player\nif <touching (liquid v)?> then\n    set [sx v] to ((sx) * (0.5))\nelse\n    set [sx v] to ((sx) * (0.75))\nend\nif <touching (bouncy v)?> then\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        set [sy v] to [25]\n        set [in air? v] to [1]\n    else\n        set [sy v] to [15]\n        set [in air? v] to [1]\n    end\n    broadcast (boing v)\nelse\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <touching (stairs v)?> then\n            set [sy v] to [5]\n            set [in air? v] to [1]\n        else\n            if <(in air?) = [0]> then\n                set [sy v] to [15]\n                set [in air? v] to [1]\n            end\n        end\n    end\nend\nif <(sy) < [-30]> then\n    set [sy v] to [-30]\nend\nif <(sy) > [30]> then\n    set [sy v] to [30]\nend\nchange player y by (round (sy))\nposition player\nchange [scrollx v] by (round (((playerX) - (SCROLLX)) / (5)))\nchange [scrolly v] by (round (((playerY) - (SCROLLY)) / (5)))\nif <(SCROLLX) < [-400]> then\n    set [scrollx v] to [-400]\nend\nif <(SCROLLX) > [5118]> then\n    set [scrollx v] to [5118]\nend\nif <(SCROLLY) < [-40]> then\n    set [scrolly v] to [-40]\nend\nposition player\nbroadcast (POSITION v)\nif <<(playerY) < [-220]> or <touching (danger v)?>> then\n    start sound [Low Boing v]\n    broadcast (die v)\n    init\nend\ncostume\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen flag clicked\ngo to [front v] layer\nset volume to (100) %\nforever\n    if <touching (liquid v)?> then\n        start sound [Small_Splash_Audio v]\n        wait until <not <touching (liquid v)?>>\n    end\nend\n\ndefine manager mode\nif <(username) = [gravityv]> then\n    if <key (space v) pressed?> then\n        wait until <not <key (space v) pressed?>>\n        repeat until <key (space v) pressed?>\n            if <<key (up arrow v) pressed?> or <key (down arrow v) pressed?>> then\n                if <key (up arrow v) pressed?> then\n                    set [sy v] to [10]\n                end\n                if <key (down arrow v) pressed?> then\n                    set [sy v] to [-10]\n                end\n            else\n                set [sy v] to [0]\n            end\n            if <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> then\n                if <key (left arrow v) pressed?> then\n                    set [sx v] to [-10]\n                end\n                if <key (right arrow v) pressed?> then\n                    set [sx v] to [10]\n                end\n            else\n                set [sx v] to [0]\n            end\n            change [playerx v] by (round (sx))\n            change [playery v] by (round (sy))\n            change [scrollx v] by (round (((playerX) - (SCROLLX)) / (5)))\n            change [scrolly v] by (round (((playerY) - (SCROLLY)) / (5)))\n            if <(SCROLLX) < [-400]> then\n                set [scrollx v] to [-400]\n            end\n            if <(SCROLLX) > [5118]> then\n                set [scrollx v] to [5118]\n            end\n            if <(SCROLLY) < [-40]> then\n                set [scrolly v] to [-40]\n            end\n            position player\n            broadcast (POSITION v)\n        end\n        wait until <not <key (space v) pressed?>>\n        set [sx v] to [0]\n        set [sy v] to [0]\n    end\nend\n\nwhen I receive [kill enemy v]\nset [sy v] to [15]\n\nwhen I receive [touched enemy v]\nstart sound [Low Squeak2 v]\nbroadcast (die v)\ninit\n\nwhen I receive [moving platform detection v]\nswitch costume to (hitbox v)\nif <(sy) > [0]> then\n    change player y by [10]\nelse\n    change player y by [-10]\nend\ncostume\n\nforever\n    wait until <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>\n    change [sy v] by (5)\n    wait until <not <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>\nend\n\nwhen I receive [talk v]\nthink (@USERNAME@) for (4.5) seconds\n\nwhen flag clicked\nforever\n    if <<<mouse down?> and <touching (mouse-pointer v)?>> or <key (t v) pressed?>> then\n        wait until <not <<mouse down?> or <key (t v) pressed?>>>\n        broadcast (chat v) and wait\n    end\nend\n\nset [res.x v] to [3995]\nset [res.y v] to [1930]\ninit\n\ndefine costume\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    switch costume to (player_up v)\nelse\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        switch costume to (player_left v)\n    else\n        if <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n            switch costume to (player_right v)\n        else\n            switch costume to (player_center v)\n        end\n    end\nend\n\n@thumbnail\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@level hitbox\n\nwhen I receive [position v]\nposition (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\ndefine clone at (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (costume4 v)\nset [ghost v] effect to (100)\nclone at [-527] [20]\nclone at [0] [0]\nclone at [1100] [269]\nclone at [2200] [279]\nclone at [2866] [379]\nclone at [3419] [379]\nclone at [4319] [479]\nclone at [5017] [479]\nclone at [4700] [1000]\nclone at [4220] [1100]\nclone at [4220] [1400]\nclone at [4220] [1900]\nset [x v] to [-9999999999999999]\n\n@art\n\nwhen I receive [position v]\nposition (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\ndefine clone at (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen flag clicked\nswitch costume to (costume4 v)\nclone at [-527] [20]\nclone at [0] [0]\nclone at [1100] [269]\nclone at [2200] [279]\nclone at [2866] [379]\nclone at [3419] [379]\nclone at [4319] [479]\nclone at [5017] [479]\nclone at [4700] [1000]\nclone at [4220] [1100]\nclone at [4220] [1400]\nclone at [4220] [1900]\nclone at [3282] [1900]\nset [x v] to [-9999999999999999]\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@liquid\n\nwhen I receive [position v]\nposition (round ((x) - (SCROLLX))) (round (((y) - (SCROLLY)) + (([cos v] of ((timer) * (40)) ) * (20))))\ngo to [back v] layer\n\ndefine position (x) (y)\nshow\nset size to (400) %\ngo to x: (x) y: (y)\nset size to (100) %\n\ndefine clone at (x) (y) (type)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\nswitch costume to (costume4 v)\nclone at [-350] [-200] [1]\nclone at [-591] [-200] [1]\nclone at [550] [0] [1]\nclone at [550] [-179] [2]\nclone at [791] [0] [1]\nclone at [791] [-179] [2]\nclone at [1033] [50] [1]\nclone at [1033] [-127] [2]\nclone at [1033] [-304] [2]\nclone at [3783] [380] [1]\nclone at [3783] [223] [2]\nclone at [4023] [380] [1]\nclone at [4023] [223] [2]\nset [x v] to [-9999999999999999]\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nplay sound [Ocean Wave v] until done\n\n@danger\n\nwhen flag clicked\nhide\nset [clone# v] to [1]\nclone at [150] [-20] [1]\nclone at [532] [-179] [1]\nclone at [632] [-179] [1]\nclone at [732] [-179] [1]\nclone at [1224] [405] [2]\nclone at [2107] [471] [2]\nclone at [2386] [196] [1]\nclone at [2386] [80] [1]\nclone at [2618] [269] [1]\nclone at [2618] [160] [1]\nclone at [2505] [355] [3]\nclone at [3306] [510] [1]\nclone at [3743] [241] [1]\nclone at [3843] [241] [1]\nclone at [3943] [241] [1]\nclone at [4043] [241] [1]\nclone at [4930] [354] [1]\nclone at [5030] [354] [1]\nclone at [5130] [354] [1]\nclone at [5230] [354] [1]\nclone at [5330] [354] [1]\nclone at [4550] [640] [1]\nclone at [4298] [1530] [1]\nclone at [4051] [1860] [1]\nclone at [4151] [1860] [1]\nclone at [3242] [1074] [1]\nclone at [3342] [1074] [1]\nclone at [3442] [1074] [1]\nclone at [3542] [1074] [1]\nclone at [3642] [1074] [1]\nclone at [1455] [211] [1]\nclone at [1555] [211] [1]\nclone at [1655] [211] [1]\nclone at [1755] [211] [1]\nclone at [1855] [211] [1]\nset [x v] to [-999999999999]\n\ndefine clone at (x) (y) (type)\ngo to [back v] layer\ngo [forward v] (1) layers\nswitch costume to (type)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nchange [clone# v] by (1)\n\ndefine position (x) (y)\nshow\nset size to (400) %\ngo to x: (x) y: (y)\nset size to (100) %\n\nwhen I receive [position v]\nposition (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\nif <(costume [number v]) = [1]> then\n    point in direction ((90) - (([sin v] of ((timer) * (150)) ) * (40)))\nelse\n    point in direction (90)\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@bouncy\n\nwhen flag clicked\nhide\nclone at [939] [263]\nclone at [2292] [244]\nclone at [4365] [548]\nclone at [4241] [1860]\nset [x v] to [-99999999999999]\n\nclone at [3837] [1910]\n\ndefine clone at (x) (y)\nswitch costume to (bouncy1 v)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [position v]\nposition (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n\ndefine position (x) (y)\nshow\nset size to (400) %\ngo to x: (x) y: (y)\nset size to (100) %\n\nwhen I receive [boing v]\nstart sound [Boing v]\nswitch costume to (bouncy2 v)\nwait (0.08) seconds\nswitch costume to (bouncy1 v)\n\nforever\n    if <touching (player v)?> then\n        start sound [Boing v]\n        switch costume to (bouncy2 v)\n        wait until <not <touching (player v)?>>\n        wait (0.08) seconds\n    else\n        switch costume to (bouncy1 v)\n    end\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@flag\n\ndefine clone at (x) (y) (type)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (type)\nset [type v] to (type)\ncreate clone of (_myself_ v)\n\nwhen I receive [position v]\nposition (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n\ndefine position (x) (y)\nshow\nset size to (400) %\ngo to x: (x) y: (y)\nset size to (100) %\n\nwhen flag clicked\nset [@time@ v] to []\nhide\nclone at [1166] [460] [1]\nclone at [2736] [454] [1]\nclone at [4804] [597] [1]\nclone at [4489] [1200] [1]\nclone at [3895] [1930] [3]\nset [x v] to [-99999999999]\nhide variable [@time@ v]\nhide variable [☁ @highscore@ v]\nwait until <<mouse down?> or <key (any v) pressed?>>\nreset timer\n\nwhen I start as a clone\nforever\n    if <(type) = [1]> then\n        if <touching (player v)?> then\n            switch costume to (checkpoint2 v)\n            set [res.x v] to (x)\n            set [res.y v] to (y)\n            start sound [Tennis Hit v]\n            broadcast (die v)\n            stop [this script v]\n        end\n    end\n    if <(type) = [3]> then\n        if <touching (player v)?> then\n            set [@time@ v] to (timer)\n            switch costume to (checkpoint2 v)\n            set [res.x v] to (x)\n            set [res.y v] to (y)\n            start sound [win sound 1-3 v]\n            broadcast (die v)\n            wait (3) seconds\n            broadcast (win v) and wait\n            show variable [@time@ v]\n            show variable [☁ @highscore@ v]\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [win v]\nif <(@TIME@) < (☁ @HIGHSCORE@)> then\n    repeat (10)\n        set [☁ @highscore@ v] to (@TIME@)\n    end\nend\n\ndefine reset highscore to (val) <lock>\nif <lock> then\n    set [☁ @highscore@ v] to (val)\nend\n\n@moving platforms\n\nwhen flag clicked\nhide\nclone at [1676] [393] [1]\nclone at [4993] [750] [2]\nset [x v] to [-99999999999999999999]\n\nwhen I receive [position v]\nshow\nif <(costume [number v]) = [1]> then\n    set size to (400) %\n    go to x: (round (((x) - (SCROLLX)) + (([sin v] of ((days since 2000) * (6000000)) ) * (150)))) y: (round ((y) - (SCROLLY)))\n    set size to (100) %\nend\nif <(costume [number v]) = [2]> then\n    set size to (400) %\n    go to x: (round ((x) - (SCROLLX))) y: (round (((y) - (SCROLLY)) + (([sin v] of ((days since 2000) * (6000000)) ) * (300))))\n    set size to (100) %\n    if <touching (player v)?> then\n        broadcast (moving platform detection v)\n    end\nend\n\ndefine clone at (x) (y) (type)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@enemies\n\nwhen I receive [position v]\nshow\nset size to (400) %\ngo to x: (((x) - (SCROLLX)) + (([cos v] of ((timer) * (100)) ) * (100))) y: ((y) - (SCROLLY))\nset size to (100) %\n\ndefine clone at (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\nclone at [3470] [531]\nclone at [4218] [1251]\nset [x v] to [-99999999999999]\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        if <([sy v] of [player v]) < [-5]> then\n            broadcast (kill enemy v)\n            start sound [Low Whoosh v]\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            delete this clone\n        else\n            broadcast (touched enemy v)\n        end\n    end\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@stairs\n\nwhen flag clicked\nhide\nclone at [4080] [1300]\nclone at [4080] [1420]\nclone at [4380] [1600]\nclone at [4380] [1720]\nset [x v] to [-99999999999999]\n\ndefine clone at (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [position v]\nshow\nset size to (400) %\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\nset size to (100) %\ngo to [back v] layer\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@collectables\n\nwhen flag clicked\nset [collected v] to [0]\nhide\nclone at [-601] [-150]\nclone at [-550] [-150]\nclone at [-500] [-150]\nclone at [365] [176]\nclone at [415] [176]\nclone at [525] [-64]\nclone at [585] [-64]\nclone at [645] [-64]\nclone at [700] [-64]\nclone at [1039] [29]\nclone at [1039] [89]\nclone at [1039] [149]\nclone at [1039] [209]\nclone at [1359] [479]\nclone at [1600] [524]\nclone at [1666] [524]\nclone at [1730] [524]\nclone at [2019] [259]\nclone at [2079] [259]\nclone at [2139] [259]\nclone at [2863] [460]\nclone at [2923] [460]\nclone at [3420] [571]\nclone at [3480] [571]\nclone at [3540] [571]\nclone at [4186] [603]\nclone at [4246] [603]\nclone at [4664] [1135]\nclone at [4724] [1135]\nclone at [4784] [1135]\nclone at [4154] [1365]\nclone at [4214] [1365]\nclone at [4169] [1601]\nclone at [4229] [1601]\nclone at [4476] [1953]\nclone at [4536] [1953]\nclone at [4596] [1953]\nclone at [4152] [2023]\nclone at [4092] [2023]\nclone at [4032] [2023]\nclone at [4512] [1613]\nclone at [4512] [1553]\nclone at [4512] [1493]\nclone at [3751] [350]\nclone at [3811] [350]\nclone at [3995] [350]\nclone at [4055] [350]\nclone at [-579] [140]\nclone at [-519] [140]\nclone at [-459] [140]\nset [x v] to [-999999999999999]\n\ndefine clone at (x) (y)\ngo to [front v] layer\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [position v]\nshow\nset size to (400) %\ngo to x: ((x) - (SCROLLX)) y: (((y) - (SCROLLY)) + (([sin v] of ((timer) * (50)) ) * (10)))\nset size to (100) %\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        change [collected v] by (1)\n        start sound [Collect v]\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@cloud\n\ndefine delete and rewrite code data list\ndelete all of [run:data v]\nset [readdata# v] to [1]\nset [datachars v] to [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-*/~`!@#$%^&*\(\)_=\[\]\{}|;':",./<>?]\nrepeat (99)\n    add [] to [run:data v]\nend\nrepeat (length of (datachars))\n    add (letter (readdata#) of (datachars)) to [run:data v]\n    change [readdata# v] by (1)\nend\nadd [ ] to [run:data v]\n\ndefine encode string (val) and add to encoded value (new encode section?) (boolean)\nswitch costume to (lowercase v)\nif <(boolean) = [true]> then\n    set [encoded value v] to []\nend\nset [readdata# v] to [1]\nrepeat (length of (val))\n    set [word v] to (letter (readdata#) of (val))\n    switch costume to (join (word) [\)])\n    set [word v] to (item # of (word) in [run:data v])\n    if <(costume [name v]) = [lowercase]> then\n        if <not <(word) = [0]>> then\n            set [encoded value v] to (join (encoded value) (word))\n        else\n            set [encoded value v] to (join (encoded value) (item # of [*] in [run:data v]))\n        end\n    else\n        if <not <(word) = [0]>> then\n            set [encoded value v] to (join (encoded value) ((word) + (26)))\n        else\n            set [encoded value v] to (join (encoded value) (item # of [*] in [run:data v]))\n        end\n    end\n    switch costume to (lowercase v)\n    change [readdata# v] by (1)\nend\nset [encoded value v] to (join (encoded value) [000])\n\ndefine decode string (code) and add to value (new decode section?) (boolean)\nset [decoded result v] to []\nif <(boolean) = [true]> then\n    set [encoded value v] to (code)\n    set [readdata# v] to [1]\nend\nforever\n    set [decode idx v] to (join (letter (readdata#) of (encoded value)) (join (letter ((readdata#) + (1)) of (encoded value)) (letter ((readdata#) + (2)) of (encoded value))))\n    change [readdata# v] by (3)\n    if <(decode IDX) < [1]> then\n        stop [this script v]\n    end\n    set [decoded result v] to (join (decoded result) (item (decode IDX) of [run:data v]))\nend\n\ndefine add word: (word) into code list\nif <not <[run:data v] contains (word)?>> then\n    if <(length of (word)) = [1]> then\n        ask [Are you sure that you want to add a new code element into the base list?] and wait\n        if < (answer) contains [yes]?> then\n            add (word) to [run:data v]\n        end\n    end\nend\n\nwhen flag clicked\nset [@my player #@ v] to [0]\nset [@username@ v] to (username)\nhide\nset up clones [6]\nbroadcast (allocate slot v)\nbroadcast (begin v)\n\ndefine set up clones (amount)\nset [clone# v] to [1]\nset [offline v] to [100]\nrepeat ((amount) - (1))\n    create clone of (_myself_ v)\n    change [clone# v] by (1)\nend\n\ndefine send (data) to cloud: (#)\nif <(#) = [1]> then\n    set [☁ c1 v] to (data)\nelse\n    if <(#) = [2]> then\n        set [☁ c2 v] to (data)\n    else\n        if <(#) = [3]> then\n            set [☁ c3 v] to (data)\n        else\n            if <(#) = [4]> then\n                set [☁ c4 v] to (data)\n            else\n                if <(#) = [5]> then\n                    set [☁ c5 v] to (data)\n                else\n                    if <(#) = [6]> then\n                        set [☁ c6 v] to (data)\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine value = cloud# (#)\nif <(#) = [1]> then\n    set [decoded result v] to (☁ C1)\nelse\n    if <(#) = [2]> then\n        set [decoded result v] to (☁ C2)\n    else\n        if <(#) = [3]> then\n            set [decoded result v] to (☁ C3)\n        else\n            if <(#) = [4]> then\n                set [decoded result v] to (☁ C4)\n            else\n                if <(#) = [5]> then\n                    set [decoded result v] to (☁ C5)\n                else\n                    if <(#) = [6]> then\n                        set [decoded result v] to (☁ C6)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [allocate slot v]\nbroadcast (conneecting v)\nset [@connected?@ v] to [false]\nvalue = cloud# (clone#)\nset [allocate_last val v] to (join [A] (decoded result))\nwait (2.5) seconds\nvalue = cloud# (clone#)\nif <(join [A] (decoded result)) = (allocate_last val)> then\n    set [@my player #@ v] to (clone#)\nend\nset [@connected?@ v] to [true]\nif <(@MY PLAYER #@) > [0]> then\n    broadcast (connected v)\nelse\n    broadcast (fail v)\nend\n\nwhen I receive [begin v]\nforever\n    if <(@MY PLAYER #@) = (clone#)> then\n        hide\n        encode string (round ([playerx v] of [player v])) and add to encoded value (new encode section?) [true]\n        encode string (round ([playery v] of [player v])) and add to encoded value (new encode section?) []\n        encode string (@USERNAME@) and add to encoded value (new encode section?) []\n        encode string ([costume # v] of [player v]) and add to encoded value (new encode section?) []\n        encode string (round ((days since 2000) * (10000000000))) and add to encoded value (new encode section?) []\n        send (encoded value) to cloud: (@MY PLAYER #@)\n    else\n        disconnection timeout: [10]\n        value = cloud# (clone#)\n        decode string (decoded result) and add to value (new decode section?) [true]\n        change [x v] by (round (((decoded result) - (x)) / (3)))\n        set size to (400) %\n        set x to ((x) - (SCROLLX))\n        set size to (100) %\n        decode string [] and add to value (new decode section?) []\n        change [y v] by (round (((decoded result) - (y)) / (3)))\n        set size to (400) %\n        set y to ((y) - (SCROLLY))\n        set size to (100) %\n        decode string [] and add to value (new decode section?) []\n        say (decoded result)\n        decode string [] and add to value (new decode section?) []\n        switch costume to (join [player_] (decoded result))\n    end\nend\n\ndefine disconnection timeout: (frames)\nvalue = cloud# (clone#)\nif <(join [A] (decoded result)) = (last_val)> then\n    change [offline v] by (-1)\n    if <(offline) < (frames)> then\n        hide\n    end\nelse\n    set [offline v] to [100]\n    set [last_val v] to (join [A] (decoded result))\n    if <(@CONNECTED?@) = [true]> then\n        show\n    end\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@chat\n\nwhen flag clicked\ngo to x: (-143) y: (17)\nset [ghost v] effect to (100)\nshow\n\nwhen I receive [chat v]\ngo to [front v] layer\nrepeat (5)\n    change [ghost v] effect by (-10)\nend\nask [] and wait\nif <not <(answer) = []>> then\n    if <(answer) = [1]> then\n        set [message v] to [Hi!]\n    else\n        if <(answer) = [2]> then\n            set [message v] to [Lol]\n        else\n            if <(answer) = [3]> then\n                set [message v] to [XD]\n            else\n                if <(answer) = [4]> then\n                    set [message v] to [Come here :\)]\n                else\n                    if <(answer) = [5]> then\n                        set [message v] to [Grab all the coins!]\n                    else\n                        if <(answer) = [6]> then\n                            set [message v] to [I found a coin here!]\n                        else\n                            if <(answer) = [7]> then\n                                set [message v] to [Let's gather~]\n                            else\n                                if <(answer) = [8]> then\n                                    set [message v] to [Swim :D]\n                                else\n                                    if <(answer) = [9]> then\n                                        set [message v] to [Let's race !]\n                                    else\n                                        if <(answer) = [10]> then\n                                            set [message v] to [Be careful!]\n                                        else\n                                            if <(answer) = [11]> then\n                                                set [message v] to [I reached the end!]\n                                            else\n                                                if <(answer) = [12]> then\n                                                    set [message v] to [Let's chase!]\n                                                else\n                                                    if <(answer) = [13]> then\n                                                        set [message v] to [I will catch you.]\n                                                    else\n                                                        if <(answer) = [14]> then\n                                                            set [message v] to [I've got you :\)]\n                                                        else\n                                                            if <(answer) = [15]> then\n                                                                set [message v] to [Yes.]\n                                                            else\n                                                                if <(answer) = [16]> then\n                                                                    set [message v] to [No.]\n                                                                else\n                                                                    if <(answer) = [17]> then\n                                                                        set [message v] to [Okay!]\n                                                                    else\n                                                                        if <(answer) = [18]> then\n                                                                            set [message v] to [Sorry.]\n                                                                        else\n                                                                            if <(answer) = [19]> then\n                                                                                set [message v] to [Bye :\(]\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    repeat (5)\n        change [ghost v] effect by (10)\n    end\n    chat (message)\nelse\n    repeat (5)\n        change [ghost v] effect by (10)\n    end\nend\n\ndefine chat (val)\nset [temp v] to (username)\nset [@username@ v] to (join (@USERNAME@) (join [: ] (val)))\nbroadcast (talk v) and wait\nset [@username@ v] to (temp)\n\n@messages\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [conneecting v]\ngo to [front v] layer\nswitch costume to (connecting v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [connected v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (connected v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nbroadcast (lf v)\n\nwhen I receive [fail v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (fail v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [lf v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (lf v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (4) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [win v]\nhide variable [collected v]\ngo to [front v] layer\nswitch costume to (won v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [continue v]\nhide variable [@time@ v]\nhide variable [☁ @highscore@ v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (lf v)\n\n@buttons\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I start as a clone\nshow\nforever\n    go to [front v] layer\n    if <(clone#) = [1]> then\n        switch costume to (yes v)\n        go to x: (-104) y: (-144)\n    end\n    if <(clone#) = [2]> then\n        switch costume to (no v)\n        go to x: (104) y: (-144)\n    end\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n        set size to (110) %\n        if <mouse down?> then\n            if <(clone#) = [1]> then\n                broadcast (continue v)\n                broadcast (del clones v) and wait\n            else\n                set [@my player #@ v] to [0]\n                hide variable [@time@ v]\n                hide variable [☁ @highscore@ v]\n                broadcast (stop v)\n                broadcast (del clones v) and wait\n            end\n        end\n    else\n        set [brightness v] effect to (0)\n        set size to (100) %\n    end\nend\n\ndefine set up clones\nset [clone# v] to [1]\nrepeat (2)\n    create clone of (_myself_ v)\n    change [clone# v] by (1)\nend\n\nwhen I receive [win v]\nset up clones\n\nwhen I receive [del clones v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    wait until <touching (mouse-pointer v)?>\n    start sound [Tap Conga v]\n    wait until <not <touching (mouse-pointer v)?>>\nend\n\nwhen I receive [stop v]\nwait (0.1) seconds\nstop [all v]\n\n@Grassland tiles\n\nwhen flag clicked\nhide\n\n