The Hidden Hills - A Multiplayer Scrolling Platformer #games

Instructions:                           ◆ The Hidden Hills ◆\n       ◆ Multiplayer Scrolling Platformer ◆\n\n>> This is my best game, with 2,120 blocks!\n>> I worked really hard on this project (1 month), so please love and fav :D\n\n                              ◆ Instructions ◆\n\n>> Arrow keys, WASD, or mobile controls to move\n>> You can mute (pause), restart, and go to the shop on the top menu bar\n>> Press the chat button to chat with other players\n>> Buy upgrades from the shop!\n>> Love and Fave for 10 coins!\n\n                                  ◆ Credits ◆\n\n>> @JTHEJET for the contest and the multiplayer engine\n>> @griffpatch for the scrolling platformer engine\n>> @StratfordJames for lots of inspiration, trampoline art and coin art\n>> @0014049 for checkpoint code, modified by me\n>> @TimMcCool for most of the menu and stop scripts\n\n                                 ◆ Music ◆\n\n>> Bensound.com\n\n                             ◆ Beta Testers ◆\n\n      @StratfordJames, @icmy123, @Silvergecko\n\n                                    ◆ Tags ◆\n\n#all #games #multiplayer #scrolling #platformer #contest #JTHEJET

@Stage\n\nwhen [m v] key pressed\nshow variable [mouse x,y v]\nset [mouse x,y v] to (join ((mouse x) + (SCROLL X)) (join [,] ((mouse y) + (SCROLL Y))))\nwait (5) seconds\nhide variable [mouse x,y v]\n\nwhen flag clicked\nhide variable [mouse x,y v]\n\n@Player\n\nwhen I receive [begin v]\nset [chat v] to [0]\nshow list [chat v]\nforever\n    Chat\nend\n\nwhen I receive [play game v]\nset [connected? v] to [0]\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\ndefine Change Player x by (sx)\npoint in direction (90)\nchange [x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\nwhen flag clicked\nset volume to (100) %\npoint in direction (90)\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Game On\nif <(Checkpoint) = [0]> then\n    set [x v] to [0]\n    set [y v] to [100]\nelse\n    if <(Checkpoint) = [1]> then\n        set [x v] to [1800]\n        set [y v] to [50]\n    else\n        if <(Checkpoint) = [2]> then\n            set [x v] to [4875]\n            set [y v] to [90]\n        else\n            set [x v] to [3287]\n            set [y v] to [14]\n        end\n    end\nend\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [ghost v] effect to (0)\nset size to (100) %\n\ndefine Test - Die\nif <touching (danger v)?> then\n    start sound [Hurt v]\n    set [exit v] to [die]\nend\nif <touching (saws v)?> then\n    start sound [Hurt v]\n    set [exit v] to [die]\nend\n\ndefine Game - Die\nset [exit v] to []\nstart sound [Hurt v]\n\ndefine Game - Win\nreset timer\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\n    change volume by (-10)\nend\nhide\nstop all sounds\nstop [other scripts in sprite v]\n\ndefine Tick\ngo to [front v] layer\nif <not <key (any v) pressed?>> then\n    switch costume to (normal v)\nend\nif <<<(mouse x) < (x position)> and <mouse down?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    switch costume to (left v)\n    if <[equipped v] contains [2]?> then\n        change [sx v] by (-2.5)\n    else\n        change [sx v] by (-2)\n    end\nend\nif <<<(x position) < (mouse x)> and <mouse down?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (right v)\n    if <[equipped v] contains [2]?> then\n        change [sx v] by (2.5)\n    else\n        change [sx v] by (2)\n    end\nend\nif <<<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> and <<<(mouse x) < (x position)> and <mouse down?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n    switch costume to (left up v)\nend\nif <<<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> and <<<(x position) < (mouse x)> and <mouse down?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>>> then\n    switch costume to (right up v)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    if <(in air) < [4]> then\n        if <[equipped v] contains [1]?> then\n            set [sy v] to [20]\n        else\n            set [sy v] to [16]\n        end\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y by (sy)\nTest - Die\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\nif <(x) < [-220]> then\n    set [x v] to [-220]\nend\nif <touching (trampoline v)?> then\n    set [sy v] to [30]\nend\nif <(sy) > [0]> then\n    switch costume to (up v)\nend\nif <[equipped v] contains [3]?> then\n    if <key (space v) pressed?> then\n        switch costume to (parachute v)\n        set [sy v] to [0]\n    end\nend\n\nwhen flag clicked\nhide\nset [max players v] to [8]\nset [my player # v] to [0]\nbroadcast (Connecting v)\nbroadcast (Setup Others v) and wait\nbroadcast (Join Game v) and wait\nif <(MY PLAYER #) > [0]> then\n    broadcast (Connected v)\n    start sound [Connect v]\nelse\n    broadcast (Full v)\n    start sound [Disconnect v]\nend\nbroadcast (Begin v)\n\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ p1 v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ p2 v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ p3 v] to (value)\n        else\n            if <(player) = [4]> then\n                set [☁ p4 v] to (value)\n            else\n                if <(player) = [5]> then\n                    set [☁ p5 v] to (value)\n                else\n                    if <(player) = [6]> then\n                        set [☁ p6 v] to (value)\n                    else\n                        if <(player) = [7]> then\n                            set [☁ p7 v] to (value)\n                        else\n                            if <(player) = [8]> then\n                                set [☁ p8 v] to (value)\n                            else\n                                if <(player) = [9]> then\n                                    set [☁ p9 v] to (value)\n                                else\n                                    if <(player) = [10]> then\n                                        set [☁ p10 v] to (value)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine write (val) to encoded\nset [letter # v] to [1]\nrepeat (length of (val))\n    set [encoded v] to (join (encoded) (item # of (letter (letter #) of (val)) in [code v]))\n    change [letter # v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\nwhen I receive [begin v]\nforever\n    if <(MY PLAYER #) > [0]> then\n        send cloud data\n    end\nend\n\ndefine send cloud data\nset [encoded v] to []\nwrite (username) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite (x) to encoded\nwrite (y) to encoded\nwrite (Chat Words) to encoded\nset cloud # (MY PLAYER #) to (encoded)\n\ndefine Chat\nif <(Chat) = [1]> then\n    if <key (1 v) pressed?> then\n        set [chat v] to [1]\n        say (item (1) of [chat v])\n        wait (2) seconds\n        say []\n        set [chat words v] to [0]\n    else\n        if <key (2 v) pressed?> then\n            set [chat words v] to [2]\n            say (item (2) of [chat v])\n            wait (2) seconds\n            say []\n            set [chat words v] to [0]\n        else\n            if <key (3 v) pressed?> then\n                set [chat words v] to [3]\n                say (item (3) of [chat v])\n                wait (2) seconds\n                say []\n                set [chat v] to [0]\n            else\n                if <key (4 v) pressed?> then\n                    set [chat words v] to [4]\n                    say (item (4) of [chat v])\n                    wait (2) seconds\n                    say []\n                    set [chat words v] to [0]\n                else\n                    if <key (5 v) pressed?> then\n                        set [chat words v] to [5]\n                        say (item (5) of [chat v])\n                        wait (2) seconds\n                        say []\n                        set [chat words v] to [0]\n                    else\n                        if <key (6 v) pressed?> then\n                            set [chat words v] to [6]\n                            say (item (6) of [chat v])\n                            wait (2) seconds\n                            say []\n                            set [chat words v] to [0]\n                        else\n                            if <key (7 v) pressed?> then\n                                set [chat words v] to [7]\n                                say (item (7) of [chat v])\n                                wait (2) seconds\n                                say []\n                                set [chat words v] to [0]\n                            else\n                                if <key (8 v) pressed?> then\n                                    set [chat words v] to [8]\n                                    say (item (8) of [chat v])\n                                    wait (2) seconds\n                                    say []\n                                    set [chat words v] to [0]\n                                else\n                                    if <key (9 v) pressed?> then\n                                        set [chat words v] to [9]\n                                        say (item (9) of [chat v])\n                                        wait (2) seconds\n                                        say []\n                                        set [chat words v] to [0]\n                                    else\n                                        set [chat words v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [connected v]\nset [connected? v] to [1]\nshow\n\nwhen I receive [connecting v]\nhide\n\nwhen I receive [play game v]\nforever\n    if <(Connected?) = [1]> then\n        broadcast (Reset v) and wait\n        broadcast (Setup v) and wait\n        Game On\n        repeat until <(EXIT) > []>\n            Tick\n            broadcast (Tick v)\n        end\n        if <(EXIT) = [win]> then\n            Game - Win\n        else\n            Game - Die\n        end\n    end\nend\n\nwhen I receive [connected v]\nset [level v] to [1]\n\nwhen I receive [restart v]\nset [exit v] to [die]\n\n@Others\n\nwhen I receive [begin v]\nset [names v] to [1]\nforever\n    if <key (n v) pressed?> then\n        if <(names) = [1]> then\n            wait until <not <key (n v) pressed?>>\n            set [names v] to [0]\n        else\n            wait until <not <key (n v) pressed?>>\n            set [names v] to [1]\n        end\n    end\nend\n\nwhen I receive [setup others v]\nsetup players\n\ndefine setup players\nhide\nset [offline v] to [100]\nset [player # v] to [1]\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    change [player # v] by (1)\nend\n\ndefine value = cloud # (player)\nif <(player) = [1]> then\n    set [value v] to (☁ P1)\nelse\n    if <(player) = [2]> then\n        set [value v] to (☁ P2)\n    else\n        if <(player) = [3]> then\n            set [value v] to (☁ P3)\n        else\n            if <(player) = [4]> then\n                set [value v] to (☁ P4)\n            else\n                if <(player) = [5]> then\n                    set [value v] to (☁ P5)\n                else\n                    if <(player) = [6]> then\n                        set [value v] to (☁ P6)\n                    else\n                        if <(player) = [7]> then\n                            set [value v] to (☁ P7)\n                        else\n                            if <(player) = [8]> then\n                                set [value v] to (☁ P8)\n                            else\n                                if <(player) = [9]> then\n                                    set [value v] to (☁ P9)\n                                else\n                                    if <(player) = [10]> then\n                                        set [value v] to (☁ P10)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <(MY PLAYER #) = (player #)> then\n        set [offline v] to [100]\n        hide\n    else\n        Tick\n    end\nend\n\ndefine Tick\ngo to [front v] layer\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    change [offline v] by (1)\n    if <(offline) = [100]> then\n        hide\n    end\nelse\n    set [last value v] to (join [A] (value))\n    if <(offline) > [99]> then\n        show\n    end\n    set [offline v] to [0]\nend\nbegin decode of (value)\nvalue = read from encoded\nif <(names) = [1]> then\n    say (join (player #) (join [:] (value)))\nelse\n    say []\nend\nvalue = read from encoded\nvalue = read from encoded\nset x to ((value) - (SCROLL X))\nvalue = read from encoded\nset y to (((value) - (SCROLL Y)) + (8))\nvalue = read from encoded\nbroadcast (Decode Chat v)\n\ndefine begin decode of (encoded)\nset [encoded v] to (encoded)\nset [letter # v] to [1]\n\ndefine value = read from encoded\nset [value v] to []\nforever\n    set [idx v] to (join (letter (letter #) of (encoded)) (letter ((letter #) + (1)) of (encoded)))\n    change [letter # v] by (2)\n    if <(idx) < [1]> then\n        stop [this script v]\n    end\n    set [value v] to (join (value) (item (idx) of [code v]))\nend\n\nwhen I receive [join game v]\nvalue = cloud # (player #)\nset [last value v] to (join [A] (value))\nwait (3) seconds\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    set [my player # v] to (player #)\nend\n\ndefine Decode Chat (chat)\nif <(chat) = [1]> then\n    say (item (1) of [chat v]) for (2) seconds\nelse\n    if <(chat) = [2]> then\n        say (item (2) of [chat v]) for (2) seconds\n    else\n        if <(chat) = [3]> then\n            say (item (3) of [chat v]) for (2) seconds\n        else\n            if <(chat) = [4]> then\n                say (item (4) of [chat v]) for (2) seconds\n            else\n                if <(chat) = [5]> then\n                    say (item (5) of [chat v]) for (2) seconds\n                else\n                    if <(chat) = [6]> then\n                        say (item (6) of [chat v]) for (2) seconds\n                    else\n                        if <(chat) = [7]> then\n                            say (item (7) of [chat v]) for (2) seconds\n                        else\n                            if <(chat) = [8]> then\n                                say (item (8) of [chat v]) for (2) seconds\n                            else\n                                if <(chat) = [9]> then\n                                    say (item (9) of [chat v]) for (2) seconds\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [decode chat v]\nDecode Chat (value)\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\ngo to [back v] layer\ngo [forward v] (7) layers\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [425] y: [0]\n    Clone at x: [325] y: [25]\n    Clone at x: [275] y: [-75]\n    Clone at x: [400] y: [-100]\n    Clone at x: [350] y: [100]\n    Clone at x: [345] y: [83]\n    Clone at x: [345] y: [0]\n    Clone at x: [510] y: [-55]\n    Clone at x: [450] y: [100]\n    Clone at x: [500] y: [100]\n    Clone at x: [500] y: [-300]\n    Clone at x: [500] y: [200]\n    Clone at x: [400] y: [100]\n    Clone at x: [500] y: [200]\n    Clone at x: [500] y: [200]\n    Clone at x: [500] y: [200]\nend\n\ndefine Position (x) (y)\nset size to (100) %\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\n@DANGER\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((DANGER: x) - (SCROLL X)) ((DANGER: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [800] y: [100]\n    Clone at x: [2100] y: [-30]\n    Clone at x: [3125] y: [425]\nend\n\ndefine Position (x) (y)\ngo to [back v] layer\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\n@Landscape\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\ngo to [back v] layer\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [425] y: [0]\n    Clone at x: [325] y: [25]\n    Clone at x: [275] y: [-75]\n    Clone at x: [400] y: [-100]\n    Clone at x: [350] y: [100]\n    Clone at x: [345] y: [83]\n    Clone at x: [345] y: [0]\n    Clone at x: [510] y: [-55]\n    Clone at x: [450] y: [100]\n    Clone at x: [500] y: [100]\n    Clone at x: [500] y: [-300]\n    Clone at x: [500] y: [200]\n    Clone at x: [400] y: [100]\n    Clone at x: [500] y: [200]\n    Clone at x: [500] y: [200]\n    Clone at x: [500] y: [200]\nend\n\ndefine Position (x) (y)\nset size to (100) %\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\n@Saws\n\nwhen I receive [green flag v]\nhide variable [mouse v]\nhide\n\nwhen I receive [tick v]\nturn right (10) degrees\nPosition ((Saws: x) - (SCROLL X)) ((Saws: y) - (SCROLL Y))\ngo to [back v] layer\n\nwhen I receive [setup v]\nhide\nset [coins v] to [0]\nset [saws: x v] to [0]\nset [saws: y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone at x: [140] y: [-50]\n    Clone at x: [2100] y: [190]\nend\nset [saws: x v] to [-999999]\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\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [saws: x v] to (x)\nset [saws: y v] to (y)\ncreate clone of (_myself_ v)\n\nClone at x: [340] y: [27]\nClone at x: [530] y: [27]\nClone at x: [786] y: [27]\nClone at x: [1124] y: [27]\nClone at x: [1331] y: [245]\nClone at x: [1065] y: [345]\nClone at x: [825] y: [272]\nClone at x: [392] y: [245]\nClone at x: [197] y: [335]\n\nClone at x: [631] y: [11]\n\n@Exit\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nswitch costume to (end v)\nPosition ((Exit: x) - (SCROLL X)) (((([cos v] of ((timer) * (100)) ) * (10)) + (0)) + ((Exit: y) - (SCROLL Y)))\nif <<touching (player v)?> and <(costume [number v]) = [1]>> then\n    set [exit v] to [win]\n    broadcast (End v)\n    start sound [Win v]\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [exit: x v] to [0]\nset [exit: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (closed v)\n    Clone at x: [6900] y: [825]\nend\n\ndefine Position (x) (y)\ngo to [back v] layer\nturn right (5) degrees\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [exit: x v] to (x)\nset [exit: y v] to (y)\n\n@Collectables\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nnext costume\nPosition ((Collectables: x) - (SCROLL X)) ((([cos v] of ((timer) * (100)) ) * (10)) + ((Collectables: y) - (SCROLL Y)))\nif <touching (player v)?> then\n    start sound [Coin v]\n    change [coins v] by (1)\n    delete this clone\nend\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: (x) y: (y)\nset [collectables: x v] to (x)\nset [collectables: y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [coins v] to [0]\nhide\ngo to [front v] layer\nset [collectables: x v] to [0]\nset [collectables: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (coin1 v)\n    Clone at x: [50] y: [0]\n    Clone at x: [200] y: [0]\n    Clone at x: [415] y: [50]\n    Clone at x: [465] y: [50]\n    Clone at x: [515] y: [50]\n    Clone at x: [725] y: [110]\n    Clone at x: [1250] y: [-125]\n    Clone at x: [1300] y: [-125]\n    Clone at x: [1350] y: [-125]\n    Clone at x: [2500] y: [200]\n    Clone at x: [2550] y: [180]\n    Clone at x: [2600] y: [160]\n    Clone at x: [2650] y: [140]\n    Clone at x: [2700] y: [120]\n    Clone at x: [2750] y: [100]\n    Clone at x: [2800] y: [80]\n    Clone at x: [3400] y: [80]\n    Clone at x: [3450] y: [80]\n    Clone at x: [3650] y: [150]\n    Clone at x: [3700] y: [150]\n    Clone at x: [3900] y: [200]\n    Clone at x: [3950] y: [200]\n    Clone at x: [4150] y: [270]\n    Clone at x: [4200] y: [270]\n    Clone at x: [5250] y: [200]\n    Clone at x: [5300] y: [200]\n    Clone at x: [5500] y: [300]\n    Clone at x: [5550] y: [300]\n    Clone at x: [5750] y: [400]\n    Clone at x: [5800] y: [400]\nend\nset [collectables: x v] to [-9999999999]\n\n@Trampoline\n\nwhen I start as a clone\nswitch costume to (trampoline 1 v)\nforever\n    if <touching (player v)?> then\n        repeat (5)\n            next costume\n        end\n        start sound [Bounce v]\n        repeat (5)\n            switch costume to ((costume [number v]) - (1))\n        end\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Trampoline: x) - (SCROLL X)) ((Trampoline: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [trampoline: x v] to [0]\nset [trampoline: y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone at x: [1475] y: [-140]\n    Clone at x: [6460] y: [590]\nend\nset [trampoline: x v] to [-999999999]\n\ndefine Position (x) (y)\ngo [backward v] (10) layers\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [trampoline: x v] to (x)\nset [trampoline: y v] to (y)\ncreate clone of (_myself_ v)\n\n@Checkpoint \n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Checkpoint : x) - (SCROLL X)) ((Checkpoint : y) - (SCROLL Y))\nif <(costume [number v]) = [2]> then\n    if <touching (player v)?> then\n        start sound [Teleport2 v]\n        point in direction (45)\n        switch costume to (checkpoint open v)\n        set [checkpoint v] to (#)\n    end\nend\nif <not <(Checkpoint) = (#)>> then\n    switch costume to (checkpoint closed v)\nend\n\ndefine Position (x) (y)\ngo [backward v] (10) layers\nturn right (((90) - (direction)) / (5)) degrees\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: (x) y: (y)\nset [checkpoint : x v] to (x)\nset [checkpoint : y v] to (y)\nchange [# v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [checkpoint v] to [0]\nhide\nset [checkpoint : x v] to [0]\nset [checkpoint : y v] to [0]\nif <(LEVEL) = [1]> then\n    set [# v] to [0]\n    switch costume to (checkpoint closed v)\n    Clone at x: [1800] y: [50]\n    Clone at x: [4875] y: [90]\nend\nset [checkpoint : x v] to [-99999]\n\nwhen I receive [beep2 v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [beep2 v]\ndelete this clone\n\n@Chat\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nclear graphic effects\nhide\n\nwhen I receive [chat open v]\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change y by (((0) - (y position)) / (5))\n    change [ghost v] effect by (-5)\nend\nset [chat v] to [1]\nrepeat until <(Chat) = [0]>\n    if <<mouse down?> and <not <touching (mouse-pointer v)?>>> then\n        broadcast (Chat Close v)\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I receive [chat close v]\nrepeat (20)\n    change y by (((-200) - (y position)) / (5))\n    change [ghost v] effect by (5)\nend\nset [chat v] to [0]\n\n@Chat Button\n\nwhen I receive [tick v]\ngo to [front v] layer\nif <touching (mouse-pointer v)?> then\n    repeat until <(size) > [119]>\n        change size by (((120) - (size)) / (5))\n    end\n    if <mouse down?> then\n        broadcast (Chat Open v)\n        hide\n        wait until <not <mouse down?>>\n    end\nelse\n    repeat until <(size) < [101]>\n        change size by (((100) - (size)) / (5))\n    end\nend\n\nwhen I receive [chat close v]\nset size to (100) %\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [begin v]\nshow\nrepeat (40)\n    change [ghost v] effect by (-3)\nend\n\nwhen flag clicked\ngo to [front v] layer\nhide\ngo to x: (0) y: (0)\nchange [ghost v] effect by (100)\n\nwhen flag clicked\ngo to x: (-193) y: (-156)\nset size to (100) %\n\nwhen I receive [end v]\nhide\n\n@Bar\n\nwhen flag clicked\nset [shop v] to [-30]\nhide\ndelete this clone\n\nwhen I receive [show bar v]\nset [menu.of v] to [0]\nset volume to (100) %\nshow\ndelete all of [buttons.touching? v]\nswitch costume to (kostüm1 v)\ngo to x: (0) y: (100)\nnew button @ [-215] [161] [1]\nnew button @ [-180] [161] [2]\nnew button @ [-120] [161] [5]\nnew button @ [0] [0] [10]\n\ndefine new button @ (x) (y) (type)\nadd [0] to [buttons.touching? v]\nset [bar: x v] to (x)\nset [bar: y v] to (y)\nset [mode v] to (type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [mute v] to [0]\nhide\ngo to [front v] layer\nset [ghost v] effect to (10)\nif <(mode) < [6]> then\n    go to [front v] layer\n    if <(mode) = [1]> then\n        switch costume to (2_ v)\n    end\n    if <(mode) = [2]> then\n        switch costume to (6_ v)\n    end\n    if <(mode) = [5]> then\n        switch costume to (15 v)\n    end\n    go to x: (Bar: x) y: ((Bar: y) + (45))\n    show\n    forever\n        repeat until <touching (mouse-pointer v)?>\n            change size by (((size) - (85)) / (-5))\n            replace item (mode) of [buttons.touching? v] with [0]\n            set [brightness v] effect to (-30)\n            xb\n            if <(mode) = [1]> then\n                if <(mute) = [1]> then\n                    switch costume to (1_ v)\n                else\n                    switch costume to (2_ v)\n                end\n            end\n        end\n        if <(win?) = [0]> then\n            if <(mute.sound) = [0]> then\n                start sound [Touch v]\n            end\n        end\n        repeat until <not <touching (mouse-pointer v)?>>\n            if <mouse down?> then\n                if <(mode) = [1]> then\n                    if <(mute) = [0]> then\n                        if <<touching (mouse-pointer v)?> and <(mouse y) < [180]>> then\n                            set [mute v] to [1]\n                            switch costume to (12 v)\n                        end\n                    else\n                        if <<touching (mouse-pointer v)?> and <(mouse y) < [180]>> then\n                            set [mute v] to [0]\n                        end\n                    end\n                end\n                if <(mode) = [5]> then\n                    if <(shop) > [0]> then\n                        broadcast (Open shop v)\n                        set [shop v] to [-1]\n                        wait until <not <mouse down?>>\n                    else\n                        broadcast (Close shop v)\n                        set [shop v] to [30]\n                        wait until <not <mouse down?>>\n                    end\n                end\n                if <(mode) = [2]> then\n                    broadcast (Restart v)\n                end\n                if <(mode) = [1]> then\n                    if <(mute) = [1]> then\n                        switch costume to (1_ v)\n                    else\n                        switch costume to (2_ v)\n                    end\n                end\n                repeat until <<not <mouse down?>> or <not <touching (mouse-pointer v)?>>>\n                    change size by (((size) - (100)) / (-5))\n                end\n            end\n            xb\n            if <not <(mode) = [5]>> then\n                replace item (mode) of [buttons.touching? v] with [1]\n            end\n            set [brightness v] effect to (100)\n        end\n    end\nelse\n    if <(mode) = [10]> then\n        switch costume to (restart v)\n        forever\n            if <(menu.of) = [0]> then\n                set size to (65) %\n                go to x: (mouse x) y: ((mouse y) - (20))\n                show\n                set [brightness v] effect to (100)\n                if <[buttons.touching? v] contains [1]?> then\n                    set [ghost v] effect to (20)\n                    if <(item (1) of [buttons.touching? v]) = [1]> then\n                        if <(mute) = [0]> then\n                            switch costume to (mute v)\n                        else\n                            switch costume to (mute2 v)\n                        end\n                    else\n                        if <(item (2) of [buttons.touching? v]) = [1]> then\n                            switch costume to (restart v)\n                        end\n                    end\n                else\n                    set [ghost v] effect to (100)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [show bar v]\nset [pitch v] effect to (0)\nforever\n    go to [front v] layer\n    go [backward v] (5) layers\n    xb\n    if <(menu.of) = [0]> then\n        switch costume to (kostüm5 v)\n        set [ghost v] effect to (0)\n    else\n        switch costume to (kostüm4 v)\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (5) layers\nend\n\ndefine xb\nif <<(costume [number v]) = [2]> or <(costume [number v]) = [4]>> then\n    if <<touching (mouse-pointer v)?> and <(mouse y) < [180]>> then\n        set [menu.of v] to [0]\n    else\n        if <(mouse y) < [120]> then\n            set [menu.of v] to [1]\n        end\n    end\nend\nset [velocity v] to (((velocity) * (0.6)) + (((y position) - ((Bar: y) + (<(menu.of) = [1]> * (45)))) * (-0.3)))\nchange y by ([floor v] of (velocity) )\n\nwhen flag clicked\nstop all sounds\nrepeat until <(timer) > (Check timer)>\n    play sound [bensound-memories v] until done\nend\nrepeat (10)\n    change volume by (-10)\nend\n\nwhen flag clicked\nforever\n    if <(mute) = [1]> then\n        set volume to (0) %\n        set [pitch v] effect to (((-1) / (0)) * ((1) / (0)))\n    else\n        set volume to (100) %\n        set [pitch v] effect to (0)\n    end\nend\n\nwhen I receive [hide bar v]\nhide\ndelete this clone\n\nwhen flag clicked\nset [mute.sound v] to [0]\nset [shop v] to [-1]\n\nwhen I receive [connected v]\nbroadcast (show bar v)\n\nwhen I receive [end v]\nhide\ndelete this clone\n\n@Love fave\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    if <not <<(LOVED__) = [1]> and <(FAVED___) = [1]>>> then\n        wait (pick random (30) to (40)) seconds\n        switch costume to (costume1 v)\n        go to x: (0) y: (50)\n        show\n        go to [front v] layer\n        start sound [pop v]\n        repeat (9)\n            change y by (-6)\n        end\n        repeat (5)\n            change y by (3)\n        end\n        repeat (5)\n            change y by (-1)\n        end\n        wait (2) seconds\n        repeat (15)\n            change y by (7)\n        end\n        hide\n    end\n    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [end v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nbroadcast (Thanks v)\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\nwhen I receive [end v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Thanks\n\nwhen I receive [thanks v]\nchange [coins v] by (10)\nswitch costume to (costume2 v)\ngo to x: (-210) y: (50)\nshow\ngo to [front v] layer\nstart sound [pop v]\nrepeat (9)\n    change y by (-6)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (5)\n    change y by (-3)\nend\nwait (1) seconds\nrepeat (10)\n    change y by (6)\nend\nhide\n\nwhen I start as a clone\ngo to x: (0) y: (-50)\nshow\ngo to [front v] layer\nrepeat (12)\n    change y by (-9)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (5)\n    change y by (-1)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        if <(costume [number v]) = [2]> then\n            if <mouse down?> then\n                set [costume v] to [2]\n                repeat (25)\n                    change y by (10)\n                end\n                hide\n                delete this clone\n            end\n        else\n            if <(costume [number v]) = [3]> then\n                if <mouse down?> then\n                    set [costume v] to [1]\n                    repeat (25)\n                        change y by (15)\n                    end\n                    hide\n                    delete this clone\n                end\n            end\n        end\n    else\n        set [ghost v] effect to (0)\n    end\n    if <(Costume) > [0.99]> then\n        repeat (25)\n            change y by (15)\n        end\n        hide\n        delete this clone\n    end\n    hide\n    delete this clone\nend\n\nwhen flag clicked\nhide\nset [costume v] to [0.9]\n\nwhen I receive [begin v]\nset [costume v] to [0.9]\nwait (0.1) seconds\nset [costume v] to [0.9]\nwait (0.2) seconds\nset [costume v] to [0.9]\n\n@Joining\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [begin v]\nhide\n\nwhen I receive [connecting v]\ngo to [front v] layer\nswitch costume to (joining v)\nshow\n\nwhen I receive [connected v]\ngo [forward v] (1322) layers\nstart sound [Connect v]\nswitch costume to (connected v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [full v]\nswitch costume to (full  v)\nshow\n\n@Loader\n\nwhen flag clicked\nhide\n\nwhen I receive [connecting v]\ngo to [front v] layer\nswitch costume to (connecting v)\ngo to x: (0) y: (-300)\nset [ghost v] effect to (0)\nshow\nrepeat until <(y position) > [-101]>\n    change [ghost v] effect by (-10)\n    change y by (((-100) - (y position)) / (9))\nend\n\nwhen I receive [full v]\nswitch costume to (full v)\nshow\n\nwhen I receive [connected v]\nswitch costume to (connected v)\nrepeat until <[-299] > (y position)>\n    change [ghost v] effect by (10)\n    change y by (((-300) - (y position)) / (9))\nend\n\n@TB\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    hide\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    set [check timer v] to (timer)\nend\n\nwhen [timer v] > (Check timer)\nset [ghost v] effect to (100)\nforever\n    show\n    change [ghost v] effect by (-10)\n    go to [front v] layer\nend\n\n@Item 1\n\nwhen flag clicked\nset y to (0)\nforever\n    set size to (100) %\n    set [ghost v] effect to (25)\n    show\n    go to [front v] layer\n    go [backward v] (0) layers\n    switch costume to (.3 v)\n    set x to (75)\n    if <(shop) < [0]> then\n        xb [0]\n    else\n        xb [1]\n    end\n    if <not <[equipped v] contains [1]?>> then\n        if <(Coins) > [4]> then\n            if <touching (mouse-pointer v)?> then\n                if <mouse down?> then\n                    set [brightness v] effect to (60)\n                    wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                    if <touching (mouse-pointer v)?> then\n                        add [1] to [equipped v]\n                        start sound [32634__kjackson__open-03 v]\n                        change [coins v] by (-5)\n                    end\n                end\n            else\n                change size by (((100) - (size)) / (5))\n                set [brightness v] effect to (0)\n            end\n        else\n            set [ghost v] effect to (60)\n        end\n    else\n        set [brightness v] effect to (20)\n        switch costume to (.4 v)\n    end\nend\n\ndefine xb (b)\nif <(b) = [1]> then\n    set [vel v] to (((y position) - (50)) * (-0.3))\nelse\n    set [vel v] to (((y position) - (-300)) * (-0.3))\nend\nchange y by (vel)\n\n@Item 2\n\nwhen flag clicked\nset y to (0)\nforever\n    set size to (100) %\n    set [ghost v] effect to (25)\n    show\n    go to [front v] layer\n    go [backward v] (0) layers\n    switch costume to (.3 v)\n    set x to (75)\n    if <(shop) < [0]> then\n        xb [0]\n    else\n        xb [1]\n    end\n    if <not <[equipped v] contains [2]?>> then\n        if <(Coins) > [9]> then\n            if <touching (mouse-pointer v)?> then\n                if <mouse down?> then\n                    set [brightness v] effect to (60)\n                    wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                    if <touching (mouse-pointer v)?> then\n                        add [2] to [equipped v]\n                        start sound [32634__kjackson__open-03 v]\n                        change [coins v] by (-10)\n                    end\n                end\n            else\n                change size by (((100) - (size)) / (5))\n                set [brightness v] effect to (0)\n            end\n        else\n            set [ghost v] effect to (60)\n        end\n    else\n        set [brightness v] effect to (20)\n        switch costume to (.4 v)\n    end\nend\n\ndefine xb (b)\nif <(b) = [1]> then\n    set [vel v] to (((y position) - (-5)) * (-0.3))\nelse\n    set [vel v] to (((y position) - (-300)) * (-0.3))\nend\nchange y by (vel)\n\n@Item 3\n\nwhen flag clicked\nset y to (0)\nforever\n    set size to (100) %\n    set [ghost v] effect to (25)\n    show\n    go to [front v] layer\n    go [backward v] (0) layers\n    switch costume to (.3 v)\n    set x to (75)\n    if <(shop) < [0]> then\n        xb [0]\n    else\n        xb [1]\n    end\n    if <not <[equipped v] contains [3]?>> then\n        if <(Coins) > [24]> then\n            if <touching (mouse-pointer v)?> then\n                if <mouse down?> then\n                    set [brightness v] effect to (60)\n                    wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                    if <touching (mouse-pointer v)?> then\n                        add [3] to [equipped v]\n                        start sound [32634__kjackson__open-03 v]\n                        change [coins v] by (-25)\n                    end\n                end\n            else\n                change size by (((100) - (size)) / (5))\n                set [brightness v] effect to (0)\n            end\n        else\n            set [ghost v] effect to (60)\n        end\n    else\n        set [brightness v] effect to (20)\n        switch costume to (.4 v)\n    end\nend\n\ndefine xb (b)\nif <(b) = [1]> then\n    set [vel v] to (((y position) - (-60)) * (-0.3))\nelse\n    set [vel v] to (((y position) - (-300)) * (-0.3))\nend\nchange y by (vel)\n\n@Shop\n\ndefine xb (b)\nif <(b) = [1]> then\n    set [vel v] to (((y position) - (0)) * (-0.3))\nelse\n    set [vel v] to (((y position) - (-300)) * (-0.3))\nend\nchange y by (vel)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\ndelete all of [equipped v]\nclear graphic effects\nhide\n\nwhen I receive [connected v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (shop v)\nset [ghost v] effect to (100)\ngo to [front v] layer\nforever\n    if <(shop) < [0]> then\n        repeat (10)\n            xb [0]\n            change [ghost v] effect by (7.5)\n        end\n    else\n        repeat (10)\n            xb [1]\n            change [ghost v] effect by (-7.5)\n        end\n    end\nend\n\n@Coins\n\nwhen I receive [clear score v]\ndelete this clone\n\nwhen I start as a clone\nshow\n\nwhen flag clicked\nset [score v] to [0]\nforever\n    broadcast (clear score v)\n    render number (Coins) at x: (150) y: (158) size: (4)\nend\n\ndefine render number (score) at x: (xpos) y: (ypos) size: (size)\nhide\ngo to x: (xpos) y: (ypos)\nset size to ((size) * (10)) %\nset [displaycharacter v] to [1]\nrepeat (length of (score))\n    switch costume to (letter (DisplayCharacter) of (score))\n    create clone of (_myself_ v)\n    change [displaycharacter v] by (1)\n    change x by ((size) * (0.4))\nend\nswitch costume to (coin1 v)\ncreate clone of (_myself_ v)\n\n@End\n\nwhen I receive [end v]\nset [win move v] to [15]\nswitch costume to (end v)\ngo to [front v] layer\nshow\ngo to x: (0) y: (0)\nrepeat ((Win move) * (2))\n    go [forward v] (10000000) layers\n    go to x: (pick random ((Win move) - ((Win move) * (2))) to (Win move)) y: (pick random ((Win move) - ((Win move) * (2))) to (Win move))\n    change [win move v] by (-0.5)\nend\ngo to [front v] layer\n\nwhen flag clicked\nset [win move v] to [30]\nhide\n\n