MINECRAFT PLATFORMER
@Stage\n\nwhen flag clicked\nswitch backdrop to (menu v)\nforever\n    play sound [This is Halloween  v] until done\nend\n\nwhen I receive [begin v]\nswitch backdrop to (play v)\n\n@1\n\n@player\n\ndefine Chat\nif <(OpenChat?) = [true]> then\n    if <key (1 v) pressed?> then\n        set [chat v] to [1]\n        say (item (Chat) of [chat v])\n        wait (2) seconds\n        say []\n        set [chat v] to [0]\n    else\n        if <key (2 v) pressed?> then\n            set [chat v] to [2]\n            say (item (Chat) of [chat v])\n            wait (2) seconds\n            say []\n            set [chat v] to [0]\n        else\n            if <key (3 v) pressed?> then\n                set [chat v] to [3]\n                say (item (Chat) 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 v] to [4]\n                    say (item (Chat) of [chat v])\n                    wait (2) seconds\n                    say []\n                    set [chat v] to [0]\n                else\n                    if <key (5 v) pressed?> then\n                        set [chat v] to [5]\n                        say (item (Chat) of [chat v])\n                        wait (2) seconds\n                        say []\n                        set [chat v] to [0]\n                    else\n                        if <key (6 v) pressed?> then\n                            set [chat v] to [6]\n                            say (item (Chat) of [chat v])\n                            wait (2) seconds\n                            say []\n                            set [chat v] to [0]\n                        else\n                            if <key (7 v) pressed?> then\n                                set [chat v] to [7]\n                                say (item (Chat) of [chat v])\n                                wait (2) seconds\n                                say []\n                                set [chat v] to [0]\n                            else\n                                if <key (8 v) pressed?> then\n                                    set [chat v] to [8]\n                                    say (item (Chat) of [chat v])\n                                    wait (2) seconds\n                                    say []\n                                    set [chat v] to [0]\n                                else\n                                    if <key (9 v) pressed?> then\n                                        set [chat v] to [9]\n                                        say (item (Chat) of [chat v])\n                                        wait (2) seconds\n                                        say []\n                                        set [chat v] to [0]\n                                    else\n                                        set [chat v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nwhen flag clicked\nset [scroll y v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nbroadcast (GREEN FLAG v) and wait\nbroadcast (PLAY GAME v) and wait\nswitch costume to (pick random (1) to (6))\n\ndefine CHANGE PLAYER Y BY (sy)\nchange [y v] by (sy)\nchange [inair v] by (1)\nPosition\nrepeat until <not <touching (platform v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [inair v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine GAME ON\nhide\nset [x v] to (Spawn_X)\nset [y v] to (Spawn_Y)\nset [scroll x v] to (Spawn_X)\nset [scroll y v] to (Spawn_Y)\nset [sy v] to [0]\nset [sx v] to [0]\nset [inair v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\ndefine TICK\nif <(MINI_MAP) = [false]> then\n    if <touching (mouse-pointer v)?> then\n        set [playertouching v] to [1]\n    else\n        set [playertouching v] to [0]\n    end\n    set rotation style [left-right v]\n    if <<<(mouse x) < (x position)> and <<mouse down?> and <not <touching (mouse-pointer v)?>>>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n        point in direction (-90)\n        change [sx v] by (-2)\n    end\n    if <<<(x position) < (mouse x)> and <<mouse down?> and <not <touching (mouse-pointer v)?>>>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n        point in direction (90)\n        change [sx v] by (2)\n    end\n    set [sx v] to ((SX) * (0.8))\n    if <[0.9] < ([abs v] of (SX) )> then\n        CHANGE PLAYER X By (round (SX))\n    end\n    if <<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        if <(inair) < [4]> then\n            set [sy v] to [16]\n        end\n    end\n    if <(SY) > [-20]> then\n        change [sy v] by (-2)\n    end\n    CHANGE PLAYER Y BY (SY)\n    TEST-DIE\n    change [scroll x v] by (round (((x) - (SCROLL X)) / (8)))\n    if <(SCROLL X) < [0]> then\n        set [scroll x v] to [0]\n    end\n    if <[2600] < (SCROLL X)> then\n        set [scroll x v] to [2600]\n    end\n    change [scroll y v] by (round (((y) - (SCROLL Y)) / (8)))\n    if <(SCROLL Y) < [0]> then\n        set [scroll y v] to [0]\n    end\n    Position\n    if <(y) < [-175]> then\n        set [exit v] to [die]\n    end\nend\n\ndefine GAME - DIE\nset [exit v] to []\nhide\n\ndefine TEST-DIE\nif <<touching (dangers  v)?> or <<touching (moving enemies v)?> and <not <[dead moving enemies v] contains (My Die ID)?>>>> then\n    set [exit v] to [die]\n    start sound [Crunch v]\nend\n\ndefine CHANGE PLAYER X By (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platform v)?> then\n    repeat (18)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-18)\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 [inair v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platform 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\nswitch costume to (pick random (1) to (6))\nset [max players v] to [8]\nset [my player # v] to [0]\nbroadcast (setups v) and wait\nbroadcast (joining v)\nbroadcast (join game v) and wait\nif <(My Player #) > [0]> then\n    broadcast (joined v)\nelse\n    broadcast (full v)\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]\nset [level v] to [1]\nforever\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        if <(My Player #) > [0]> then\n            send cloud data\n        end\n    end\n    if <(EXIT) = [win]> then\n        Game-Win\n    else\n        GAME - DIE\n    end\nend\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                            end\n                        end\n                    end\n                end\n            end\n        end\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 (direction) to encoded\nwrite (costume [number v]) to encoded\nwrite (Chat) to encoded\nset cloud # (My Player #) to (encoded)\n\nwhen I receive [begin v]\nwait (5) seconds\n\ndefine Game-Win\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)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\n\nwhen I receive [begin v]\nforever\n    if <(x) > [2750]> then\n        if <(y) < [1800]> then\n            if <(y) > [1660]> then\n                wait (0.3) seconds\n                broadcast (YOU WIN v)\n            end\n        end\n    end\nend\n\nwhen I receive [you win v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [close mini map v]\ngo to [front v] layer\n\nwhen I receive [open map v]\ngo to [back v] layer\n\nwhen I receive [close achievements v]\ngo to [front v] layer\n\nwhen I receive [achievements v]\ngo to [back v] layer\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\n    if <key (right arrow v) pressed?> then\n        change x by (-5)\n    end\n    if <key (left arrow v) pressed?> then\n        change x by (5)\n    end\n    if <key (up arrow v) pressed?> then\n        change y by (-5)\n    end\nend\ndelete this clone\n\nwhen I receive [begin v]\nforever\n    Chat\nend\n\nwhen flag clicked\ndelete all of [chat v]\nadd [Hi!!!] to [chat v]\nadd [Bye!!!] to [chat v]\nadd [Where is the Castle?] to [chat v]\nadd [Where is the Church?] to [chat v]\nadd [Where is are the Houses?] to [chat v]\nadd [Where is the Hotel?] to [chat v]\nadd [Where is the Sword in The Stone?] to [chat v]\nadd [Where are the Hooded Creatures] to [chat v]\nadd [Come with me] to [chat v]\n\n@opponents\n\ndefine Decode chat (chat)\nif <(chat) = [0]> then\n\ndefine begin decode of (encode)\nset [encodied v] to (encode)\nset [letter # v] to [1]\n\ndefine value=read from encode\nset [value v] to []\nforever\n    set [idx v] to (join (letter (letter #) of (encodied)) (letter ((letter #) + (1)) of (encodied)))\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\ndefine setup players\nswitch costume to (pick random (1) to (6))\nset [color v] effect to (90)\nset [offline v] to [100]\nhide\nset [player # v] to [1]\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    change [player # v] by (1)\nend\n\nwhen I receive [begin v]\nforever\n    if <(My Player #) = (player #)> then\n        hide\n        set [offline v] to [100]\n    else\n        if <(Online) = [true]> then\n            tick\n        end\n    end\n    go to [back v] layer\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                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [setups v]\nsetup players\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 encode\nif <(names) = [1]> then\n    say (join (player #) (join [:] (value)))\nelse\n    say []\nend\nvalue=read from encode\nvalue=read from encode\nset x to ((value) - (SCROLL X))\nvalue=read from encode\nset y to ((value) - (SCROLL Y))\nvalue=read from encode\nset rotation style [left-right v]\npoint in direction (value)\nvalue=read from encode\nswitch costume to (value)\nvalue=read from encode\nbroadcast (Decode Chat v)\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\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 [decode chat v]\nDecode chat (value)\n\nif <(Online) = [true]> then\n\n@mini map\n\nwhen I receive [tick v]\nif <(MINI_MAP) = [true]> then\n    position ((((x) - (SCROLL X)) / (10)) - (50)) ((((y) - (SCROLL Y)) / (10)) - (50))\n    go to [front v] layer\nelse\n    hide\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) (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [close mini map v]\ndelete this clone\n\nwhen flag clicked\nswitch costume to (level 1 1 v)\nset size to (10) %\nhide\ndelete this clone\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <(costume [number v]) = [18]> then\n        if <(collected) = (treats)> then\n            delete this clone\n        end\n    end\n    go to [front v] layer\nend\n\nwhen I receive [open map v]\ngo to [front v] layer\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\nclone At [570] [0]\nclone At [1300] [0]\nclone At [1800] [0]\nclone At [2400] [0]\nclone At [1300] [500]\nclone At [700] [900]\nclone At [100] [900]\nclone At [1700] [1100]\nclone At [2200] [1100]\nclone At [2600] [1500]\nclone At [650] [1600]\nclone At [700] [2000]\nclone At [1270] [2210]\nclone At [2120] [2450]\nclone At [2120] [2500]\nclone At [2470] [1700]\nclone At [2470] [1700]\nclone At [2470] [1700]\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@PLATFORM\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\nclone At [570] [0]\nclone At [1300] [0]\nclone At [1800] [0]\nclone At [2400] [0]\nclone At [1300] [500]\nclone At [700] [900]\nclone At [100] [900]\nclone At [1700] [1100]\nclone At [2200] [1100]\nclone At [2600] [1500]\nclone At [650] [1600]\nclone At [700] [2000]\nclone At [1270] [2210]\nclone At [2120] [2450]\nclone At [2120] [2500]\nclone At [2470] [1700]\nclone At [2470] [1700]\nclone At [2470] [1700]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine clone At (x) (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\ndelete this clone\n\nwhen I start as a clone\ngo [backward v] (1) layers\nforever\n    if <(costume [number v]) = [18]> then\n        if <(collected) = (treats)> then\n            if <(length of [completed achievements v]) = [6]> then\n                delete this clone\n            end\n        end\n    end\nend\n\n@DANGER deor\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPOSTION ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [clone id v] to [0]\ngo to [back v] layer\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone At [100] [-32]\nClone At [300] [-32]\nClone At [630] [90]\nClone At [880] [230]\nClone At [1020] [100]\nClone At [1080] [100]\nClone At [1450] [190]\nClone At [1240] [290]\nClone At [1450] [382]\nClone At [1580] [105]\nClone At [1980] [105]\nClone At [2380] [25]\nClone At [1042] [628]\nClone At [1060] [844]\nClone At [780] [874]\nClone At [310] [874]\nClone At [2310] [1040]\nClone At [510] [1141]\nClone At [690] [1250]\nClone At [520] [1465]\nClone At [520] [1660]\nClone At [370] [1840]\nClone At [740] [1985]\nClone At [980] [2050]\nClone At [1100] [2105]\nClone At [1215] [2145]\nClone At [1640] [2500]\n\ndefine POSTION (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) (y)\nchange [clone id v] by (1)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\ncreate clone of (_myself_ v)\nset [x v] to [-9999]\n\nwhen I start as a clone\ngo to [front v] layer\ngo [backward v] (100) layers\n\nwhen I start as a clone\nswitch costume to (1 v)\nforever\n    if <(Clone ID) = (zombie die)> then\n        switch costume to (1 v)\n        repeat (7)\n            next costume\n        end\n        switch costume to (1 v)\n        stop [this script v]\n    end\nend\n\n@DANGERs \n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPOSTION ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [clone id v] to [0]\ngo to [back v] layer\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone At [100] [-32]\nClone At [300] [-32]\nClone At [630] [90]\nClone At [880] [230]\nClone At [1020] [100]\nClone At [1080] [100]\nClone At [1450] [190]\nClone At [1240] [290]\nClone At [1450] [382]\nClone At [1580] [105]\nClone At [1980] [105]\nClone At [2380] [25]\nClone At [1042] [628]\nClone At [1060] [844]\nClone At [780] [874]\nClone At [310] [874]\nClone At [2310] [1040]\nClone At [510] [1141]\nClone At [690] [1250]\nClone At [520] [1465]\nClone At [520] [1660]\nClone At [370] [1840]\nClone At [740] [1985]\nClone At [980] [2050]\nClone At [1100] [2105]\nClone At [1215] [2145]\nClone At [1640] [2500]\n\ndefine POSTION (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) (y)\nchange [clone id v] by (1)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\ncreate clone of (_myself_ v)\nset [x v] to [-9999]\n\nwhen I start as a clone\nswitch costume to (1 v)\nwait (pick random (0) to (1)) seconds\nshow\nforever\n    if <not <(zombie die) = (Clone ID)>> then\n        switch costume to (1 v)\n        repeat (5)\n            next costume\n        end\n        wait (1) seconds\n        repeat (5)\n            switch costume to ((costume [number v]) - (1))\n        end\n        switch costume to (1 v)\n        wait (1) seconds\n    end\nend\n\nwhen I start as a clone\nset [zombie die v] to [0]\nforever\n    if <touching (sword from stone v)?> then\n        set [zombie die v] to (Clone ID)\n        repeat until <(costume [number v]) = [1]>\n            switch costume to ((costume [number v]) - (1))\n            wait (0.08) seconds\n        end\n        delete this clone\n    end\nend\n\n@Haunted Buildings\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (blank v)\nclone At [2400] [0]\nclone At [2400] [0]\nclone At [43] [1050]\nclone At [43] [1050]\nclone At [1770] [1178]\nclone At [1770] [1178]\nclone At [2040] [1915]\nclone At [2040] [1915]\nclone At [2600] [2980]\nclone At [2600] [2980]\nset [x v] to [-99999999]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine clone At (x) (y)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <<<(costume [number v]) = [3]> or <(costume [number v]) = [5]>> or <<(costume [number v]) = [7]> or <(costume [number v]) = [9]>>> then\n        if <touching (player v)?> then\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            set [ghost v] effect to (100)\n        else\n            repeat (20)\n                change [ghost v] effect by (-5)\n            end\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        if <(costume [number v]) = [3]> then\n            if <[achievements v] contains [castle]?> then\n                if <not <[completed achievements v] contains [castle]?>> then\n                    add [castle] to [completed achievements v]\n                end\n            end\n        end\n        if <(costume [number v]) = [5]> then\n            if <[achievements v] contains [church]?> then\n                if <not <[completed achievements v] contains [church]?>> then\n                    add [church] to [completed achievements v]\n                end\n            end\n        end\n        if <(costume [number v]) = [7]> then\n            if <[achievements v] contains [houses]?> then\n                if <not <[completed achievements v] contains [houses]?>> then\n                    add [houses] to [completed achievements v]\n                end\n            end\n        end\n        if <(costume [number v]) = [9]> then\n            if <[achievements v] contains [hotel]?> then\n                if <not <[completed achievements v] contains [hotel]?>> then\n                    add [hotel] to [completed achievements v]\n                end\n            end\n        end\n        if <(costume [number v]) = [10]> then\n            if <<key (space v) pressed?> or <mouse down?>> then\n                if <[achievements v] contains [sword from stone]?> then\n                    if <not <[completed achievements v] contains [sword from stone]?>> then\n                        add [sword from stone] to [completed achievements v]\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <[completed achievements v] contains [sword from stone]?> then\n        if <(costume [number v]) = [11]> then\n            set [ghost v] effect to (0)\n            repeat (10)\n                change [ghost v] effect by (5)\n                change y by (10)\n            end\n            hide\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <(length of [dead moving enemies v]) = [3]> then\n        if <[achievements v] contains [defeat creatures]?> then\n            if <not <[completed achievements v] contains [defeat creatures]?>> then\n                add [defeat creatures] to [completed achievements v]\n            end\n        end\n    end\nend\n\n@check points\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPOSTION ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <(costume [number v]) = [1]> then\n    if <touching (player v)?> then\n        start sound [Ding - Sound Effect \[HD\] v]\n        switch costume to (activated v)\n        set [spawn_x v] to ((x) - (10))\n        set [spawn_y v] to (y)\n        set [checkpoint v] to (#)\n    end\nend\nif <not <(CheckPoint) = (#)>> then\n    switch costume to (de-activated v)\nend\n\nwhen I receive [setup v]\nset [checkpoint v] to [0]\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [# v] to [0]\nswitch costume to (de-activated v)\nClone At [755] [155]\nClone At [1250] [525]\nClone At [2400] [1035]\nClone At [1700] [1675]\nClone At [470] [870]\nClone At [1680] [130]\nClone At [2080] [40]\nClone At [730] [1560]\nClone At [1300] [2210]\nset [x v] to [-999999]\n\ndefine POSTION (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) (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [# v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [spawn_x v] to [0]\nset [spawn_y v] to [0]\n\nwhen I receive [setup v]\ngo to [back v] layer\n\n@sweets\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPOSTION ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine POSTION (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone At (x) (y)\nchange [treats v] by (1)\nset [x v] to (x)\nset [y v] to (y)\nif <(Cloning_Group?) = [false]> then\n    switch costume to (pick random (1) to (6))\nend\ncreate clone of (_myself_ v)\nset [x v] to [-99999]\n\nwhen I receive [begin v]\nset size to (200) %\ngo to [back v] layer\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [cloning_group? v] to [false]\nswitch costume to (1 v)\nClone A Group At [-200] [-45]\nClone At [170] [-20]\nClone At [210] [-20]\nClone At [390] [70]\nClone At [530] [110]\nClone At [630] [200]\nClone At [830] [290]\nClone At [1000] [240]\nClone At [1100] [280]\nClone At [1150] [95]\nClone At [1210] [95]\nClone At [1260] [95]\nClone At [1335] [260]\nClone At [1335] [360]\nClone At [1450] [390]\nClone At [1260] [720]\nClone At [1260] [900]\nClone At [1350] [1000]\nClone At [1050] [900]\nClone At [970] [900]\nClone At [800] [950]\nClone At [670] [1100]\nClone At [310] [950]\nClone At [590] [1250]\nClone At [590] [1700]\nClone At [435] [1900]\nClone At [550] [2000]\nClone At [750] [2050]\nClone At [900] [2100]\nClone At [950] [2150]\nClone A Group At [1350] [2300]\nClone At [1550] [2550]\nClone At [1650] [2550]\nClone At [1850] [2550]\nClone A Group At [1850] [2700]\nClone At [1520] [250]\nClone At [1600] [250]\nClone At [1800] [250]\nClone At [1900] [200]\nClone At [2200] [100]\nClone At [2375] [100]\nClone A Group At [2300] [2965]\nClone At [2200] [2520]\nClone A Group At [2440] [2395]\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        change [collected v] by (1)\n        start sound [Coin v]\n        broadcast (coin v)\n        delete this clone\n    end\nend\n\ndefine Clone A Group At (x) (y)\nset [cloning_group? v] to [true]\nswitch costume to (pick random (1) to (2))\nClone At (x) (y)\nClone At (x) ((y) + (42))\nClone At (x) ((y) + (84))\nClone At (x) ((y) + (126))\nClone At ((x) + (50)) (y)\nClone At ((x) + (50)) ((y) + (42))\nClone At ((x) + (50)) ((y) + (84))\nClone At ((x) + (50)) ((y) + (126))\nClone At ((x) + (100)) (y)\nClone At ((x) + (100)) ((y) + (42))\nClone At ((x) + (100)) ((y) + (84))\nClone At ((x) + (100)) ((y) + (126))\nset [cloning_group? v] to [false]\n\nwhen flag clicked\nset [treats v] to [0]\nset [collected v] to [0]\n\n@Moving enemies\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [clone id v] to [0]\nset [x v] to [0]\nset [y v] to [0]\ndelete all of [dead moving enemies v]\nswitch costume to (1 v)\nclone At [2750] [1840]\nclone At [160] [855]\nclone At [1800] [2480]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine clone At (x) (y)\nchange [clone id v] by (1)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\ncreate clone of (_myself_ v)\nset [x v] to [-999999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\ndelete this clone\n\nwhen I start as a clone\nset size to (80) %\nswitch costume to (1 v)\nforever\n    if <not <[dead moving enemies v] contains (Clone ID)?>> then\n        set rotation style [left-right v]\n        wait (0.5) seconds\n        point in direction (90)\n        repeat (25)\n            if <not <[dead moving enemies v] contains (Clone ID)?>> then\n                change [x v] by (3)\n            else\n                point in direction (90)\n            end\n        end\n        wait (0.5) seconds\n        point in direction (-90)\n        repeat (25)\n            if <not <[dead moving enemies v] contains (Clone ID)?>> then\n                change [x v] by (-3)\n            else\n                point in direction (90)\n            end\n        end\n    else\n        point in direction (90)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (sword from stone v)?> then\n        if <not <[dead moving enemies v] contains (Clone ID)?>> then\n            set [my die id v] to (Clone ID)\n            add (Clone ID) to [dead moving enemies v]\n            point in direction (90)\n            switch costume to (1 v)\n            repeat (17)\n                next costume\n            end\n        else\n            switch costume to (14 v)\n            repeat until <(costume [number v]) = [18]>\n                next costume\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (sword from stone v)?> then\n        set [timer v] to [0]\n    else\n        change [timer v] by (1)\n        if <(timer) > [2000]> then\n            switch costume to (1 v)\n            delete (item # of (Clone ID) in [dead moving enemies v]) of [dead moving enemies v]\n        end\n    end\nend\n\n@Score\n\nwhen I start as a clone\nshow\nchange x by ((ID) * (-40))\nswitch costume to (letter ((length of (collected)) - (ID)) of (collected))\nwait (0.000001) seconds\ndelete this clone\n\nwhen I receive [begin v]\nset size to (100) %\nshow\nforever\n    set size to ((([sin v] of ((timer) * (300)) ) * (5)) + (60)) %\nend\n\nwhen I start as a clone\nset size to (100) %\nforever\n    set size to ((([sin v] of ((timer) * (300)) ) * (5)) + (60)) %\nend\n\ndefine Rest Number\nswitch costume to (0 v)\nset [id v] to [1]\ngo to x: ((join (length of (collected)) [0]) - (-150)) y: (130)\nswitch costume to (letter (length of (collected)) of (collected))\nrepeat ((length of (collected)) - (1))\n    create clone of (_myself_ v)\n    change [id v] by (1)\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\ndelete this clone\n\nwhen I receive [begin v]\nforever\n    Rest Number\nend\n\n@+1 animation\n\nwhen I receive [coin v]\ncreate clone of (_myself_ v)\nhide\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (0)\nset size to (100) %\ngo to (player v)\nif <(SX) > [0]> then\n    set [xdirection v] to [-3]\nelse\n    set [xdirection v] to [3]\nend\nrepeat (20)\n    change y by (3)\n    change x by (XDirection)\n    change size by (-3)\n    change [ghost v] effect by (5)\nend\nhide\nset [ghost v] effect to (0)\nset size to (100) %\ndelete this clone\n\n@play button\n\nwhen I receive [begin v]\nswitch costume to (blank v)\nstop [other scripts in sprite v]\n\nwhen I receive [menu v]\nclear graphic effects\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            repeat (10)\n                change [ghost v] effect by (20)\n                change [brightness v] effect by (20)\n            end\n            hide\n            broadcast (begin v)\n        end\n    end\nend\n\nwhen I receive [menu v]\nforever\n    point in direction ((([sin v] of ((timer) * (300)) ) * (5)) + (90))\nend\n\nwhen I receive [menu v]\nswitch costume to (button v)\nshow\nset size to (100) %\ngo to x: (0) y: (0)\ngo to [front v] layer\npoint in direction (90)\n\nwhen I receive [menu v]\nset [pixelate v] effect to (20)\nset [pixelate v] effect to (0)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (20)\n        repeat until <(size) = [130]>\n            change size by (5)\n        end\n    else\n        set [ghost v] effect to (0)\n        repeat until <(size) = [100]>\n            change size by (-10)\n        end\n    end\nend\n\nwhen flag clicked\nbroadcast (menu v)\n\n@moon parralax\n\nwhen I start as a clone\nshow\nclear graphic effects\nforever\n    go to x: ((((costume [number v]) - (1)) * (480)) + ((SCROLL X) / (-50))) y: ((SCROLL Y) / (-110))\n    go to [back v] layer\nend\n\ndefine Lets clone\nrepeat (10)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\nforever\n    go to [back v] layer\nend\n\nwhen I receive [begin v]\nswitch costume to (1 v)\nhide\nLets clone\nforever\n    go to [back v] layer\nend\n\n@grave yard parralax\n\nwhen I start as a clone\nshow\nclear graphic effects\nforever\n    go to [back v] layer\n    go to x: ((((costume [number v]) - (1)) * (480)) + ((SCROLL X) / (-5))) y: ((SCROLL Y) / (-11))\nend\n\nwhen I receive [begin v]\nswitch costume to (1 v)\nhide\nLets clone\n\ndefine Lets clone\nrepeat (10)\n    create clone of (_myself_ v)\n    next costume\nend\n\n@Achievments\n\nwhen I receive [begin v]\nhide\ndelete all of [achievements v]\ndelete all of [completed achievements v]\nadd [castle] to [achievements v]\nadd [church] to [achievements v]\nadd [houses] to [achievements v]\nadd [hotel] to [achievements v]\nadd [sword from stone] to [achievements v]\nadd [defeat creatures] to [achievements v]\nforever\n    if <[completed achievements v] contains [castle]?> then\n        if <[achievements v] contains [castle]?> then\n            switch costume to (castle v)\n            go to x: (-120) y: (-180)\n            set [ghost v] effect to (100)\n            repeat (10)\n                show\n                change [ghost v] effect by (-10)\n                change y by (7)\n            end\n            wait (3) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n                change y by (-7)\n            end\n            hide\n            delete (item # of [castle] in [achievements v]) of [achievements v]\n        end\n    end\n    if <[achievements v] contains [church]?> then\n        if <[completed achievements v] contains [church]?> then\n            switch costume to (church v)\n            go to x: (-120) y: (-180)\n            set [ghost v] effect to (100)\n            repeat (10)\n                show\n                change [ghost v] effect by (-10)\n                change y by (7)\n            end\n            wait (3) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n                change y by (-7)\n            end\n            hide\n            delete (item # of [church] in [achievements v]) of [achievements v]\n        end\n    end\n    if <[achievements v] contains [houses]?> then\n        if <[completed achievements v] contains [houses]?> then\n            switch costume to (houses v)\n            go to x: (-120) y: (-180)\n            set [ghost v] effect to (100)\n            repeat (10)\n                show\n                change [ghost v] effect by (-10)\n                change y by (7)\n            end\n            wait (3) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n                change y by (-7)\n            end\n            hide\n            delete (item # of [houses] in [achievements v]) of [achievements v]\n        end\n    end\n    if <[achievements v] contains [hotel]?> then\n        if <[completed achievements v] contains [hotel]?> then\n            switch costume to (hotel v)\n            go to x: (-120) y: (-180)\n            set [ghost v] effect to (100)\n            repeat (10)\n                show\n                change [ghost v] effect by (-10)\n                change y by (7)\n            end\n            wait (3) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n                change y by (-7)\n            end\n            hide\n            delete (item # of [hotel] in [achievements v]) of [achievements v]\n        end\n    end\n    if <[achievements v] contains [sword from stone]?> then\n        if <[completed achievements v] contains [sword from stone]?> then\n            switch costume to (sword from stone v)\n            go to x: (-120) y: (-180)\n            set [ghost v] effect to (100)\n            repeat (10)\n                show\n                change [ghost v] effect by (-10)\n                change y by (7)\n            end\n            wait (3) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n                change y by (-7)\n            end\n            hide\n            delete (item # of [sword from stone] in [achievements v]) of [achievements v]\n        end\n    end\n    if <[achievements v] contains [defeat creatures]?> then\n        if <[completed achievements v] contains [defeat creatures]?> then\n            switch costume to (defeat creatures v)\n            go to x: (-120) y: (-180)\n            set [ghost v] effect to (100)\n            repeat (10)\n                show\n                change [ghost v] effect by (-10)\n                change y by (7)\n            end\n            wait (3) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n                change y by (-7)\n            end\n            hide\n            delete (item # of [defeat creatures] in [achievements v]) of [achievements v]\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\n@sword from stone\n\ndefine hit\nshow\nif <([direction v] of [player v]) = [90]> then\n    switch costume to (sword v)\n    point in direction (90)\n    repeat (10)\n        go to (player v)\n        turn right (10) degrees\n    end\n    hide\nend\nif <([direction v] of [player v]) = [-90]> then\n    switch costume to (sword v)\n    point in direction (90)\n    repeat (10)\n        go to (player v)\n        turn right (-10) degrees\n    end\n    hide\nend\n\nwhen I receive [begin v]\nhide\nforever\n    if <[completed achievements v] contains [sword from stone]?> then\n        if <<key (space v) pressed?> or <<mouse down?> and <(playertouching) = [1]>>> then\n            hit\n            wait until <not <<key (space v) pressed?> or <mouse down?>>>\n        end\n    end\nend\n\nadd [sword from stone] to [completed achievements v]\n\n@you win\n\nwhen flag clicked\nswitch costume to (playing v)\ngo to [front v] layer\nclear graphic effects\nshow\ngo to x: (0) y: (0)\n\nwhen I receive [you win v]\nset [ghost v] effect to (100)\nswitch costume to (blackout v)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nset [clone id v] to [2]\ncreate clone of (_myself_ v)\nset [clone id v] to [3]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone ID) = [1]> then\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    switch costume to (writing v)\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\nelse\n    if <(Clone ID) = [2]> then\n        hide\n        set size to (50) %\n        clear graphic effects\n        go to [front v] layer\n        switch costume to (eyes v)\n        set [ghost v] effect to (100)\n        go to x: (160) y: (130)\n        show\n        forever\n            repeat (10)\n                change [ghost v] effect by (-10)\n            end\n            wait (pick random (0.05) to (2)) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            wait (pick random (0.05) to (2)) seconds\n        end\n    else\n        if <(Clone ID) = [3]> then\n            hide\n            set size to (50) %\n            clear graphic effects\n            go to [front v] layer\n            switch costume to (eyes v)\n            go [backward v] (2) layers\n            set [ghost v] effect to (100)\n            go to x: (-160) y: (-100)\n            show\n            forever\n                repeat (10)\n                    change [ghost v] effect by (-10)\n                end\n                wait (pick random (0.05) to (2)) seconds\n                repeat (10)\n                    change [ghost v] effect by (10)\n                end\n                wait (pick random (0.05) to (2)) seconds\n            end\n        end\n    end\nend\n\n@map button\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\ngo to x: (-180) y: (120)\nforever\n    point in direction ((([sin v] of ((timer) * (300)) ) * (5)) + (90))\nend\n\nwhen I receive [green flag v]\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) = [110]>\n            change size by (5)\n        end\n    else\n        repeat until <(size) = [80]>\n            change size by (-5)\n        end\n    end\nend\n\nwhen I receive [close mini map v]\nswitch costume to (select v)\nset [mini_map v] to [false]\nwait (0.2) seconds\nforever\n    switch costume to (select v)\n    set [brightness v] effect to (0)\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            change [brightness v] effect by (10)\n            broadcast (Open Map v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [open map v]\ngo to [front v] layer\nswitch costume to (exit v)\nset [mini_map v] to [true]\ncreate clone of (_myself_ v)\ngo to [front v] layer\nwait (0.2) seconds\nforever\n    go to [front v] layer\n    switch costume to (exit v)\n    set [brightness v] effect to (0)\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            change [brightness v] effect by (10)\n            broadcast (Close Mini map v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nswitch costume to (black v)\ngo to [front v] layer\ngo [backward v] (5) layers\n\nwhen I receive [close mini map v]\ndelete this clone\n\nwhen I receive [play game v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [playertouching v] to [1]\n    else\n        set [playertouching v] to [0]\n    end\nend\n\nwhen I receive [achievements v]\nswitch costume to (blank v)\ngo to x: (-500) y: (-500)\nhide\n\nwhen I receive [close achievements v]\nswitch costume to (select v)\ngo to x: (-180) y: (120)\nshow\n\nwhen I receive [you win v]\nstop [other scripts in sprite v]\nhide\ngo to [back v] layer\nswitch costume to (blank v)\n\n@player mini map\n\nwhen I receive [open map v]\nshow\nforever\n    go to [front v] layer\n    go to x: (((([x v] of [player v]) - (SCROLL X)) / (10)) - (50)) y: (((([y v] of [player v]) - (SCROLL Y)) / (10)) - (50))\nend\n\nwhen I receive [close mini map v]\nhide\nstop [other scripts in sprite v]\n\n@Achievements3\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nif <(clone ID) = [1]> then\n    switch costume to (2 v)\n    show\n    go to [front v] layer\nelse\n    if <(clone ID) = [2]> then\n        switch costume to (castle locked v)\n        show\n        go [forward v] (2) layers\n        forever\n            if <[completed achievements v] contains [castle]?> then\n                switch costume to (castle unlocked v)\n            else\n                switch costume to (castle locked v)\n            end\n            set y to (Scroll)\n            if <(y position) > [65]> then\n                hide\n            else\n                show\n            end\n        end\n    else\n        if <(clone ID) = [3]> then\n            switch costume to (church locked v)\n            show\n            go [forward v] (1) layers\n            forever\n                if <[completed achievements v] contains [church]?> then\n                    switch costume to (church unlocked v)\n                else\n                    switch costume to (church locked v)\n                end\n                set y to ((Scroll) + (-70))\n                if <(y position) > [83]> then\n                    hide\n                else\n                    show\n                end\n            end\n        else\n            if <(clone ID) = [4]> then\n                switch costume to (houses locked v)\n                show\n                go [forward v] (1) layers\n                forever\n                    if <[completed achievements v] contains [houses]?> then\n                        switch costume to (houses unlocked v)\n                    else\n                        switch costume to (houses locked v)\n                    end\n                    set y to ((Scroll) - ((2) * (70)))\n                    if <(y position) > [90]> then\n                        hide\n                    else\n                        if <[-65] > (y position)> then\n                            hide\n                        else\n                            show\n                        end\n                    end\n                end\n            else\n                if <(clone ID) = [5]> then\n                    switch costume to (hotel locked v)\n                    show\n                    go [forward v] (1) layers\n                    forever\n                        if <[completed achievements v] contains [hotel]?> then\n                            switch costume to (hotel unlocked v)\n                        else\n                            switch costume to (hotel locked v)\n                        end\n                        set y to ((Scroll) - ((3) * (70)))\n                        if <(y position) > [90]> then\n                            hide\n                        else\n                            if <[-65] > (y position)> then\n                                hide\n                            else\n                                show\n                            end\n                        end\n                    end\n                else\n                    if <(clone ID) = [6]> then\n                        switch costume to (sword stone locked v)\n                        show\n                        go [forward v] (1) layers\n                        forever\n                            if <[completed achievements v] contains [sword from stone]?> then\n                                switch costume to (sword stone unlocked v)\n                            else\n                                switch costume to (sword stone locked v)\n                            end\n                            set y to ((Scroll) - ((4) * (70)))\n                            if <(y position) > [90]> then\n                                hide\n                            else\n                                if <[-65] > (y position)> then\n                                    hide\n                                else\n                                    show\n                                end\n                            end\n                        end\n                    else\n                        if <(clone ID) = [7]> then\n                            switch costume to (defeat creatures unlocked v)\n                            show\n                            go [forward v] (1) layers\n                            forever\n                                if <[completed achievements v] contains [defeat creatures]?> then\n                                    switch costume to (defeat creatures unlocked v)\n                                else\n                                    switch costume to (defeat creatures locked v)\n                                end\n                                set y to ((Scroll) - ((5) * (70)))\n                                if <(y position) > [90]> then\n                                    hide\n                                else\n                                    if <[-65] > (y position)> then\n                                        hide\n                                    else\n                                        show\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [achievements v]\nset [mini_map v] to [true]\nswitch costume to (1 v)\nshow\ngo [forward v] (1) layers\nset [clone id v] to [1]\nrepeat (7)\n    create clone of (_myself_ v)\n    change [clone id v] by (1)\nend\n\nwhen I receive [close achievements v]\nset [mini_map v] to [false]\nhide\ndelete this clone\n\nwhen I receive [begin v]\nbroadcast (close Achievements v)\nbroadcast (Close Mini map v)\n\n@Achievements2\n\nwhen I receive [achievements v]\nshow\nset y to (45)\nset x to (5)\nforever\n    go to [front v] layer\n    set [scroll v] to ((() - ((y position) * (2.6))) + (145))\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        repeat until <not <mouse down?>>\n            go to [front v] layer\n            set y to (mouse y)\n            if <(y position) > [45]> then\n                set y to (45)\n            end\n            if <[-70] > (y position)> then\n                set y to (-69)\n            end\n            set [scroll v] to ((() - ((y position) * (2.6))) + (145))\n        end\n    end\nend\n\nwhen I receive [close achievements v]\nhide\n\n@achievements button\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\ngo to x: (-100) y: (120)\nforever\n    point in direction ((([sin v] of ((timer) * (300)) ) * (5)) + (90))\nend\n\nwhen I receive [green flag v]\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) = [110]>\n            change size by (5)\n        end\n    else\n        repeat until <(size) = [80]>\n            change size by (-5)\n        end\n    end\nend\n\nwhen I receive [close achievements v]\ngo to [front v] layer\nswitch costume to (select v)\nset [mini_map v] to [false]\nwait (0.2) seconds\nforever\n    switch costume to (select v)\n    set [brightness v] effect to (0)\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            change [brightness v] effect by (10)\n            broadcast (Achievements v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [achievements v]\nswitch costume to (exit v)\nset [mini_map v] to [true]\nwait (0.2) seconds\nforever\n    go to [front v] layer\n    switch costume to (exit v)\n    set [brightness v] effect to (0)\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            change [brightness v] effect by (10)\n            broadcast (close Achievements v)\n            stop [this script v]\n        end\n    end\n    go to [front v] layer\nend\n\nwhen I receive [play game v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [playertouching v] to [1]\n    else\n        set [playertouching v] to [0]\n    end\nend\n\nwhen I receive [close mini map v]\nswitch costume to (select v)\ngo to x: (-100) y: (120)\nshow\n\nwhen I receive [open map v]\nswitch costume to (blank v)\ngo to x: (-500) y: (500)\nhide\n\nwhen I receive [you win v]\nstop [other scripts in sprite v]\nhide\ngo to [back v] layer\nswitch costume to (blank v)\n\n@thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [begin v]\nwait (1) seconds\nforever\n    go to [front v] layer\nend\n\nwhen I receive [play game v]\nwait (1) seconds\nforever\n    go to [front v] layer\nend\n\n@chat\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [begin v]\ngo to x: (0) y: (-150)\nshow\nset [ghost v] effect to (30)\nset [openchat? v] to [false]\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\n    if <touching (mouse-pointer v)?> then\n        set [openchat? v] to [true]\n        repeat until <(y position) = [-80]>\n            change y by (10)\n        end\n    else\n        set [openchat? v] to [false]\n        repeat until <(y position) = [-280]>\n            change y by (-10)\n        end\n    end\nend\n\nwhen I receive [you win v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [close mini map v]\nshow\n\nwhen I receive [open map v]\nhide\n\nwhen I receive [close achievements v]\nshow\n\nwhen I receive [achievements v]\nhide\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\ngo to x: (200) y: (-150)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            if <(Online) = [false]> then\n                set [online v] to [true]\n            else\n                if <(Online) = [true]> then\n                    set [online v] to [false]\n                end\n            end\n            wait until <not <mouse down?>>\n        end\n    end\n    switch costume to (Online)\nend\n\n
If you liked this, please check out the second version!\n\nInstructions:\n-Use the arrow keys to move\n-Avoid lava\n-Press space to see the answers to these bad jokes\n-All of the levels are possible