Paperformer - Multiplayer Platformer                                     #gravityv

Instructions: PAPERFORMER (multiplayer up to 5 players )\nA peace world sketched in notebook.\n***********************IMPORTANT***********************\nAdmin mode:\nAdmins can let you switch between jetpack and parachute after you reached the end. Simply press'0'.\nRequest to be an admin:\n- admin requests are closed...\n_________________________________________\nchange log:\n2020/7/27: art improvement\n2020/7/23 added scrolling background.\n2020/7/22: more slots(up to 8 players) are opened to public\n2020/7/21 updated parachute and jetpack physics, release of admin mode.\n2020/7/14 release\n2020/7/13 development starts with basic platformer engine

@Stage\n\nwhen flag clicked\nswitch backdrop to (background v)\nforever\n    play sound (pick random (1) to (2)) until done\nend\n\nwhen [0 v] key pressed\nif <(username) = [gravityv]> then\n    broadcast (end v)\nend\n\nwhen flag clicked\ndelete all of [admin v]\nadd [GravityV] to [admin v]\nadd [slider_on_the_black] to [admin v]\nadd [LeafyStudios] to [admin v]\nadd [Moryamanner] to [admin v]\nadd [IDONTEXISTPROBLEM] to [admin v]\nadd [fman23] to [admin v]\nadd [meenu_89] to [admin v]\nadd [mastermind56] to [admin v]\nadd [xpypsscteacher15089] to [admin v]\nadd [wam_clap] to [admin v]\nadd [Fallen_AngelLucifer] to [admin v]\nadd [EntoChicky] to [admin v]\nadd [TOAD5656] to [admin v]\nadd [SilverDragonLeaf] to [admin v]\nadd [room9coder20] to [admin v]\nadd [derpy_bean] to [admin v]\nadd [Blazin_Twitch] to [admin v]\nadd [lisagu] to [admin v]\nadd [Gamerkingcoder] to [admin v]\nadd [unspeakable_II] to [admin v]\nadd [percytheseus] to [admin v]\nadd [cs1797584] to [admin v]\nadd [gabrieja] to [admin v]\nadd [Rc123434] to [admin v]\nadd [KawaiiwafflesJr] to [admin v]\nadd [GoMarsBar161] to [admin v]\nadd [ThatProthe] to [admin v]\nadd [starwarma] to [admin v]\nadd [Squirrel_D] to [admin v]\nadd [nallurisohith] to [admin v]\nadd [Whatsisname3] to [admin v]\nadd [-YSynth-] to [admin v]\nadd [LavaFist] to [admin v]\nadd [infocomm08] to [admin v]\nadd [Hellome20] to [admin v]\nadd [FIuid-] to [admin v]\nadd [sparklemonkey14] to [admin v]\nadd [Runtalan] to [admin v]\nadd [HahaYesGames] to [admin v]\nadd [railexplore] to [admin v]\nadd [Godboss1281] to [admin v]\nadd [KayChiWolf] to [admin v]\nadd [Bruhnator776] to [admin v]\nadd [SaaroshBhai5] to [admin v]\nadd [kalopsia_on_life] to [admin v]\nadd [green-flag-coder] to [admin v]\nadd [scratchcoder20000] to [admin v]\nadd [blackAvenger09] to [admin v]\nadd [metangdude101] to [admin v]\nadd [TheCodeMaster654] to [admin v]\nadd [cybersubject] to [admin v]\nadd [unspeakable_II] to [admin v]\nadd [0014049] to [admin v]\nadd [WKFs20171045] to [admin v]\nadd [Silvercat8] to [admin v]\nadd [SubscribetoDenisY] to [admin v]\nadd [A-qua] to [admin v]\nadd [SuperCreator1212] to [admin v]\nadd [--Air--] to [admin v]\nadd [cookielearns] to [admin v]\nadd [Loolua] to [admin v]\nadd [suhalo_351] to [admin v]\nadd [HyperBOOM] to [admin v]\nadd [CReePeR580] to [admin v]\nadd [TNTCyclone] to [admin v]\nadd [TheScratchMascot] to [admin v]\nadd [spazestudios] to [admin v]\nadd [Nik_Sm] to [admin v]\nadd [chocosmol] to [admin v]\nadd [lam_gia_phuc_nguyen] to [admin v]\nadd [gtryanl] to [admin v]\nadd [staystrong109] to [admin v]\nadd [trinitymagic] to [admin v]\nadd [Omega_Corp] to [admin v]\nadd [codeblast7000] to [admin v]\nadd [mr_guy_cool] to [admin v]\nadd [MaxyBrian] to [admin v]\nadd [homefarm3] to [admin v]\nadd [AKommers] to [admin v]\nadd [sabrinachichi] to [admin v]\nadd [anIeo] to [admin v]\nadd [lrhee2020] to [admin v]\nadd [karmanvan] to [admin v]\nadd [22JNguyen1] to [admin v]\nadd [Dark_Cosmo] to [admin v]\nadd [Jackie_Chan07] to [admin v]\nadd [EvanC0563] to [admin v]\nadd [dragon1145] to [admin v]\nadd [Abhi_Kapalavai] to [admin v]\nadd [lovesbunnys] to [admin v]\nadd [cl0udDev] to [admin v]\nadd [Midnight_lilyXx] to [admin v]\nadd [Mythicalcreatures100] to [admin v]\nadd [cs4331554] to [admin v]\nadd [Stanlee_0] to [admin v]\nadd [Lilmisswriter] to [admin v]\nadd [MEMESBRO] to [admin v]\nadd [FireFoxie123] to [admin v]\nadd [NASAMEP] to [admin v]\nadd [Coder_Girl321] to [admin v]\nadd [5wonders] to [admin v]\nadd [usecodelux] to [admin v]\nadd [saman_gowde] to [admin v]\nadd [MusicPianist] to [admin v]\nadd [908624] to [admin v]\nadd [glitch_shadowmaster] to [admin v]\nadd [Bubby-27] to [admin v]\nadd [usecodelux] to [admin v]\nadd [tmaconfire] to [admin v]\nadd [uperpaly] to [admin v]\nadd [pupg2] to [admin v]\n\nwhen I receive [end v]\nif <(username) = [gravityv]> then\n    stop [this script v]\nend\nforever\n    if <key (0 v) pressed?> then\n        wait until <not <key (0 v) pressed?>>\n        if <[admin v] contains (username)?> then\n            broadcast (end v)\n        end\n    end\nend\n\ndefine add (username) into admin list <lock>\nif <lock> then\n    if <not <[admin v] contains (username)?>> then\n        add (username) to [admin v]\n    end\nend\n\nadd [] into admin list <>\n\n@scrolling platformer engine\n\nwhen flag clicked\nset [@username@ v] to (username)\nset [respawn_x v] to [20]\nset [respawn_y v] to [20]\ninit\nforever\n    game tick\nend\n\ndefine init\nset [ghost v] effect to (0)\nset [in air? v] to [1]\nset [playerx v] to (respawn_x)\nset [playery v] to (respawn_y)\nset [scrollx v] to ((playerX) + (100))\nset [scrolly v] to (playerY)\nset [sx v] to [0]\nset [sy v] to [0]\nset [@parachute@? v] to [0]\nposition player\n\ndefine change player x by (val)\nchange [playerx v] by (val)\nposition player\nif <<touching (level v)?> or <touching (moving platform v)?>> then\n    repeat ([abs v] of (val) )\n        change [playery v] by (1)\n        position player\n        if <not <<touching (level v)?> or <touching (moving platform v)?>>> then\n            stop [this script v]\n        end\n    end\nend\nif <<touching (level v)?> or <touching (moving platform v)?>> then\n    change [playery v] by (join [-] ([abs v] of (val) ))\n    position player\nend\nif <<touching (level v)?> or <touching (moving platform v)?>> then\n    repeat until <not <<touching (level v)?> or <touching (moving platform v)?>>>\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        if <touching (_edge_ v)?> then\n            init\n            stop [this script v]\n        end\n    end\n    set [sx v] to [0]\nend\n\nif <key (up arrow v) pressed?> then\n    if <(val) < [0]> then\n        set [sx v] to [16]\n        set [sy v] to [16]\n    else\n        set [sx v] to [-16]\n        set [sy v] to [16]\n    end\nelse\n    set [sx v] to [0]\nend\n\ndefine change player y by (val)\nchange [playery v] by (val)\nposition player\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\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    end\n    set [sy v] to [0]\nelse\n    if <(@PARACHUTE@?) = [1]> then\n        change [sy v] by (-0.1)\n    else\n        change [sy v] by (-1)\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\nbroadcast (move mv. platforms v)\nif <touching (moving platform v)?> then\n    moving platform detection\nend\nmanager\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-1.5)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [sx v] by (1.5)\nend\nchange player x by (round (sx))\nset [sx v] to ((sx) * (0.7))\nposition player\nif <(@PARACHUTE@?) = [3]> then\n    change [sy v] by (1.2)\n    set [in air? v] to [1]\nelse\n    if <<touching (jump boost v)?> and <(@PARACHUTE@?) = [0]>> then\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>> then\n            set [sy v] to [25]\n            set [in air? v] to [1]\n        else\n            set [sy v] to [17]\n            set [in air? v] to [1]\n        end\n        broadcast (sound:bounce v)\n    else\n        if <<(in air?) = [0]> and <<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>> then\n            set [sy v] to [15]\n            set [in air? v] to [1]\n        end\n    end\nend\nchange player y by (round (sy))\nif <(sy) < [-20]> then\n    set [sy v] to [-20]\nend\nif <(sy) > [25]> then\n    set [sy v] to [25]\nend\nposition player\nchange [scrollx v] by (round (((playerX) - (SCROLLX)) / (5)))\nchange [scrolly v] by (round (((playerY) - (SCROLLY)) / (5)))\nposition player\ntest die [-180]\nbroadcast (POSITION v)\n\ndefine moving platform detection\nif <touching (moving platform v)?> then\n    repeat (200)\n        if <not <touching (moving platform v)?>> then\n            set [sy v] to [0]\n            broadcast (POSITION v)\n            stop [this script v]\n        end\n        if <(sy) > [0]> then\n            change [playery v] by (-1)\n            position player\n            set [in air? v] to [1]\n        end\n        if <[0] > (sy)> then\n            change [playery v] by (1)\n            position player\n            set [in air? v] to [0]\n        end\n    end\n    if <touching (moving platform v)?> then\n        init\n        stop [this script v]\n    end\nend\n\nwhen I receive [mov.player\(mov.plat\) v]\nif <touching (moving platform v)?> then\n    moving platform detection\nend\n\ndefine test die (bottom)\nif <<<(playerY) < (bottom)> or <(playerY) > [5000]>> or <<(playerX) < [-3100]> or <(playerX) > [2300]>>> then\n    start sound [Squish Pop v]\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    init\nend\n\ndefine manager\nif <(username) = [gravityv]> then\n    if <key (m v) pressed?> then\n        wait until <not <key (m v) pressed?>>\n        repeat until <key (m v) pressed?>\n            if <key (left arrow v) pressed?> then\n                change [playerx v] by (-10)\n            end\n            if <key (right arrow v) pressed?> then\n                change [playerx v] by (10)\n            end\n            if <key (up arrow v) pressed?> then\n                change [playery v] by (10)\n            end\n            if <key (down arrow v) pressed?> then\n                change [playery v] by (-10)\n            end\n            position player\n            set [scrollx v] to (playerX)\n            set [scrolly v] to (playerY)\n            position player\n            broadcast (POSITION v)\n        end\n        wait until <not <key (m v) pressed?>>\n        set [sx v] to [0]\n        set [sy v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (t v) pressed?> then\n        wait until <not <key (t v) pressed?>>\n        broadcast (safe chat v) and wait\n    end\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        wait until <not <mouse down?>>\n        if <touching (mouse-pointer v)?> then\n            broadcast (safe chat v) and wait\n        end\n    end\nend\n\nwhen I receive [end v]\nrepeat (9)\n    change [brightness v] effect by (10)\nend\nrepeat (9)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [speak val v]\nsay (@USERNAME@) for (4) seconds\n\nwhen I receive [set respawn v]\nset [respawn_x v] to ([x v] of [checkpoints v])\nset [respawn_y v] to ([y v] of [checkpoints v])\n\n@equipments\n\nwhen I receive [position v]\ngo to x: (([playerx v] of [scrolling platformer engine v]) - (SCROLLX)) y: (([playery v] of [scrolling platformer engine v]) - (SCROLLY))\n\nwhen flag clicked\nforever\n    if <(parachute activated?) = [1]> then\n        if <<<key (space v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <([sy v] of [scrolling platformer engine v]) < [-1.1]>> then\n            set [@parachute@? v] to [1]\n        else\n            set [@parachute@? v] to [0]\n        end\n    end\n    if <(jetpack activated?) = [1]> then\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [@parachute@? v] to [3]\n        else\n            set [@parachute@? v] to [2]\n        end\n    end\nend\n\nwhen flag clicked\nset [parachute activated? v] to [0]\nset [jetpack activated? v] to [0]\nset [@parachute@? v] to [0]\n\nwhen I receive [end v]\nrepeat (9)\n    change [brightness v] effect by (10)\nend\nrepeat (9)\n    change [brightness v] effect by (-10)\nend\nask [Please choose an extra equipment with you.1\) jetpack 2\)parachute] and wait\nif <(answer) = [1]> then\n    set [jetpack activated? v] to [1]\n    set [parachute activated? v] to [0]\nelse\n    set [parachute activated? v] to [1]\n    set [jetpack activated? v] to [0]\nend\n\nif <(pick random (1) to (2)) = [1]> then\n    set [jetpack activated? v] to [1]\n    set [parachute activated? v] to [0]\nelse\n    set [parachute activated? v] to [1]\n    set [jetpack activated? v] to [0]\nend\n\nwhen flag clicked\nforever\n    if <(parachute activated?) = [1]> then\n        wait until <<key (space v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>\n        start sound [268072_SOUNDDOGS__cl v]\n        wait until <not <<key (space v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>\n    end\n    if <(jetpack activated?) = [1]> then\n        play sound [Space Noise v] until done\n    end\nend\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    if <<(parachute activated?) = [1]> or <(jetpack activated?) = [1]>> then\n        switch costume to ((@PARACHUTE@?) + (1))\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    set volume to (0) %\nend\n\nif <(@PARACHUTE@?) = [1]> then\n    set volume to (50) %\nelse\n    if <(@PARACHUTE@?) = [3]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\n@level\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) (cos)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (join [0] (cos))\ncreate clone of (_myself_ v)\n\nwhen flag clicked\ngo to [front v] layer\nzoom [100]\nhide\nrepeat (1)\n    clone at [200] [0] [1]\n    clone at [70] [400] [2]\n    clone at [1160] [350] [3]\n    clone at [1450] [700] [4]\n    clone at [1850] [750] [5]\n    clone at [860] [850] [6]\n    clone at [460] [950] [7]\n    clone at [-300] [950] [8]\n    clone at [-600] [500] [9]\n    clone at [-1300] [300] [10]\n    clone at [-2150] [300] [11]\nend\nclone at [10000000000000000000000000000000000000000000000000000000000000] [10] [1]\n\ndefine zoom (%)\nswitch costume to (dot v)\nset size to (%) %\nswitch costume to (costume1 v)\n\nwhen I receive [end v]\nrepeat (9)\n    change [brightness v] effect by (10)\nend\nrepeat (9)\n    change [brightness v] effect by (-10)\nend\n\n@moving platform\n\nwhen flag clicked\nhide\nclone at [550] [10] [1]\nclone at [800] [10] [2]\nclone at [1722] [900] [3]\nclone at [597] [1000] [4]\nclone at [-500] [993] [5]\nclone at [-1000] [993] [6]\nclone at [-1000] [993] [7]\nclone at [-2200] [993] [8]\n\nwhen I receive [position v]\nset size to (400) %\nposition (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\nset size to (100) %\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) (cos)\nset [temp v] to [1]\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (join [0] (cos))\ncreate clone of (_myself_ v)\n\nwhen I receive [end v]\nrepeat (9)\n    change [brightness v] effect by (10)\nend\nrepeat (9)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [move mv. platforms v]\nif <(costume [number v]) = [1]> then\n    set [x v] to (x)\n    set [y v] to (round ((([sin v] of (temp) ) * (100)) - (-500)))\n    change [temp v] by (3)\n    set size to (200) %\n    position (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n    set size to (100) %\n    if <touching (scrolling platformer engine v)?> then\n        set [touching moving platform? v] to [1]\n        broadcast (mov.player\(mov.plat\) v) and wait\n    else\n        set [touching moving platform? v] to [0]\n    end\nend\nif <(costume [number v]) = [2]> then\n    set [x v] to (x)\n    set [y v] to (round ((([cos v] of (temp) ) * (100)) - (-500)))\n    change [temp v] by (3)\n    set size to (200) %\n    position (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n    set size to (100) %\n    if <touching (scrolling platformer engine v)?> then\n        set [touching moving platform? v] to [1]\n        broadcast (mov.player\(mov.plat\) v) and wait\n    else\n        set [touching moving platform? v] to [0]\n    end\nend\nif <(costume [number v]) = [3]> then\n    set [x v] to (round ((([cos v] of (temp) ) * (100)) - (-1300)))\n    set [y v] to (y)\n    change [temp v] by (3)\n    set size to (200) %\n    position (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n    set size to (100) %\n    if <touching (scrolling platformer engine v)?> then\n        set [touching moving platform? v] to [1]\n        broadcast (mov.player\(mov.plat\) v) and wait\n    else\n        set [touching moving platform? v] to [0]\n    end\nend\nif <(costume [number v]) = [4]> then\n    set [x v] to (round ((([cos v] of (temp) ) * (100)) - (-50)))\n    set [y v] to (y)\n    change [temp v] by (3)\n    set size to (200) %\n    position (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n    set size to (100) %\n    if <touching (scrolling platformer engine v)?> then\n        set [touching moving platform? v] to [1]\n        broadcast (mov.player\(mov.plat\) v) and wait\n    else\n        set [touching moving platform? v] to [0]\n    end\nend\nif <(costume [number v]) = [5]> then\n    set [x v] to (x)\n    set [y v] to (round ((([cos v] of (temp) ) * (100)) - (-700)))\n    change [temp v] by (3)\n    set size to (200) %\n    position (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n    set size to (100) %\n    if <touching (scrolling platformer engine v)?> then\n        set [touching moving platform? v] to [1]\n        broadcast (mov.player\(mov.plat\) v) and wait\n    else\n        set [touching moving platform? v] to [0]\n    end\nend\nif <(costume [number v]) = [6]> then\n    set [x v] to (x)\n    set [y v] to (round ((([sin v] of (temp) ) * (100)) - (-400)))\n    change [temp v] by (3)\n    set size to (200) %\n    position (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n    set size to (100) %\n    if <touching (scrolling platformer engine v)?> then\n        set [touching moving platform? v] to [1]\n        broadcast (mov.player\(mov.plat\) v) and wait\n    else\n        set [touching moving platform? v] to [0]\n    end\nend\nif <(costume [number v]) = [7]> then\n    set [x v] to (round ((([cos v] of (temp) ) * (100)) - (1800)))\n    set [y v] to (round ((([sin v] of (temp) ) * (100)) - (-400)))\n    change [temp v] by (3)\n    set size to (200) %\n    position (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n    set size to (100) %\n    if <touching (scrolling platformer engine v)?> then\n        set [touching moving platform? v] to [1]\n        broadcast (mov.player\(mov.plat\) v) and wait\n    else\n        set [touching moving platform? v] to [0]\n    end\n    show\nend\nif <(costume [number v]) = [8]> then\n    set [x v] to (x)\n    set [y v] to (round ((([sin v] of (temp) ) * (100)) - (-200)))\n    change [temp v] by (5)\n    set size to (200) %\n    position (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n    set size to (100) %\n    if <touching (scrolling platformer engine v)?> then\n        set [touching moving platform? v] to [1]\n        broadcast (mov.player\(mov.plat\) v) and wait\n    else\n        set [touching moving platform? v] to [0]\n    end\n    show\nend\n\n@jump boost\n\nwhen I receive [position v]\nset size to (400) %\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\nset size to (60) %\nset [mxy v] to (join ((SCROLLX) - (mouse x)) (join ['] ((SCROLLY) - (mouse y))))\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)\n\nwhen flag clicked\nswitch costume to (off3 v)\nhide\nclone at [275] [-50]\nclone at [55] [206]\nclone at [1735] [725]\nclone at [-1401] [360]\nclone at [-1513] [360]\n\nwhen I receive [sound:bounce v]\nswitch costume to (on3 v)\nplay sound [Whiz v] until done\nwait (0.05) seconds\nswitch costume to (off3 v)\n\nwhen I receive [end v]\nrepeat (9)\n    change [brightness v] effect by (10)\nend\nrepeat (9)\n    change [brightness v] effect by (-10)\nend\n\n@thumbnail\n\nwhen flag clicked\nshow\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [turbo on v]\nstop [other scripts in sprite v]\ngo to [front v] layer\ngo [backward v] (1) layers\nset [ghost v] effect to (0)\n\n@end\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\nwhen flag clicked\npoint in direction (90)\nset [@time@ v] to []\nhide variable [☁ highscore v]\nhide variable [@time@ v]\nswitch costume to (2 v)\nif <not <(costume [number v]) = [3]>> then\n    position (round ((-2600) - (SCROLLX))) (round ((145) - (SCROLLY)))\nend\nwait until <<key (any v) pressed?> or <mouse down?>>\nrepeat until <touching (scrolling platformer engine v)?>\n    set [@time@ v] to [...]\nend\nset [@time@ v] to (timer)\nrepeat (3)\n    change size by (10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change size by (-10)\n    wait (0.01) seconds\nend\nswitch costume to (3 v)\nbroadcast (end v)\nbroadcast (reached v)\nif <(@TIME@) < (☁ HIGHSCORE)> then\n    broadcast (send highscore v) and wait\n    broadcast (new highscore v)\nend\nrepeat (5)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [position v]\nif <not <(costume [number v]) = [3]>> then\n    position (round ((-2600) - (SCROLLX))) (round ((145) - (SCROLLY)))\nend\n\nwhen I receive [new highscore v]\ncreate clone of (_myself_ v)\nstart sound [win sound 1-2 v]\n\nwhen I start as a clone\nhide\nswitch costume to (highscore v)\ngo to [front v] layer\ngo to x: (160) y: (250)\nshow\nrepeat until <<(x position) = [160]> and <(y position) = [140]>>\n    change x by (((160) - (x position)) / (5))\n    change y by (((140) - (y position)) / (5))\nend\ndelete this clone\n\ndefine reset highscore to (val)\nask [are you aure?] and wait\nif <(answer) = [yes]> then\n    set [☁ highscore v] to (val)\nend\n\nhide variable [@time@ v]\nhide variable [☁ highscore v]\n\nreset highscore to [200]\n\nreset highscore to [46.167]\n\nhide\nswitch costume to (highscore v)\ngo to [front v] layer\ngo to x: (160) y: (140)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@server\n\ndefine TOOL | reset 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 encoded value (new encode section?) ()\nswitch costume to (lowercase v)\nif <() = [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?) ()\nset [decoded result v] to []\nif <() = [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 TOOL | add new string (string) into base codes\nif <not <[run:data v] contains (string)?>> then\n    if <(length of (string)) = [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 (string) to [run:data v]\n        end\n    end\nend\n\ndefine TOOL| Anti-Broken detection\nif <(length of [run:data v]) = [0]> then\n    ask [issues found.Run repair tool? this will reset your data.] and wait\n    if < (answer) contains [yes]?> then\n        TOOL | reset data list\n    end\nelse\n    encode string [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789] and add encoded value (new encode section?) [true]\n    decode string (encoded value) and add to value (new decode section?) [true]\n    if <not <(decoded result) = (datachars)>> then\n        ask [issues found.Run repair tool? this will reset your data.] and wait\n        if < (answer) contains [yes]?> then\n            TOOL | reset data list\n        end\n    else\n        if <(length of [run:data v]) > [999]> then\n            ask [issues found.Run repair tool? this will reset your data.] and wait\n            if < (answer) contains [yes]?> then\n                TOOL | reset data list\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [@playerid@ v] to [0]\nhide\nset multiplayer clones [8]\nbroadcast (find free gaming slot v)\nbroadcast (begin v)\n\ndefine send 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                            if <(id) = [8]> then\n                                set [☁ p8 v] to (data)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine dec.val=cloudID (id)\nif <(id) = [1]> then\n    set [decoded result v] to (☁ P1)\nelse\n    if <(id) = [2]> then\n        set [decoded result v] to (☁ P2)\n    else\n        if <(id) = [3]> then\n            set [decoded result v] to (☁ P3)\n        else\n            if <(id) = [4]> then\n                set [decoded result v] to (☁ P4)\n            else\n                if <(id) = [5]> then\n                    set [decoded result v] to (☁ P5)\n                else\n                    if <(id) = [6]> then\n                        set [decoded result v] to (☁ P6)\n                    else\n                        if <(id) = [7]> then\n                            set [decoded result v] to (☁ P7)\n                        else\n                            if <(id) = [8]> then\n                                set [decoded result v] to (☁ P8)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine set multiplayer clones (#)\nhide\nset [offsetx v] to [0]\nset [offsety v] to [0]\nset [offline v] to [100]\nset [clone# v] to [1]\nrepeat ((#) - (1))\n    create clone of (_myself_ v)\n    change [clone# v] by (1)\nend\n\nwhen I receive [begin v]\nhide\nforever\n    if <(@PLAYERID@) = (clone#)> then\n        hide\n        encode string ([playerx v] of [scrolling platformer engine v]) and add encoded value (new encode section?) [true]\n        encode string ([playery v] of [scrolling platformer engine v]) and add encoded value (new encode section?) []\n        encode string (@USERNAME@) and add encoded value (new encode section?) []\n        encode string (@PARACHUTE@?) and add encoded value (new encode section?) []\n        encode string (timer) and add encoded value (new encode section?) []\n        send data (clone#) & (encoded value)\n    else\n        dec.val=cloudID (clone#)\n        disconnection timeout: [50]\n        decode string (decoded result) and add to value (new decode section?) [true]\n        set size to (400) %\n        change [offsetx v] by (((decoded result) - (offsetx)) / (5))\n        set x to ((x position) + (((x position) - ((offsetx) - (SCROLLX))) / (-1)))\n        set size to (100) %\n        decode string [] and add to value (new decode section?) []\n        set size to (400) %\n        change [offsety v] by (((decoded result) - (offsety)) / (5))\n        set y to ((y position) + (((y position) - ((offsety) - (SCROLLY))) / (-1)))\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\nwhen I receive [find free gaming slot v]\nset [@connected?@ v] to [false]\nbroadcast (message:connecting v)\nallocate gaming slot\nset [@connected?@ v] to [true]\nif <(@PLAYERID@) > [0]> then\n    broadcast (message:connected v)\nelse\n    broadcast (fail v)\nend\n\ndefine allocate gaming slot\ndec.val=cloudID (clone#)\nset [allo_last val v] to (join [A] (decoded result))\nwait (2) seconds\ndec.val=cloudID (clone#)\nif <(join [A] (decoded result)) = (allo_last val)> then\n    if <(clone#) = [1]> then\n        set [@playerid@ v] to (clone#)\n        stop [this script v]\n    else\n        if <(clone#) = [2]> then\n            set [@playerid@ v] to (clone#)\n            stop [this script v]\n        else\n            if <(clone#) = [3]> then\n                set [@playerid@ v] to (clone#)\n                stop [this script v]\n            else\n                if <(clone#) = [4]> then\n                    set [@playerid@ v] to (clone#)\n                    stop [this script v]\n                else\n                    if <(clone#) = [5]> then\n                        set [@playerid@ v] to (clone#)\n                        stop [this script v]\n                    else\n                        if <(clone#) = [6]> then\n                            set [@playerid@ v] to (clone#)\n                            stop [this script v]\n                        else\n                            if <(clone#) = [7]> then\n                                set [@playerid@ v] to (clone#)\n                                stop [this script v]\n                            else\n                                if <(clone#) = [8]> then\n                                    set [@playerid@ v] to (clone#)\n                                    stop [this script v]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nset [@playerid@ v] to (clone#)\n\ndefine disconnection timeout: (frames)\ndec.val=cloudID (clone#)\nif <(join [A] (decoded result)) = (discon_lastval)> 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 [discon_lastval v] to (join [A] (decoded result))\n    if <(@CONNECTED?@) = [true]> then\n        show\n    end\nend\n\nwhen I receive [send highscore v]\nrepeat (10)\n    set [☁ highscore v] to (@TIME@)\nend\n\n@message\n\nwhen flag clicked\ngo to x: (160) y: (-140)\nhide\nrepeat (2)\n    go to [front v] layer\nend\n\nwhen I receive [message:connecting v]\nswitch costume to (connecting v)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [message:connected v]\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 (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [fail v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (error v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@SFE\n\ndefine print text (txt) at pos: (x) (y)\nset size to (50) %\ngo to [back v] layer\ngo to x: (x) y: (y)\nhide\nset [item# v] to [1]\nrepeat (length of (txt))\n    switch costume to (letter (item#) of (txt))\n    create clone of (_myself_ v)\n    change [item# v] by (1)\n    change x by (13)\nend\n\nwhen flag clicked\nforever\n    broadcast (del clones v)\n    print text (☁ HIGHSCORE) at pos: [-125] [-160]\n    if <([costume # v] of [scoreboard v]) = [2]> then\n        print text (@TIME@) at pos: [-100] [-138]\n    end\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [del clones v]\ndelete this clone\n\nwhen I receive [turbo on v]\nbroadcast (del clones v)\nstop [other scripts in sprite v]\n\n@chat\n\nwhen I receive [safe chat v]\nrepeat (5)\n    change [ghost v] effect by (-10)\nend\nrepeat (3)\n    go to [front v] layer\nend\nask [] and wait\nif <not <(answer) = []>> then\n    if <(answer) = [1]> then\n        set [_message v] to [Hi! :\) what's up?]\n    else\n        if <(answer) = [2]> then\n            set [_message v] to [I am fine.Thx.]\n        else\n            if <(answer) = [3]> then\n                set [_message v] to [Yes]\n            else\n                if <(answer) = [4]> then\n                    set [_message v] to [No.]\n                else\n                    if <(answer) = [5]> then\n                        set [_message v] to [Haha]\n                    else\n                        if <(answer) = [6]> then\n                            set [_message v] to [Yay]\n                        else\n                            if <(answer) = [7]> then\n                                set [_message v] to [I reached the end!]\n                            else\n                                if <(answer) = [8]> then\n                                    set [_message v] to [Come up here.]\n                                else\n                                    if <(answer) = [9]> then\n                                        set [_message v] to [Come with me.]\n                                    else\n                                        if <(answer) = [10]> then\n                                            set [_message v] to [Let's chase!]\n                                        else\n                                            if <(answer) = [11]> then\n                                                set [_message v] to [Fly with jetpack!]\n                                            else\n                                                if <(answer) = [12]> then\n                                                    set [_message v] to [Fly with parachute!]\n                                                else\n                                                    if <(answer) = [13]> then\n                                                        set [_message v] to [Go!]\n                                                    else\n                                                        if <(answer) = [14]> then\n                                                            set [_message v] to [wow]\n                                                        else\n                                                            if <(answer) = [15]> then\n                                                                set [_message v] to [bye...]\n                                                            else\n                                                                if <(answer) = [16]> then\n                                                                    set [_message v] to [Okay!]\n                                                                else\n                                                                    if <(answer) = [17]> then\n                                                                        set [_message v] to [Sorry]\n                                                                    else\n                                                                        if <(answer) = [18]> then\n                                                                            set [_message v] to [Let's gather!]\n                                                                        else\n                                                                            if <(answer) = [19]> then\n                                                                                set [_message v] to [I got the highscore!]\n                                                                            else\n                                                                                if <(answer) = [20]> then\n                                                                                    set [_message v] to [Let's speedrun!]\n                                                                                else\n                                                                                    if <(answer) = [21]> then\n                                                                                        set [_message v] to [?]\n                                                                                    else\n                                                                                        if <(answer) = [22]> then\n                                                                                            set [_message v] to [I am admin! :\)]\n                                                                                        else\n                                                                                            broadcast (hide v)\n                                                                                            stop [this script v]\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            end\n        end\n    end\n    set [_utemp v] to (@USERNAME@)\n    set [@username@ v] to (join (@USERNAME@) (join [:] (_message)))\n    broadcast (hide v)\n    broadcast (speak val v) and wait\n    set [@username@ v] to (_utemp)\nelse\n    broadcast (hide v)\n    stop [this script v]\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\n\nwhen I receive [hide v]\nrepeat (5)\n    change [ghost v] effect by (10)\nend\n\nset [_message v] to [plz reload the page and rejoin the game:\)]\nset [_utemp v] to (@USERNAME@)\nset [@username@ v] to (join (@USERNAME@) (join [:] (_message)))\nbroadcast (hide v)\nbroadcast (speak val v) and wait\nset [@username@ v] to (_utemp)\n\n@checkpoints\n\nwhen I receive [position v]\nset size to (400) %\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\nset size to (100) %\n\ndefine locate checkpoint at (x) (y)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen flag clicked\nlocate checkpoint at [340] [1100]\nshow\nset [ghost v] effect to (0)\nforever\n    if <touching (scrolling platformer engine v)?> then\n        broadcast (set respawn v) and wait\n        start sound [Collect v]\n        repeat (10)\n            change [ghost v] effect by (10)\n            change [y v] by (1)\n        end\n        stop [other scripts in sprite v]\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [reached v]\nhide\nstop [other scripts in sprite v]\nlocate checkpoint at [-2600] [145]\nbroadcast (set respawn v) and wait\n\n@turbo detector\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    set y to (0)\n    repeat until <(timer) > [5]>\n        change y by (1)\n    end\n    set [turbo? v] to <(y position) > [15]>\n    set [timer v] to [0]\n    if <(turbo?) = [true]> then\n        go to x: (0) y: (0)\n        stop [other scripts in sprite v]\n        broadcast (turbo on v)\n        clear graphic effects\n        go to [front v] layer\n        stop [all v]\n    end\nend\n\nwhen flag clicked\nset [timer v] to [0]\nforever\n    change [timer v] by (1)\n    wait (0.001) seconds\nend\n\n@bg\n\nwhen flag clicked\nset [clone# v] to [0]\nhide\ngo to [back v] layer\nset up clones\n\nwhen I receive [position v]\ngo to [back v] layer\nposition (round ((x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine clone at (x) (y)\nchange [clone# v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\ndefine set up clones\nclone at [-3080] [0]\nrepeat (10)\n    clone at (x) ((y) + (773))\nend\nclone at [-2310] [0]\nrepeat (10)\n    clone at (x) ((y) + (773))\nend\nclone at [-1540] [0]\nrepeat (10)\n    clone at (x) ((y) + (773))\nend\nclone at [-770] [0]\nrepeat (10)\n    clone at (x) ((y) + (773))\nend\nclone at [0] [0]\nrepeat (10)\n    clone at (x) ((y) + (773))\nend\nclone at [770] [0]\nrepeat (10)\n    clone at (x) ((y) + (773))\nend\nclone at [1540] [0]\nrepeat (10)\n    clone at (x) ((y) + (773))\nend\nclone at [2310] [0]\nrepeat (10)\n    clone at (x) ((y) + (773))\nend\n\n@scoreboard\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\n\nwhen I receive [end v]\nswitch costume to (costume2 v)\n\nwhen I receive [position v]\ngo to x: (0) y: (0)\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [turbo on v]\nhide\n\n