Ice - A platformer -


@Stage\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nset [music v] to [1]\nforever\n    play sound (Music) until done\nend\n\nwhen I receive [music swap v]\nstop all sounds\n\n@Platforms\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\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: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\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\nnext costume\nnext costume\n\ncreate clone of (_myself_ v)\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\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\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: [480] y: [0]\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\nnext costume\nnext costume\n\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nforever\n    set [x from player v] to (x position)\n    set [y from player v] to (y position)\nend\n\nwhen flag clicked\nforever\n    set [landscape: x v] to (x position)\n    set [landscape: y v] to (y position)\nend\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\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\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\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Player\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 [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\nif <(sx) > [0]> then\n    change [x v] by (-1)\nelse\n    change [x v] by (1)\nend\nPosition\n\nwhen flag clicked\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\nset [y v] to [0]\nset [x v] to [0]\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    set [sanitized? v] to [0]\n    broadcast (Sanitize quickly! v)\nend\n\ndefine Game - Die\nset [exit v] to [die]\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 words 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 words 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 [connected v]\nset [level v] to [1]\n\ndefine Player Tick\n\ndefine Tick\nif <not <key (any v) pressed?>> then\n    if <(Masked) = [1]> then\n        switch costume to (masked normal v)\n    else\n        switch costume to (normal v)\n    end\nend\nif <<<(mouse x) < (x position)> and <mouse down?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    if <(Masked) = [1]> then\n        switch costume to (masked left v)\n    else\n        switch costume to (left v)\n    end\n    change [sx v] by (-2)\nend\nif <<<(x position) < (mouse x)> and <mouse down?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    if <(Masked) = [1]> then\n        switch costume to (masked right v)\n    else\n        switch costume to (right v)\n    end\n    change [sx v] by (2)\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    if <(Masked) = [1]> then\n        switch costume to (masked left up v)\n    else\n        switch costume to (left up v)\n    end\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    if <(Masked) = [1]> then\n        switch costume to (masked right up v)\n    else\n        switch costume to (right up v)\n    end\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        set [sy v] to [16]\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\n\nwhen I receive [outro v]\nhide\n\nwhen I receive [tick v]\n\nif <(Landscape: x) = [-222]> then\n    set [level v] to [2]\n    wait (1) seconds\nend\n\nwhen I receive [tick v]\ngo to [front v] layer\ngo [backward v] (3) layers\n\ndefine Change Player x by (sx)\npoint in direction (90)\nchange [x v] by (sx)\nPosition\nif <<touching (platforms v)?> or <<<<touching (door 1 v)?> or <touching (door 2 v)?>> or <touching (door 3 v)?>> or <touching (door 4 v)?>>> then\n    if <(Open) = [0]> then\n        repeat (12)\n            change [y v] by (1)\n            Position\n            if <not <<touching (platforms v)?> or <<<<touching (door 1 v)?> or <touching (door 2 v)?>> or <touching (door 3 v)?>> or <touching (door 4 v)?>>>> then\n                if <(Open) = [0]> then\n                    stop [this script v]\n                end\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)?> or <<<<touching (door 1 v)?> or <touching (door 2 v)?>> or <touching (door 3 v)?>> or <touching (door 4 v)?>>>>\n            if <(Open) = [0]> then\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\n        end\n    end\nend\n\ndefine Game - win\nrepeat (50)\n    point towards (exit v)\n    move ((distance to [exit v]) / (75)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nbroadcast (Outro v)\nwait (1) seconds\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [sanitize quickly! v]\nwait (2) seconds\nif <(Sanitized?) = [0]> then\n    start sound [Hurt v]\n    set [exit v] to [die]\nend\n\nwhen I receive [tick v]\nif <touching (danger v)?> then\n    set [touching v] to [1]\nend\nif <not <touching (danger v)?>> then\n    set [touching v] to [0]\nend\n\nwhen I receive [begin v]\nset [touching v] to [0]\n\nshow\nset [ghost v] effect to (0)\nset size to (100) %\nGame - win\n\n@Instructions Button\n\nwhen I receive [tick v]\nif <<key (i v) pressed?> or <touching (mouse-pointer v)?>> then\n    repeat until <(size) > [119]>\n        change [size v] by (.9)\n        change size by (size)\n    end\n    if <(Chat) = [0]> then\n        if <touching (mouse-pointer v)?> then\n            if <mouse down?> then\n                broadcast (Instructions open v)\n                hide\n                wait until <not <mouse down?>>\n            end\n        end\n        if <key (i v) pressed?> then\n            broadcast (Instructions open v)\n            hide\n            wait until <not <mouse down?>>\n        end\n    end\nelse\n    repeat until <(size) < [101]>\n        set [size v] to [-.8]\n        change [size v] by (-.9)\n        change size by (size)\n    end\nend\n\nwhen I receive [instructions 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]\nset [size v] to [.8]\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: (165) y: (-156)\ngo to [front v] layer\nset size to (100) %\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Instructions\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [instructions open v]\nset [instructions v] to [1]\n\nwhen I receive [instructions close v]\nset [instructions v] to [0]\n\nwhen I receive [tick v]\nif <(Chat) = [0]> then\n    if <(Instructions) = [1]> then\n        go to [front v] layer\n        switch costume to (general instructions v)\n        show\n        if <<key (1 v) pressed?> or <(Page Change) = [3]>> then\n            switch costume to (general instructions v)\n        end\n        if <<key (2 v) pressed?> or <(Page Change) = [1]>> then\n            switch costume to (computer instructions v)\n        end\n        if <<key (3 v) pressed?> or <(Page Change) = [2]>> then\n            switch costume to (mobile instructions v)\n        end\n    else\n        hide\n    end\nend\nif <<key (space v) pressed?> or <(close) = [1]>> then\n    if <(Instructions) = [1]> then\n        broadcast (Instructions close v)\n        hide\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [green flag v]\nset [page change v] to [0]\nhide\nswitch costume to (general instructions v)\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [page change v]\nchange [page change v] by (1)\nif <(Page Change) = [4]> then\n    set [page change v] to [1]\nend\n\nwhen I receive [tick v]\nif <(Instructions) = [0]> then\n    set [page change v] to [0]\nend\n\n@Chat\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [chat open v]\nset [chat v] to [1]\n\nwhen I receive [chat close v]\nset [chat v] to [0]\n\nwhen I receive [tick v]\nif <(Instructions) = [0]> then\n    if <(Chat) = [1]> then\n        switch costume to (chat v)\n        go to [front v] layer\n        show\n    else\n        hide\n    end\nend\nif <<key (space v) pressed?> or <(close) = [2]>> then\n    if <(Chat) = [1]> then\n        broadcast (Chat Close v)\n        hide\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Mask\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nnext costume\nPosition ((Mask: x) - (SCROLL X)) ((Mask: y) - (SCROLL Y))\nif <touching (player v)?> then\n    start sound [Collect v]\n    set [masked v] to [1]\n    set [masks v] to [1]\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [masked v] to [0]\nset [masks v] to [0]\nhide\nset [mask: x v] to [0]\nset [mask: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (mask v)\n    Clone at x: [-7] y: [125]\nend\nset [mask: x v] to [-9999999999]\n\ncreate clone of (_myself_ v)\n\nnext costume\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [mask: x v] to (x)\nset [mask: y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [reset v]\ndelete this clone\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 [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@TB\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (tb v)\ngo to [front v] layer\nset [ghost v] effect to (100)\n\nwhen I receive [outro v]\nstop all sounds\nswitch costume to (tb2 v)\nshow\nset [ghost v] effect to (0)\ngo to [front v] layer\nwait (1) seconds\nforever\n    play sound [Music - The Wistful Pixel by Yahtzei v] until done\nend\n\n@Loading\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\ngo [forward v] (213) layers\nset size to (100) %\nhide\npoint in direction (90)\nclear graphic effects\ngo to x: (0) y: (-80)\n\nwhen I receive [connecting v]\nrepeat (11)\n    create clone of (_myself_ v)\n    turn right (40) degrees\nend\n\nwhen I receive [connected v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (100)\nforever\n    repeat (20)\n        turn right (7.5) degrees\n        change [ghost v] effect by (-6)\n        change size by (1)\n    end\n    repeat (20)\n        turn right (7.5) degrees\n        change [ghost v] effect by (6)\n        change size by (-1)\n    end\nend\n\n@Joining\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nhide\n\nwhen I receive [connecting v]\nswitch costume to (pick random (1) to (5))\nshow\n\nwhen I receive [connected v]\ngo to x: (0) y: (0)\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@Thanks\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [thanks v]\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@Detector\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\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)\ngo to x: (0) y: (0)\nshow\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@Door 4\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nset [open v] to [0]\nhide\n\nwhen I receive [setup v]\nset [door 4: x v] to [0]\nset [door 4: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (close v)\n    Clone at x: [186] y: [-13]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nPosition ((Door 4: x) - (SCROLL X)) ((Door 4: y) - (SCROLL Y))\nforever\n    if <<<<(Door open mobile) = [1]> or <key (e v) pressed?>> and <(Masks) = [1]>> and <<<<<(Landscape: x) = [309]> or <(Landscape: x) = [308]>> or <(Landscape: x) = [271]>> or <<(Landscape: x) = [272]> or <(Landscape: x) = [273]>>> and <(Landscape: y) = [0]>>> then\n        forever\n            set [open v] to [1]\n            start sound [Minecraft Door Open - QuickSounds v]\n            switch costume to (open v)\n            delete this clone\n        end\n    end\n    if <(costume [name v]) = [Open]> then\n        forever\n            wait until <not <touching (player v)?>>\n            switch costume to (close v)\n            start sound [Minecraft Door Close - QuickSounds v]\n            set [open v] to [0]\n            delete this clone\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [door 4: x v] to (x)\nset [door 4: y v] to (y)\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 Position (x) (y)\ncreate clone of (_myself_ v)\nset [door 4: x v] to (x)\nset [door 4: y v] to (y)\n\n@Door 2\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nset [open v] to [0]\nhide\n\nwhen I receive [setup v]\nset [door 2: x v] to [0]\nset [door 2: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (close v)\n    Clone at x: [-58] y: [-13]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nPosition ((Door 2: x) - (SCROLL X)) ((Door 2: y) - (SCROLL Y))\nforever\n    if <<<(Door open mobile) = [1]> or <key (e v) pressed?>> and <<<<(Landscape: x) = [480]> or <(Landscape: x) = [480]>> and <(Landscape: y) = [0]>> and <<<(x) = [-36]> or <<(x) = [-37]> or <<(x) = [-72]> or <(x) = [-35]>>>> or <(x) = [-73]>>>> then\n        forever\n            set [open v] to [1]\n            start sound [Minecraft Door Open - QuickSounds v]\n            switch costume to (open v)\n            delete this clone\n        end\n    end\n    if <(costume [name v]) = [Open]> then\n        forever\n            wait until <not <touching (player v)?>>\n            switch costume to (close v)\n            start sound [Minecraft Door Close - QuickSounds v]\n            set [open v] to [0]\n            delete this clone\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [door 2: x v] to (x)\nset [door 2: y v] to (y)\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 Position (x) (y)\ncreate clone of (_myself_ v)\nset [door 2: x v] to (x)\nset [door 2: y v] to (y)\n\n@House from level 1\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\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]\nshow\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: [480] y: [0]\n    Clone at x: [480] y: [0]\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\nnext costume\nnext costume\n\ncreate clone of (_myself_ v)\n\nwhen I receive [green flag v]\ngo to [back v] layer\n\n@Door 1\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nset [open v] to [0]\nhide\n\nwhen I receive [setup v]\nset [door 1: x v] to [0]\nset [door 1: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (close v)\n    Clone at x: [72] y: [-13]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nPosition ((Door 1: x) - (SCROLL X)) ((Door 1: y) - (SCROLL Y))\nforever\n    if <<<(Door open mobile) = [1]> or <key (e v) pressed?>> and <<<<(Landscape: x) = [423]> or <(Landscape: x) = [422]>> and <(Landscape: y) = [0]>> or <<<<(Landscape: x) = [387]> and <(Landscape: y) = [0]>> or <<(Landscape: x) = [386]> or <(Landscape: x) = [385]>>> and <(Landscape: y) = [0]>>>> then\n        forever\n            set [open v] to [1]\n            start sound [Minecraft Door Open - QuickSounds v]\n            switch costume to (open v)\n            delete this clone\n        end\n    end\n    if <(costume [name v]) = [Open]> then\n        forever\n            wait until <not <touching (player v)?>>\n            switch costume to (close v)\n            start sound [Minecraft Door Close - QuickSounds v]\n            set [open v] to [0]\n            set [door close mobile v] to [1]\n            delete this clone\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [door 1: x v] to (x)\nset [door 1: y v] to (y)\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 Position (x) (y)\ncreate clone of (_myself_ v)\nset [door 1: x v] to (x)\nset [door 1: y v] to (y)\n\n@Door 3\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nset [open v] to [0]\nhide\n\nwhen I receive [setup v]\nset [door 3: x v] to [0]\nset [door 3: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (close v)\n    Clone at x: [108] y: [90]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nPosition ((Door 3: x) - (SCROLL X)) ((Door 3: y) - (SCROLL Y))\nforever\n    if <<<(Door open mobile) = [1]> or <key (e v) pressed?>> and <<<(Landscape: x) = [387]> or <<(Landscape: x) = [349]> or <(Landscape: x) = [350]>>> and <<(Landscape: y) = [-81]> or <(Landscape: y) = [-82]>>>> then\n        forever\n            set [open v] to [1]\n            start sound [Minecraft Door Open - QuickSounds v]\n            switch costume to (open v)\n            delete this clone\n        end\n    end\n    if <(costume [name v]) = [Open]> then\n        forever\n            wait until <not <touching (player v)?>>\n            switch costume to (close v)\n            start sound [Minecraft Door Close - QuickSounds v]\n            set [open v] to [0]\n            delete this clone\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [door 3: x v] to (x)\nset [door 3: y v] to (y)\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 Position (x) (y)\ncreate clone of (_myself_ v)\nset [door 3: x v] to (x)\nset [door 3: y v] to (y)\n\n@Picture\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nset size to (175) %\nset [toggle v] to [0]\nset [open v] to [0]\nhide\n\nwhen I receive [setup v]\nset [picture: x v] to [0]\nset [picture: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (close v)\n    Clone at x: [120] y: [20]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nPosition ((Picture: x) - (SCROLL X)) ((Picture: y) - (SCROLL Y))\nforever\n    if <<<(Zoom in pic mobile) = [1]> or <key (z v) pressed?>> and <touching (player v)?>> then\n        forever\n            set [toggle v] to [1]\n            switch costume to (picture v)\n            go to [front v] layer\n            go [backward v] (10) layers\n            show\n            set [toggle v] to [0]\n            delete this clone\n        end\n    end\n    if <(Toggle) = [0]> then\n        forever\n            hide\n            switch costume to (picture v)\n            set [toggle v] to [0]\n            delete this clone\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [picture: x v] to (x)\nset [picture: y v] to (y)\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 Position (x) (y)\ncreate clone of (_myself_ v)\nset [picture: x v] to (x)\nset [picture: y v] to (y)\n\nset [zoom out pic mobile v] to [0]\n\n@Open / close door\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [tick v]\nif <touching (mouse-pointer v)?> then\n    repeat until <(size) > [119]>\n        change [size v] by (.9)\n        change size by (size)\n    end\n    if <<(Door open mobile) = [0]> and <mouse down?>> then\n        set [door open mobile v] to [1]\n        switch costume to (close door v)\n        wait until <not <mouse down?>>\n    end\n    if <<(Door open mobile) = [1]> and <mouse down?>> then\n        set [door open mobile v] to [0]\n        switch costume to (open door v)\n        wait until <not <mouse down?>>\n    end\nelse\n    repeat until <(size) < [101]>\n        set [size v] to [-.8]\n        change [size v] by (-.9)\n        change size by (size)\n    end\nend\n\nwhen I receive [instructions 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]\nswitch costume to (open door v)\nset [size v] to [.8]\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\nset [door open mobile v] to [0]\nset [door close mobile v] to [1]\ngo to x: (170) y: (155)\ngo to [front v] layer\nset size to (100) %\n\n@Chat Button\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [tick v]\nif <<key (t v) pressed?> or <touching (mouse-pointer v)?>> then\n    repeat until <(size) > [119]>\n        change [size v] by (.9)\n        change size by (size)\n    end\n    if <(Instructions) = [0]> then\n        if <touching (mouse-pointer v)?> then\n            if <mouse down?> then\n                broadcast (Chat Open v)\n                hide\n                wait until <not <mouse down?>>\n            end\n        end\n        if <key (t v) pressed?> then\n            broadcast (Chat Open v)\n            hide\n            wait until <not <mouse down?>>\n        end\n    end\nelse\n    repeat until <(size) < [101]>\n        set [size v] to [-.8]\n        change [size v] by (-.9)\n        change size by (size)\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]\nset [size v] to [.8]\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\n@Zoom in pic\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [tick v]\nif <touching (mouse-pointer v)?> then\n    repeat until <(size) > [119]>\n        change [size v] by (.9)\n        change size by (size)\n    end\n    if <<(Zoom in pic mobile) = [0]> and <mouse down?>> then\n        set [zoom in pic mobile v] to [1]\n        switch costume to (zoom out v)\n        wait until <not <mouse down?>>\n    end\n    if <<(Zoom in pic mobile) = [1]> and <mouse down?>> then\n        set [zoom in pic mobile v] to [0]\n        switch costume to (zoom in v)\n        wait until <not <mouse down?>>\n    end\nelse\n    repeat until <(size) < [101]>\n        set [size v] to [-.8]\n        change [size v] by (-.9)\n        change size by (size)\n    end\nend\n\nwhen I receive [instructions 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]\nswitch costume to (zoom in v)\nset [size v] to [.8]\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\nset [zoom in pic mobile v] to [0]\nset [zoom out pic mobile v] to [1]\ngo to x: (-160) y: (155)\ngo to [front v] layer\nset size to (100) %\n\n@Love fave\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\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\n@Exit\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nswitch costume to (open v)\nPosition ((Exit: x) - (SCROLL X)) ((Exit: y) - (SCROLL Y))\nif <<touching (player v)?> and <(costume [number v]) = [1]>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nset [masked v] to [0]\nset [exit: x v] to [0]\nset [exit: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (open v)\n    Clone at x: [2000] y: [0]\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)\nset [exit: x v] to (x)\nset [exit: y v] to (y)\n\nshow\n\nset [masks v] to [1]\nset [masked v] to [1]\n\n@DANGER\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\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: [500] y: [-15]\n    switch costume to (level 1 2 v)\n    Clone at x: [200] y: [0]\n    switch costume to (level 1 3 v)\n    Clone at x: [500] y: [-5]\n    switch costume to (level 1 4 v)\n    Clone at x: [400] y: [-5]\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)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\ncreate clone of (_myself_ v)\n\n@Music block\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nset [no mus v] to [0]\nset size to (70) %\nhide\n\nwhen I start as a clone\nshow\nforever\n    if <<touching (mouse-pointer v)?> or <<touching (mouse-pointer v)?> and <mouse down?>>> then\n        broadcast (reverse! v)\n        change [music v] by (1)\n        if <(Music) = [6]> then\n            set [music v] to [1]\n        end\n        if <(Music) = [7]> then\n            if <<(pick random (1) to (50)) = [1]> and <(no mus) = [1]>> then\n                broadcast (e 1 v)\n            else\n                set [music v] to [1]\n            end\n            if <(no mus) = [0]> then\n                set [no mus v] to [1]\n            end\n        end\n        broadcast (music swap v)\n        repeat (5)\n            change size by (3)\n            turn right ((360) / (10)) degrees\n        end\n        repeat (5)\n            change size by (-3)\n            turn right ((360) / (10)) degrees\n        end\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(delete clones) = [1]> then\n        delete this clone\n    end\nend\n\nwhen I receive [begin v]\ncreate clone of (_myself_ v)\ngo to x: (200) y: (100)\n\n@Sanitizer\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nset size to (70) %\nhide\n\nwhen I start as a clone\nset size to (30) %\nshow\nforever\n    if <<touching (mouse-pointer v)?> or <<touching (mouse-pointer v)?> and <mouse down?>>> then\n        set [sanitized? v] to [1]\n        broadcast (Sanitized! v)\n        point in direction (90)\n        repeat (5)\n            change size by (3)\n            turn right ((50) / (10)) degrees\n        end\n        repeat (5)\n            change size by (-3)\n            turn left ((100) / (10)) degrees\n        end\n        repeat (5)\n            turn right ((50) / (10)) degrees\n        end\n        wait until <not <touching (mouse-pointer v)?>>\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(delete clones) = [1]> then\n        delete this clone\n    end\nend\n\nwhen I receive [begin v]\nset [sanitized? v] to [0]\ncreate clone of (_myself_ v)\ngo to x: (200) y: (0)\n\n@Sure?\n\ndefine Leave?\nset size to (250) %\nswitch costume to (yes v)\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nCloning\nrepeat until <(round (size)) = [100]>\n    change [ghost v] effect by (-10)\n    change size by (((100) - (size)) / (5))\nend\n\ndefine Cloning\nset [———— v] to [1]\nrepeat (2)\n    create clone of (_myself_ v)\n    set [———— v] to [1]\n    next costume\nend\n\nwhen I start as a clone\nset size to (250) %\ngo to [front v] layer\nrepeat until <(round (size)) = [100]>\n    change [ghost v] effect by (-10)\n    change size by (((100) - (size)) / (5))\nend\nrepeat until <not <(Left?) = [Pending]>>\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-10)\n        if <mouse down?> then\n            start sound [CLICK v]\n            if <(costume [name v]) = [Yes]> then\n                set [left? v] to [Yes]\n                broadcast (Outro v)\n            else\n                set [left? v] to [No]\n            end\n        end\n    else\n        clear graphic effects\n    end\nend\nrepeat until <(round (size)) = [200]>\n    change [ghost v] effect by (20)\n    change size by (((200) - (size)) / (5))\nend\ndelete this clone\n\nwhen I receive [intro done v]\nwait (2) seconds\nhide\nforever\n    set [! v] to <<(mouse y) > [160]> and <[-100] > (mouse x)>>\n    if <<(mouse y) > [179]> and <<(mouse x) > [-220]> and <[-180] > (mouse x)>>> then\n        set [left? v] to [Pending]\n        Leave?\n        wait until <not <(Left?) = [Pending]>>\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nbroadcast (Intro done v)\n\n@Sanitize quickly!\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [sanitize quickly! v]\nif <(Touching) = [1]> then\n    wait until <(Touching) = [0]>\n    set [costume v] to [0]\n    hide\n    switch costume to (costume2 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    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@1, 2, boom?\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [sanitize quickly! v]\nhide\nswitch costume to (1 v)\nset size to (0) %\nif <(Touching) = [1]> then\n    wait until <(Touching) = [0]>\n    repeat (2)\n        if <(Sanitized?) = [0]> then\n            show\n            Zoom\n            hide\n            wait (0.5) seconds\n        end\n    end\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nhide\n\nwhen I receive [reset v]\nswitch costume to (1 v)\nhide\n\ndefine Zoom\nstart sound [pop v]\nrepeat (10)\n    change size by (10)\nend\nrepeat (10)\n    change size by (-10)\nend\nswitch costume to (2 v)\n\n@Sanitized!\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [sanitized! v]\nset [costume v] to [0]\nhide\nswitch costume to (costume1 v)\ngo to x: (0) 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 (-1)\nend\nwait (2) seconds\nrepeat (15)\n    change y by (7)\nend\nhide\nif <(Costume) > [0]> then\n    hide\n    stop [this script v]\nend\n\nwhen flag clicked\nhide\n\n@Music\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [music swap v]\nhide\nswitch costume to (Music)\nshow\ngo to [front v] layer\ngo to x: (-90) y: (50)\nrepeat (9)\n    change x by (6)\nend\nrepeat (5)\n    change x by (-3)\nend\nrepeat (5)\n    change x by (1)\nend\nwait (2) seconds\nrepeat (23)\n    change x by (-10)\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nhide\nswitch costume to (puzzle parlour v)\nshow\ngo to [front v] layer\ngo to x: (-90) y: (50)\nrepeat (9)\n    change x by (6)\nend\nrepeat (5)\n    change x by (-3)\nend\nrepeat (5)\n    change x by (1)\nend\nwait (2) seconds\nrepeat (23)\n    change x by (-10)\nend\nhide\n\n@Instructions Arrow\n\nwhen I receive [tick v]\nif <(Instructions) = [1]> then\n    show\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) > [119]>\n            change [size v] by (.9)\n            change size by (size)\n        end\n        if <(Chat) = [0]> then\n            if <mouse down?> then\n                broadcast (Page change v)\n                wait until <not <mouse down?>>\n            end\n        end\n    else\n        repeat until <(size) < [101]>\n            set [size v] to [-.8]\n            change [size v] by (-.9)\n            change size by (size)\n        end\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nhide\ngo to [front v] layer\ngo to x: (120) y: (-90)\n\nwhen flag clicked\nset [instructions v] to [0]\nset [chat v] to [0]\nhide\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [tick v]\nif <(Instructions) = [1]> then\n    show\nend\nif <(Instructions) = [0]> then\n    hide\nend\n\n@Chat close button\n\nwhen I receive [tick v]\nif <(Chat) = [1]> then\n    show\nend\nif <(Chat) = [0]> then\n    hide\nend\n\nwhen I receive [tick v]\nif <(Chat) = [1]> then\n    show\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) > [119]>\n            change [size v] by (.9)\n            change size by (size)\n        end\n        if <mouse down?> then\n            set [close v] to [2]\n            wait until <not <mouse down?>>\n        end\n    else\n        repeat until <(size) < [101]>\n            set [size v] to [-.8]\n            change [size v] by (-.9)\n            change size by (size)\n        end\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nhide\ngo to [front v] layer\ngo to x: (150) y: (100)\n\nwhen flag clicked\nset [instructions v] to [0]\nset [chat v] to [0]\nhide\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Instructions close button\n\nwhen I receive [tick v]\nif <(Instructions) = [1]> then\n    show\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) > [119]>\n            change [size v] by (.9)\n            change size by (size)\n        end\n        if <mouse down?> then\n            set [close v] to [1]\n            wait until <not <mouse down?>>\n        end\n    else\n        repeat until <(size) < [101]>\n            set [size v] to [-.8]\n            change [size v] by (-.9)\n            change size by (size)\n        end\n    end\nend\n\nwhen flag clicked\nset [close v] to [0]\nset [ghost v] effect to (0)\nhide\ngo to [front v] layer\ngo to x: (135) y: (100)\n\nwhen flag clicked\nset [instructions v] to [0]\nset [chat v] to [0]\nhide\n\nwhen I receive [outro v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [tick v]\nif <(Instructions) = [1]> then\n    show\nend\nif <(Instructions) = [0]> then\n    hide\nend\n\n