WORLDS 4 - A multiplayer platformer SERVER 2

Instructions: Worlds 4 - a Multiplayer platformer\n\nWelcome to Worlds 4, my biggest project yet! Explore the Frozen World, the Hot Desert, GrassLand, Candy Wonderland, Sky, the Cave and finally the Ocean. Collect coins on your journey to buy items in the shop, which all come with special powers. Find keys to unlock doors. Finish your mission by finding the lost star.\n\nInstructions: \n-Arrow keys or drag to move\n-Avoid anything that looks nasty\n-Collect coins to buy items in the shop. There are two big coins hidden in the whole game that are worth 100 coins each\n-Bounce pads make you jump very high\n-Get keys to unlock doors\n-Find the lost star to win the game. It may be helpful to know that the lost star is hidden in the Cave, and that to get it you need to collect a key that is in Candy WonderLand

@Stage\n\nwait (0.0) seconds\n\nrepeat (10)\n\nforever\n\nwait (5) seconds\nswitch backdrop to (blue sky 2 2 v)\n\nwhen flag clicked\nswitch backdrop to (blue sky 2 2 v)\nforever\n    if <(LEVEL) = [3]> then\nend\n\nwhen [m v] key pressed\nshow variable [mouse v]\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [,  ] ((mouse y) + (SCROLL Y))))\n\nwhen flag clicked\nswitch backdrop to (blue sky 2  v)\nforever\n    if <(LEVEL) = [8]> then\n        switch backdrop to (blue sky 2  v)\n        clear graphic effects\n    end\nend\n\nforever\n\nwhen I receive [level 3 v]\nset [brightness v] effect to (90)\n\nwhen I receive [level 6 v]\nset [brightness v] effect to (0)\nswitch backdrop to (blue sky 2 3 v) and wait\n\nwhen flag clicked\nswitch backdrop to (blue sky 2  v)\nforever\n    if <(LEVEL) = [5]> then\n        clear graphic effects\n        switch backdrop to (level 3 v)\n    end\nend\n\nwhen flag clicked\nswitch backdrop to (blue sky 2  v)\nforever\n    if <(LEVEL) = [1]> then\n        clear graphic effects\n        switch backdrop to (blue sky 2 2 v)\n    end\nend\n\nwhen I receive [level 4 v]\nset [brightness v] effect to (-100)\n\nwhen flag clicked\nswitch backdrop to (blue sky 2  v)\nforever\n    if <(LEVEL) = [2]> then\n        clear graphic effects\n        switch backdrop to (blue sky 2  v)\n    end\nend\n\nwhen I receive [level 5 v]\nswitch backdrop to (blue sky 2 2 v)\nset [brightness v] effect to (0)\n\nwhen I receive [level 2 v]\nswitch backdrop to (blue sky 2  v)\n\nwhen flag clicked\nswitch backdrop to (blue sky 2  v)\nforever\n    if <(LEVEL) = [7]> then\n        switch backdrop to (backdrop1 v)\n        set [brightness v] effect to (100)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Kaled v] until done\n    play sound [Heaven and Hell - Jeremy Blake v] until done\n    play sound [Vexento - Forever v] until done\n    play sound [Heaven and Hell - Jeremy Blake v] until done\n    play sound [bensound-summer v] until done\n    play sound [Heaven and Hell - Jeremy Blake v] until done\n    play sound [mbb-beach v] until done\n    play sound [Heaven and Hell - Jeremy Blake v] until done\nend\n\nwhen flag clicked\nforever\n    if <(music on?) = [yes]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\n@blank\n\n@Cube\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nTest Die\nif  then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not > then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> and <not <touching (collectibles3 v)?>>> 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 (collectibles11 v)?> or <<touching (sprite1 v)?> or <<touching (collectibles10 v)?> or <touching (collectibles8 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\nforever\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n        if <(speed 5) < [8]> then\n            change [speed 5 v] by (0.3)\n        end\n    else\n        repeat until <(speed 5) < [-1]>\n            change [speed 5 v] by (-0.2)\n        end\n        set [speed 5 v] to [-1]\n    end\nend\n\nwhen flag clicked\nbroadcast (Flag v) and wait\nbroadcast (Play game v) and wait\n\nwhen I receive [flag v]\nset size to (100) %\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to (world)\nforever\n    broadcast (reset v) and wait\n    broadcast (setup v) and wait\n    Game on\n    repeat until <(EXIT) > []>\n        broadcast (Tick v)\n        Tick\n    end\n    if <(EXIT) = [win]> then\n        broadcast (win 2 v)\n        Game - win\n    else\n        Game - Die\n    end\nend\n\ndefine Game on\nhide\nset size to (72) %\nset [sx v] to [0]\nset [lives v] to [3]\nif <not <(costume [number v]) = [12]>> then\n    set [x v] to (last check point x)\n    set [y v] to (last checkpoint y)\nelse\n    set [x v] to [0]\n    set [y v] to [0]\nend\nset [in air v] to [0]\nset [sy v] to [0]\nset [speed x v] to [0]\nset [exit v] to []\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nclear graphic effects\nshow\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    point in direction (-90)\n    if <touching (water v)?> then\n        if <<(costume [number v]) = [3]> or <<(costume [number v]) = [7]> or <<(costume [number v]) = [8]> or <<(costume [number v]) = [9]> or <<(costume [number v]) = [10]> or <<(costume [number v]) = [11]> or <<(costume [number v]) = [12]> or <<(costume [number v]) = [17]> or <<(costume [number v]) = [19]> or <(costume [number v]) = [18]>>>>>>>>>> then\n            change [speed x v] by (-1)\n        else\n            if <<(costume [number v]) = [1]> or <<(costume [number v]) = [2]> or <<(costume [number v]) = [4]> or <<(costume [number v]) = [5]> or <<(costume [number v]) = [6]> or <<(costume [number v]) = [13]> or <<(costume [number v]) = [14]> or <<(costume [number v]) = [15]> or <(costume [number v]) = [16]>>>>>>>>> then\n                change [speed x v] by (-2)\n            else\n                change [speed x v] by (-1)\n            end\n        end\n    else\n        if <<(costume [number v]) = [3]> or <<(costume [number v]) = [7]> or <<(costume [number v]) = [8]> or <<(costume [number v]) = [9]> or <<(costume [number v]) = [10]> or <<(costume [number v]) = [11]> or <<(costume [number v]) = [12]> or <<(costume [number v]) = [17]> or <(costume [number v]) = [18]>>>>>>>>> then\n            change [speed x v] by (-2)\n        else\n            if <<(costume [number v]) = [1]> or <<(costume [number v]) = [2]> or <<(costume [number v]) = [4]> or <<(costume [number v]) = [5]> or <<(costume [number v]) = [6]> or <<(costume [number v]) = [13]> or <<(costume [number v]) = [14]> or <<(costume [number v]) = [15]> or <(costume [number v]) = [16]>>>>>>>>> then\n                change [speed x v] by (-4)\n            else\n                change [speed x v] by (-2)\n            end\n        end\n    end\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    point in direction (90)\n    if <touching (water v)?> then\n        if <<(costume [number v]) = [3]> or <<(costume [number v]) = [7]> or <<(costume [number v]) = [8]> or <<(costume [number v]) = [9]> or <<(costume [number v]) = [10]> or <<(costume [number v]) = [11]> or <<(costume [number v]) = [12]> or <<(costume [number v]) = [17]> or <(costume [number v]) = [18]>>>>>>>>> then\n            change [speed x v] by (1)\n        else\n            if <<(costume [number v]) = [1]> or <<(costume [number v]) = [2]> or <<(costume [number v]) = [4]> or <<(costume [number v]) = [5]> or <<(costume [number v]) = [6]> or <<(costume [number v]) = [13]> or <<(costume [number v]) = [14]> or <<(costume [number v]) = [15]> or <(costume [number v]) = [16]>>>>>>>>> then\n                change [speed x v] by (2)\n            else\n                change [speed x v] by (1)\n            end\n        end\n    else\n        if <<(costume [number v]) = [3]> or <<(costume [number v]) = [7]> or <<(costume [number v]) = [8]> or <<(costume [number v]) = [9]> or <<(costume [number v]) = [10]> or <<(costume [number v]) = [11]> or <<(costume [number v]) = [12]> or <<(costume [number v]) = [17]> or <(costume [number v]) = [18]>>>>>>>>> then\n            change [speed x v] by (2)\n        else\n            if <<(costume [number v]) = [1]> or <<(costume [number v]) = [2]> or <<(costume [number v]) = [4]> or <<(costume [number v]) = [5]> or <<(costume [number v]) = [6]> or <<(costume [number v]) = [13]> or <<(costume [number v]) = [14]> or <<(costume [number v]) = [15]> or <(costume [number v]) = [16]>>>>>>>>> then\n                change [speed x v] by (4)\n            else\n                change [speed x v] by (2)\n            end\n        end\n    end\nend\nset [speed x v] to ((speed x) * (0.8))\nif <([abs v] of (speed x) ) > [0.9]> then\n    Change Player x by (round (speed x))\nend\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n    if <(in air) < [4]> then\n        if <<(costume [number v]) = [1]> or <<(costume [number v]) = [2]> or <<(costume [number v]) = [3]> or <<(costume [number v]) = [4]> or <<(costume [number v]) = [5]> or <<(costume [number v]) = [6]> or <<(costume [number v]) = [11]> or <<(costume [number v]) = [12]> or <<(costume [number v]) = [17]> or <<(costume [number v]) = [19]> or <(costume [number v]) = [18]>>>>>>>>>>> then\n            set [sy v] to [16]\n        else\n            set [sy v] to [20]\n        end\n    end\nend\nif <touching (sprite1 v)?> then\nif <<touching (water v)?> or <(costume [number v]) = [18]>> then\n    set [sy v] to (speed 5)\nend\nif <touching (collectibles4 v)?> then\n    set [sy v] to [40]\nend\nif <touching (collectibles9 v)?> then\nif <touching (collectibles9 v)?> then\nif <(sy) > [-15]> then\n    change [sy v] by (-2)\nend\nif <(sy) > [0]> then\n    set [jump through v] to [yes boiz]\nelse\n    set [jump through v] to [no whyyy]\nend\nChange player y by (sy)\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL X) > [5795]> then\n    set [scroll x v] to [5795]\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 [restart]\nend\nchange [x v] by (8)\nchange [x v] by (-8)\n\nif <key (space v) pressed?> then\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nTest Die\nrepeat until <not <<touching (collectibles10 v)?> or <<touching (collectibles9 v)?> or <touching (collectibles12 v)?>>>>\n    if <not <(jump through) = [yes boiz]>> then\n        change [y v] by (1)\n        set [in air v] to [0]\n        Position\n        set [sy v] to [0]\n    else\n        stop [this script v]\n    end\nend\nrepeat until <not <<<<touching (sprite1 v)?> or <<touching (collectibles10 v)?> or <touching (collectibles8 v)?>>> or <touching (collectibles9 v)?>> or <<touching (collectibles12 v)?> or <touching (collectibles11 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 Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\n\nchange [x v] by (sx)\nPosition\nTest Die\nif <<touching (sprite1 v)?> or <<touching (collectibles10 v)?> or <touching (collectibles8 v)?>>> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <<touching (sprite1 v)?> or <<touching (collectibles10 v)?> or <touching (collectibles8 v)?>>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> 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 (sprite1 v)?> or <<touching (collectibles10 v)?> or <touching (collectibles8 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\ndefine Game - Die\nset [exit v] to []\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\n\nwait (0.5) seconds\n\nshow\n\nchange size by (-)\n\ndefine Game - win\nrepeat (50)\n    point towards (sprite3 v)\n    turn right (65) degrees\n    move ((distance to [sprite3 v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (1)\nend\nbroadcast (home screen v)\nhide\nchange [level v] by (1)\n\nif <(in air) < [4]> then\n    set [sy v] to [16]\nend\n\ndefine tick 2\n\nbroadcast (Tick v) and wait\n\nswitch costume to (cu v)\n\nwhen flag clicked\nforever\n\nif <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> or <<<mouse down?> and <(x position) > (mouse x)>> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n    if <not <<<(costume [number v]) = [9]> or <(costume [number v]) = [10]>> or <(costume [number v]) = [13]>>> then\n        if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            point in direction (90)\n        end\n        if <<key (left arrow v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>> then\n            point in direction (-90)\n        end\n    end\nelse\n    point in direction (90)\nend\n\nwhen I receive [hide home screen v]\n\nbroadcast (Flag v) and wait\nbroadcast (Play game v) and wait\n\ndefine win\nplay sound [Win v] until done\n\nwhen I receive [win 2 v]\nset volume to (100) %\nif <(EXIT) = [win]> then\n    if <(sound effects) = [on]> then\n        win\n    end\nend\n\nwhen I receive [crystal v]\nif <(sound effects) = [on]> then\n    set volume to (100) %\n    play sound [Collect v] until done\nend\n\nbroadcast (home screen v)\n\nwhen I receive [jump v]\nset [sy v] to [40]\n\nwhen flag clicked\nswitch costume to (costume10 v)\n\nwhen flag clicked\nswitch costume to (costume10 v)\n\nwhen flag clicked\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume10 v)\nclear graphic effects\n\nwhen I receive [1 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume2 v)\nclear graphic effects\n\nwhen I receive [2 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume3 v)\nclear graphic effects\n\nwhen I receive [3 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume4 v)\nclear graphic effects\n\nwhen I receive [4 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume5 v)\nclear graphic effects\n\nwhen I receive [5 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume6 v)\nclear graphic effects\n\nwhen I receive [6 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume7 v)\nclear graphic effects\n\nwhen I receive [7 v]\nset [effect 2 v] to [off]\nset [effect v] to [on]\nswitch costume to (costume8 v)\nrepeat until <(effect) = [off]>\n    change [color v] effect by (3)\nend\n\nwhen I receive [8 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume9 v)\nclear graphic effects\n\nwhen I receive [9 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume11 v)\nclear graphic effects\n\nwhen I receive [10 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume12 v)\nclear graphic effects\n\nwhen I receive [11 v]\nset [effect v] to [off]\nset [effect 2 v] to [on]\nswitch costume to (costume10 v)\nclear graphic effects\n\nwhen I receive [12 v]\nset [effect v] to [off]\nset [effect 2 v] to [off]\nswitch costume to (costume13 v)\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [11]> then\n        if <key (space v) pressed?> then\n            set [ghost v] effect to (80)\n            set [can get hurt v] to [false]\n        else\n            clear graphic effects\n            set [can get hurt v] to [true]\n        end\n    end\nend\n\nwhen I receive [jump 2  v]\nset [sy v] to [20]\n\nwhen I receive [14 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume10 v)\nclear graphic effects\n\nwhen I receive [13 v]\nset [effect 2 v] to [off]\nset [effect v] to [off]\nswitch costume to (costume1 v)\nclear graphic effects\n\nwhen flag clicked\nset [jumps v] to [0]\nforever\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n        change [jumps v] by (1)\n        wait (0.65) seconds\n    end\nend\n\nwhen flag clicked\nrepeat until <touching (collectibles v)?>\n    go to [back v] layer\n    set [last check point x v] to [0]\n    set [last checkpoint y v] to [0]\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [forward v] (1000) layers\nend\n\ngo [backward v] (0) layers\n\nif <key (up arrow v) pressed?> then\n    set [sy v] to [5]\nelse\n    set [sy v] to [-0.2]\nend\n\n\n\nwhen flag clicked\nforever\n    set [x position v] to (x)\n    set [y position v] to (y)\nend\n\nwhen flag clicked\nforever\n    if <(lives) = [0]> then\n        set [exit v] to [restart]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<(costume [number v]) = [12]> and <touching (water v)?>> or <<<touching (danger4 v)?> or <<touching (collectibles3 v)?> or <<touching (danger2 v)?> or <<touching (sprite12 v)?> and <(LEVEL) = [4]>>>>> and <not <(costume [number v]) = [12]>>>> then\n        if <(can get hurt) = [true]> then\n            broadcast (show v)\n            change [lives v] by (-1)\n            broadcast (refresh v)\n            repeat (2)\n                set [ghost v] effect to (50)\n                wait (0.5) seconds\n                set [ghost v] effect to (0)\n                wait (0.5) seconds\n            end\n        end\n    end\n    if <not <<<(costume [number v]) = [12]> and <touching (water v)?>> or <<<touching (danger4 v)?> or <<touching (collectibles3 v)?> or <<touching (danger2 v)?> or <<touching (sprite12 v)?> and <(LEVEL) = [4]>>>>> and <not <(costume [number v]) = [12]>>>>> then\n        if <not <(costume [number v]) = [17]>> then\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\nrepeat until <not <<touching (sprite1 v)?> or <<touching (collectibles10 v)?> or <touching (collectibles8 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\nwhen flag clicked\nforever\n    if <(costume [number v]) = [3]> then\n        change [color v] effect by (3)\n    else\n        set [color v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [17]> then\n        set [can get hurt v] to [false]\n        repeat (pick random (1) to (10))\n            set [ghost v] effect to (pick random (0) to (80))\n        end\n        wait (pick random (0) to (2)) seconds\n    else\n        set [can get hurt v] to [true]\n    end\nend\n\nif <key (space v) pressed?> then\n\ndefine Test Die\n\nwhen flag clicked\nset [can get hurt v] to [true]\nset [coins v] to [0]\n\nwhen flag clicked\nset [1 v] to []\nset [2 v] to []\nset [3 v] to []\nset [4 v] to []\nset [5 v] to []\nset [6 v] to []\nset [7 v] to []\nset [8 v] to []\nset [9 v] to []\nset [10 v] to []\nset [11 v] to []\nset [12 v] to []\nset [13 v] to []\nset [14 v] to []\nset [15 v] to []\nset [16 v] to []\nset [17 v] to []\nset [18 v] to []\nset [costume # v] to [19]\nforever\n    switch costume to (costume #)\nend\n\nwhen I receive [setup v]\n\n@collectibles\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (cube v)?> then\n    if <(costume [number v]) = [1]> then\n        switch costume to (green flag2 v)\n        set [last check point x v] to (x)\n        set [last checkpoint y v] to ((y) + (10))\n    end\nend\n\nchange [checkpoint v] by (1)\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    clear graphic effects\nend\n\nwhen I start as a clone\nforever\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nchange [coins v] by (1)\nif <(coins) = (COLLECTED MAX)> then\n    broadcast (Open portal v)\nend\nbroadcast (crystal v)\ndelete this clone\n\nwhen flag clicked\nswitch costume to (green flag v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [830] y: [40]\nClone at x: [2600] y: [75]\nClone at x: [4750] y: [-60]\nClone at x: [100000] y: [75]\n\nforever\n    if <(checkpoints) = [yes]> then\nend\n\n@danger4\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume5 v)\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [forward v] (50) layers\nend\n\n@Sprite1\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume1 v)\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [0] y: [500]\nClone at x: [360] y: [-500]\nClone at x: [600] y: [500]\nClone at x: [-240] y: [-500]\nClone at x: [360] y: [0]\nClone at x: [360] y: [100]\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (100) layers\nend\n\nwhen flag clicked\nif <(costume [number v]) = [20]> then\n    forever\n        repeat (100)\n            change [y v] by (2)\n        end\n        repeat (100)\n            change [y v] by (-2)\n        end\n    end\nend\n\nClone at x: [360] y: [0]\n\n@collectibles2\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (cube v)?> then\n    if <(size) = [100]> then\n        change [coins v] by (1)\n    else\n        change [coins v] by (100)\n    end\n    delete this clone\nend\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\n\nwhen I start as a clone\nforever\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nwhen I receive [setup v]\n\nClone at x: [5700] y: [270]\nClone at x: [5700] y: [225]\nClone at x: [5650] y: [225]\nClone at x: [5650] y: [270]\n\nClone at x: [100000] y: [40]\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    next costume\nend\n\nif <not <touching (cube v)?>> then\n    switch costume to (coin v)\n    repeat (15)\n    end\nend\n\nwhen [space v] key pressed\n\ndelete this clone\n\nwhen I receive [setup v]\n\nwhen flag clicked\nset [checkpoints v] to [yes]\nswitch costume to (green flag v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [950] y: [40]\nClone at x: [1000] y: [40]\nClone at x: [1050] y: [40]\nClone at x: [1100] y: [40]\nClone at x: [1150] y: [40]\nClone at x: [1800] y: [0]\nClone at x: [1850] y: [0]\nClone at x: [1900] y: [0]\nClone at x: [1950] y: [0]\nClone at x: [2000] y: [0]\nClone at x: [2050] y: [0]\nClone at x: [2100] y: [0]\nClone at x: [2150] y: [0]\nClone at x: [2675] y: [70]\nClone at x: [2725] y: [70]\nClone at x: [2775] y: [70]\nClone at x: [2825] y: [70]\nClone at x: [2875] y: [70]\nClone at x: [4525] y: [120]\nClone at x: [4575] y: [120]\nClone at x: [4625] y: [120]\nClone at x: [4525] y: [170]\nClone at x: [4575] y: [170]\nClone at x: [4625] y: [170]\nClone at x: [4525] y: [220]\nClone at x: [4575] y: [220]\nClone at x: [4625] y: [220]\nClone at x: [4525] y: [270]\nClone at x: [4575] y: [270]\nClone at x: [4625] y: [270]\nClone at x: [4525] y: [320]\nClone at x: [4575] y: [320]\nClone at x: [4625] y: [320]\nClone at x: [1900] y: [815]\nClone at x: [1950] y: [815]\nClone at x: [2000] y: [815]\nClone at x: [3125] y: [840]\nClone at x: [3075] y: [840]\nClone at x: [3025] y: [840]\nClone at x: [2827] y: [800]\nClone at x: [2827] y: [850]\nClone at x: [2827] y: [900]\nClone at x: [2827] y: [950]\nClone at x: [2827] y: [1000]\nClone at x: [2827] y: [1050]\nClone at x: [2827] y: [1100]\nClone at x: [2827] y: [1150]\nClone at x: [5750] y: [225]\nClone at x: [5800] y: [225]\nClone at x: [5850] y: [225]\nClone at x: [5900] y: [225]\nClone at x: [5950] y: [225]\nClone at x: [5750] y: [270]\nClone at x: [5800] y: [270]\nClone at x: [5850] y: [270]\nClone at x: [5900] y: [270]\nClone at x: [5950] y: [270]\nClone at x: [325] y: [390]\nClone at x: [375] y: [390]\nClone at x: [425] y: [390]\nClone at x: [475] y: [390]\nClone at x: [525] y: [390]\nClone at x: [575] y: [390]\nClone at x: [999999] y: [390]\nClone at x: [3425] y: [155]\nClone at x: [3475] y: [185]\nClone at x: [3525] y: [215]\nClone at x: [3575] y: [245]\nClone at x: [3625] y: [275]\nClone at x: [3675] y: [305]\nClone at x: [3725] y: [334]\nClone at x: [3775] y: [363]\nClone at x: [3825] y: [392]\nClone at x: [3875] y: [421]\nClone at x: [3925] y: [450]\nClone at x: [99999999] y: [0]\nClone at x: [4535] y: [720]\nClone at x: [4585] y: [720]\nClone at x: [4635] y: [720]\nset size to (250) %\nClone at x: [4260] y: [725]\nset size to (100) %\nClone at x: [5550] y: [710]\nClone at x: [5600] y: [710]\nClone at x: [5650] y: [710]\nClone at x: [5700] y: [710]\nClone at x: [4385] y: [645]\nClone at x: [4435] y: [645]\nClone at x: [4485] y: [645]\nClone at x: [4535] y: [645]\nset size to (250) %\nClone at x: [5970] y: [715]\nClone at x: [99999999] y: [0]\n\n@collectibles4\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nswitch costume to (1 v)\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (cube v)?> then\n    repeat (8)\n        next costume\n    end\n    repeat (8)\n        switch costume to ((costume [number v]) - (1))\n    end\nend\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\n\nwhen I start as a clone\nforever\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nwhen I receive [setup v]\nset [checkpoints v] to [yes]\nswitch costume to (green flag v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [-100] y: [-65]\nClone at x: [2515] y: [60]\nClone at x: [2830] y: [730]\nClone at x: [-200] y: [380]\nClone at x: [1225] y: [510]\n\nwhen I start as a clone\nforever\n    set size to (100) %\n    next costume\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (150) layers\nend\n\n@collectibles3\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nif <touching (cube v)?> then\n    set [exit v] to [restart]\nend\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\ngo to [back v] layer\nclear graphic effects\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (40) layers\nend\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nwhen I receive [setup v]\nset [checkpoints v] to [yes]\nswitch costume to (green flag v)\ngo to [back v] layer\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [4155] y: [-90]\nClone at x: [4350] y: [5]\nClone at x: [4545] y: [-90]\nClone at x: [5020] y: [300]\nClone at x: [5220] y: [300]\nClone at x: [5320] y: [175]\nClone at x: [4920] y: [175]\nClone at x: [5020] y: [50]\nClone at x: [5220] y: [50]\nClone at x: [100000] y: [-75]\n\nClone at x: [5120] y: [175]\n\nwhen I start as a clone\nforever\n    turn right (10) degrees\nend\n\n@collectibles5\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (cube v)?> then\n    set [open 4 v] to [yes]\n    delete this clone\nend\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\n\nwhen I start as a clone\nforever\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    set size to (100) %\nend\n\nwhen flag clicked\nset [open 2 v] to [no]\nset [open 4 v] to [0]\nset [checkpoints v] to [yes]\nswitch costume to (key v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [5120] y: [175]\nClone at x: [1000000] y: [175]\n\n@collectibles6\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <(open 4) = [yes]> then\n    switch costume to (key2 v)\nelse\n    switch costume to (key v)\nend\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\n\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\n\nwhen I start as a clone\nforever\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nwhen I receive [setup v]\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    set size to (100) %\nend\n\nwhen I receive [open v]\n\nwhen flag clicked\nset [checkpoints v] to [yes]\nswitch costume to (key v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [4235] y: [195]\n\n@Sprite3\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume1 v)\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [0] y: [500]\nClone at x: [360] y: [-500]\nClone at x: [600] y: [500]\nClone at x: [-240] y: [-500]\nClone at x: [1000000] y: [0]\nClone at x: [600] y: [0]\nClone at x: [360] y: [0]\nClone at x: [999999] y: [0]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\nforever\n    go to [back v] layer\n    go [forward v] (3) layers\nend\n\nwhen [space v] key pressed\n\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [0] y: [200]\nClone at x: [999900000009] y: [0]\n\n@Sprite2\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume1 v)\nClone at  y: [360]\nClone at  y: [360]\nClone at  y: [360]\nClone at  y: [360]\nClone at  y: [999999]\n\ndefine position (y)\nset y to (y)\nif <(y) = (y position)> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at  y: (y)\ncreate clone of (_myself_ v)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\nforever\n    go to [back v] layer\n    go [backward v] (10000000000) layers\nend\n\n@collectibles7\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\n\nwhen I start as a clone\nforever\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    set size to (100) %\nend\n\nwhen flag clicked\nset [open 3 v] to [no]\nset [checkpoints v] to [yes]\nswitch costume to (key v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [-100] y: [750]\nClone at x: [1000000] y: [175]\n\nwhen I start as a clone\nforever\n    position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n    if <touching (cube v)?> then\n        set [open 10 v] to [yes]\n        wait (0.5) seconds\n        delete this clone\n    end\nend\n\n@Sprite5\n\n@Sprite4\n\ndefine Smooth Glide x: (x) y: (y) speed: (speed)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\nend\ngo to x: (x) y: (y)\n\nwhen flag clicked\nwait (0.1) seconds\nset [print v] to [no]\nset [menu v] to [yes]\nswitch costume to (costume1 v)\ngo to x: (0) y: (280)\nforever\n    set [ghost v] effect to (20)\n    if <(menu) = [yes]> then\n        if <touching (mouse-pointer v)?> then\n            next costume\n            broadcast (clone v)\n            set [print v] to [yes]\n            Smooth Glide x: (0) y: (240) speed: (4)\n            wait until <not <touching (mouse-pointer v)?>>\n            switch costume to (costume1 v)\n            broadcast (close v)\n            set [print v] to [no]\n            Smooth Glide x: (0) y: (280) speed: (5)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(costume [number v]) = [1]> or <(costume [number v]) = [2]>> then\n        go to [front v] layer\n        go [forward v] (1000000000) layers\n        broadcast (front layer v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [show v]\n\nset [menu v] to [no]\nnext costume\nbroadcast (clone v)\nSmooth Glide x: (0) y: (240) speed: (4)\nwait until <touching (mouse-pointer v)?>\nswitch costume to (costume1 v)\nbroadcast (close v)\nSmooth Glide x: (0) y: (280) speed: (5)\nset [menu v] to [yes]\n\nwhen I receive [front layer v]\nforever\n    if <<(costume [number v]) = [1]> or <(costume [number v]) = [2]>> then\n        go to [front v] layer\n        go [forward v] (1000000000) layers\n    end\nend\n\n@Sprite6\n\nwhen flag clicked\nswitch costume to (1 v)\nhide\n\nwhen I receive [close v]\ndelete this clone\n\nwhen I start as a clone\nshow\nclear graphic effects\nset [ghost v] effect to (100)\nset size to (100) %\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <not <<(costume [number v]) = [7]> or <<(costume [number v]) = [8]> or <(costume [number v]) = [9]>>>> then\n        go to [front v] layer\n        if <touching (mouse-pointer v)?> then\n            if <(size) = [100]> then\n                if <(sound) = [yes]> then\n                    start sound [Touch v]\n                end\n            end\n            repeat until <(size) = [110]>\n                change size by (5)\n                change [brightness v] effect by (5)\n            end\n            set size to (110) %\n            set [brightness v] effect to (10)\n        else\n            repeat until <(size) = [100]>\n                change size by (-5)\n                change [brightness v] effect by (-5)\n            end\n            set size to (100) %\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\nwait until <touching (mouse-pointer v)?>\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\nwhen I receive [clone v]\nif <(music on?) = [yes]> then\n    clone icon at x: [-215] y: [152] icon number [1]\nelse\n    clone icon at x: [-215] y: [152] icon number [2]\nend\nif <(sound) = [yes]> then\n    clone icon at x: [-165] y: [152] icon number [3]\nelse\n    clone icon at x: [-165] y: [152] icon number [4]\nend\nclone icon at x: [-78] y: [152] icon number [5]\nif <(lives) = [1]> then\n    clone icon at x: [15] y: [152] icon number [7]\nend\nif <(lives) = [2]> then\n    clone icon at x: [15] y: [152] icon number [8]\nend\nif <(lives) = [3]> then\n    clone icon at x: [15] y: [152] icon number [9]\nend\n\nclone icon at x: [215] y: [152] icon number [6]\n\ndefine clone icon at x: (x) y: (y) icon number (icon)\nswitch costume to (icon)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen [space v] key pressed\n\nset size to (110) %\n\nwhen this sprite clicked\nif <(costume [number v]) = [1]> then\n    switch costume to (2 v)\n    set [music on? v] to [no]\n    stop [this script v]\nend\nif <(costume [number v]) = [2]> then\n    switch costume to (1 v)\n    set [music on? v] to [yes]\n    stop [this script v]\nend\nif <(costume [number v]) = [3]> then\n    switch costume to (4 v)\n    set [sound v] to [no]\n    stop [this script v]\nend\nif <(costume [number v]) = [4]> then\n    set [sound v] to [yes]\n    switch costume to (3 v)\n    stop [this script v]\nend\nif <(costume [number v]) = [5]> then\n    broadcast (open shop v)\n    stop [this script v]\nend\nif <(costume [number v]) = [6]> then\n    set [exit v] to [restart]\n    stop [this script v]\nend\n\nwhen flag clicked\nset [music on? v] to [yes]\nset [sound v] to [yes]\n\nrepeat (2)\n\nwhen I receive [refresh v]\nbroadcast (menu v)\n\nwhen I receive [setup v]\nbroadcast (refresh v)\n\nwhen I start as a clone\nforever\n    wait (0.1) seconds\n    if <<(costume [number v]) = [7]> or <<(costume [number v]) = [8]> or <(costume [number v]) = [9]>>> then\n        if <(lives) = [3]> then\n            switch costume to (love \(2\)3 v)\n        else\n            if <(lives) = [2]> then\n                switch costume to (love \(2\)2 v)\n            else\n                switch costume to (love \(2\) v)\n            end\n        end\n    end\nend\n\n@water\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [ghost v] effect to (50)\nswitch costume to (costume1 v)\nClone at x: [360] y: [0]\nClone at x: [600] y: [0]\nClone at x: [360] y: [0]\nClone at x: [600] y: [0]\nClone at x: [360] y: [0]\nClone at x: [600] y: [0]\nClone at x: [360] y: [0]\nClone at x: [600] y: [0]\nClone at x: [360] y: [0]\nClone at x: [600] y: [0]\nClone at x: [800] y: [0]\nClone at x: [800] y: [0]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (175) layers\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [backward v] (5) layers\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@Sprite7\n\nwhen flag clicked\nforever\n    front\nend\n\nfront\n\ndefine front\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\n\ndefine Smooth Glide x: (x) y: (y) speed: (speed)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\nend\ngo to x: (x) y: (y)\n\nwhen I receive [open shop v]\nset [ghost v] effect to (20)\nSmooth Glide x: (0) y: (-100) speed: (5)\nset [shop open? v] to [yes]\nwait (2) seconds\nwait until <not <touching (mouse-pointer v)?>>\nset [shop open? v] to [no]\nbroadcast (close shop v)\nSmooth Glide x: (0) y: (-310) speed: (4)\nrepeat (2)\n    change [ghost v] effect by (40)\nend\n\nwhen flag clicked\nset [shop open? v] to [no]\ngo to x: (0) y: (-310)\nset [ghost v] effect to (100)\n\ngo to [front v] layer\n\ngo [backward v] (10) layers\n\nwhen I receive [open shop v]\nforever\n    front\n    go [backward v] (10) layers\nend\n\n@Sprite8\n\ndefine clone (item) at x: (x) y: (y)\nswitch costume to (item)\ngo to x: (x) y: (y)\nset [clone id v] to [item]\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I receive [open shop v]\nclone [1] at x: [-190] y: [5]\nclone [2] at x: [-115] y: [5]\nclone [3] at x: [-40] y: [5]\nclone [4] at x: [35] y: [5]\nclone [5] at x: [110] y: [5]\nclone [6] at x: [185] y: [5]\nclone [7] at x: [-190] y: [-70]\nclone [8] at x: [-115] y: [-70]\nclone [9] at x: [-40] y: [-70]\nclone [10] at x: [35] y: [-70]\nclone [11] at x: [110] y: [-70]\nclone [12] at x: [185] y: [-70]\nclone [13] at x: [-190] y: [-145]\nclone [14] at x: [-115] y: [-145]\nclone [15] at x: [-40] y: [-145]\nclone [16] at x: [35] y: [-145]\nclone [17] at x: [110] y: [-145]\nclone [18] at x: [185] y: [-145]\nclone info\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\n    go to [front v] layer\nend\nforever\n    go to [front v] layer\nend\n\ngo [forward v] (160) layers\n\nwhen I receive [close shop v]\ndelete this clone\n\nwhen I start as a clone\nif <(clone ID) = [item]> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            if <(size) = [100]> then\n                if <(sound) = [yes]> then\n                    set volume to (100) %\n                    start sound [Touch v]\n                end\n            end\n            repeat until <(size) = [110]>\n                change size by (5)\n                change [brightness v] effect by (5)\n            end\n            set size to (110) %\n            set [brightness v] effect to (10)\n        else\n            repeat until <(size) = [100]>\n                change size by (-5)\n                change [brightness v] effect by (-5)\n            end\n            set size to (100) %\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\ngo to [front v] layer\n\nwhen I start as a clone\nif <(clone ID) = [item]> then\n    forever\n        if <(costume [number v]) = [3]> then\n            change [color v] effect by (3)\n        else\n            if <(costume [number v]) = [17]> then\n                repeat (5)\n                    set [ghost v] effect to (pick random (0) to (50))\n                    wait (pick random (0) to (0.1)) seconds\n                end\n                wait (pick random (0) to (0.5)) seconds\n            else\n                if <(costume [number v]) = [4]> then\n                    go [backward v] (1) layers\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(clone ID) = [item]> then\n    forever\n        check if touching mouse\n    end\nend\n\ndefine check if touching mouse\nif <touching (mouse-pointer v)?> then\n    set [item v] to (costume [name v])\nend\n\nwhen I start as a clone\nforever\n    if <touching (sprite16 v)?> then\n        set [touching mouse? v] to [yes]\n    else\n        set [touching mouse? v] to [no]\n    end\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [1]> then\n    if <(1) > []> then\n        set [costume # v] to (costume [number v])\n    else\n        if <(coins) > [9]> then\n            change [coins v] by (-10)\n            set [costume # v] to (costume [number v])\n            set [1 v] to [bought]\n        end\n    end\nelse\n    if <(costume [number v]) = [2]> then\n        if <(2) > []> then\n            set [costume # v] to (costume [number v])\n        else\n            if <(coins) > [9]> then\n                change [coins v] by (-10)\n                set [costume # v] to (costume [number v])\n                set [2 v] to [bought]\n            end\n        end\n    else\n        if <(costume [number v]) = [3]> then\n            if <(3) > []> then\n                set [costume # v] to (costume [number v])\n            else\n                if <(coins) > [9]> then\n                    change [coins v] by (-10)\n                    set [costume # v] to (costume [number v])\n                    set [3 v] to [bought]\n                end\n            end\n        else\n            if <(costume [number v]) = [4]> then\n                if <(4) > []> then\n                    set [costume # v] to (costume [number v])\n                else\n                    if <(coins) > [9]> then\n                        change [coins v] by (-10)\n                        set [costume # v] to (costume [number v])\n                        set [4 v] to [bought]\n                    end\n                end\n            else\n                if <(costume [number v]) = [5]> then\n                    if <(5) > []> then\n                        set [costume # v] to (costume [number v])\n                    else\n                        if <(coins) > [9]> then\n                            change [coins v] by (-10)\n                            set [costume # v] to (costume [number v])\n                            set [5 v] to [bought]\n                        end\n                    end\n                else\n                    if <(costume [number v]) = [6]> then\n                        if <(6) > []> then\n                            set [costume # v] to (costume [number v])\n                        else\n                            if <(coins) > [9]> then\n                                change [coins v] by (-10)\n                                set [costume # v] to (costume [number v])\n                                set [6 v] to [bought]\n                            end\n                        end\n                    else\n                        if <(costume [number v]) = [7]> then\n                            if <(7) > []> then\n                                set [costume # v] to (costume [number v])\n                            else\n                                if <(coins) > [19]> then\n                                    change [coins v] by (-20)\n                                    set [costume # v] to (costume [number v])\n                                    set [7 v] to [bought]\n                                end\n                            end\n                        else\n                            if <(costume [number v]) = [8]> then\n                                if <(8) > []> then\n                                    set [costume # v] to (costume [number v])\n                                else\n                                    if <(coins) > [19]> then\n                                        change [coins v] by (-20)\n                                        set [costume # v] to (costume [number v])\n                                        set [8 v] to [bought]\n                                    end\n                                end\n                            else\n                                if <(costume [number v]) = [9]> then\n                                    if <(9) > []> then\n                                        set [costume # v] to (costume [number v])\n                                    else\n                                        if <(coins) > [19]> then\n                                            change [coins v] by (-20)\n                                            set [costume # v] to (costume [number v])\n                                            set [9 v] to [bought]\n                                        end\n                                    end\n                                else\n                                    if <(costume [number v]) = [10]> then\n                                        if <(10) > []> then\n                                            set [costume # v] to (costume [number v])\n                                        else\n                                            if <(coins) > [19]> then\n                                                change [coins v] by (-20)\n                                                set [costume # v] to (costume [number v])\n                                                set [10 v] to [bought]\n                                            end\n                                        end\n                                    else\n                                        if <(costume [number v]) = [11]> then\n                                            if <(11) > []> then\n                                                set [costume # v] to (costume [number v])\n                                            else\n                                                if <(coins) > [19]> then\n                                                    change [coins v] by (-20)\n                                                    set [costume # v] to (costume [number v])\n                                                    set [11 v] to [bought]\n                                                end\n                                            end\n                                        else\n                                            if <(costume [number v]) = [12]> then\n                                                if <(12) > []> then\n                                                    set [costume # v] to (costume [number v])\n                                                else\n                                                    if <(coins) > [19]> then\n                                                        change [coins v] by (-20)\n                                                        set [costume # v] to (costume [number v])\n                                                        set [12 v] to [bought]\n                                                    end\n                                                end\n                                            else\n                                                if <(costume [number v]) = [13]> then\n                                                    if <(13) > []> then\n                                                        set [costume # v] to (costume [number v])\n                                                    else\n                                                        if <(coins) > [49]> then\n                                                            change [coins v] by (-50)\n                                                            set [costume # v] to (costume [number v])\n                                                            set [13 v] to [bought]\n                                                        end\n                                                    end\n                                                else\n                                                    if <(costume [number v]) = [14]> then\n                                                        if <(14) > []> then\n                                                            set [costume # v] to (costume [number v])\n                                                        else\n                                                            if <(coins) > [49]> then\n                                                                change [coins v] by (-50)\n                                                                set [costume # v] to (costume [number v])\n                                                                set [14 v] to [bought]\n                                                            end\n                                                        end\n                                                    else\n                                                        if <(costume [number v]) = [15]> then\n                                                            if <(15) > []> then\n                                                                set [costume # v] to (costume [number v])\n                                                            else\n                                                                if <(coins) > [49]> then\n                                                                    change [coins v] by (-50)\n                                                                    set [costume # v] to (costume [number v])\n                                                                    set [15 v] to [bought]\n                                                                end\n                                                            end\n                                                        else\n                                                            if <(costume [number v]) = [16]> then\n                                                                if <(16) > []> then\n                                                                    set [costume # v] to (costume [number v])\n                                                                else\n                                                                    if <(coins) > [49]> then\n                                                                        change [coins v] by (-50)\n                                                                        set [costume # v] to (costume [number v])\n                                                                        set [16 v] to [bought]\n                                                                    end\n                                                                end\n                                                            else\n                                                                if <(costume [number v]) = [17]> then\n                                                                    if <(17) > []> then\n                                                                        set [costume # v] to (costume [number v])\n                                                                    else\n                                                                        if <(coins) > [99]> then\n                                                                            change [coins v] by (-100)\n                                                                            set [costume # v] to (costume [number v])\n                                                                            set [17 v] to [bought]\n                                                                        end\n                                                                    end\n                                                                else\n                                                                    if <(costume [number v]) = [18]> then\n                                                                        if <(18) > []> then\n                                                                            set [costume # v] to (costume [number v])\n                                                                        else\n                                                                            if <(coins) > [99]> then\n                                                                                change [coins v] by (-100)\n                                                                                set [costume # v] to (costume [number v])\n                                                                                set [18 v] to [bought]\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine clone info\nset [clone id v] to [info]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(clone ID) = [info]> then\n    forever\n        go to x: ((mouse x) + (50)) y: ((mouse y) + (50))\n        set [ghost v] effect to (20)\n        go to [front v] layer\n        costume #\n    end\nend\n\ndefine costume #\nswitch costume to ((item) + (18))\n\nset [1 v] to [bought]\n\n@collectibles8\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <(open 4) = [yes]> then\n    switch costume to (key2 v)\nelse\n    switch costume to (key v)\nend\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\n\nwhen I start as a clone\nforever\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    set size to (100) %\nend\n\nwhen I receive [open v]\n\nwhen flag clicked\nset [checkpoints v] to [yes]\nswitch costume to (key v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [4235] y: [195]\n\n@Sprite9\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ([floor v] of ((x) - ((SCROLL X) / (5))) ) ([floor v] of ((y) - ((SCROLL Y) / (1.5))) )\nif <(SCROLL X) > [3500]> then\n    show\nelse\n    hide\nend\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume2 v)\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [0] y: [500]\nClone at x: [360] y: [-500]\nClone at x: [600] y: [500]\nClone at x: [-240] y: [-500]\nClone at x: [360] y: [0]\nClone at x: [360] y: [100]\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (100) layers\nend\n\n@Sprite10\n\n@collectibles10\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL 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 Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nwhen I start as a clone\nif <not <(costume [number v]) = [6]>> then\n    set [ghost v] effect to (100)\nend\nforever\n    go to [front v] layer\n    set size to (100) %\nend\n\nwhen flag clicked\n\nswitch costume to (costume19 v)\nClone at x: [5125] y: [400]\n\nwhen I start as a clone\nif <(costume [number v]) > [2]> then\n\nwhen I receive [setup v]\nset [open 2 v] to [no]\nset [checkpoints v] to [yes]\nswitch costume to (key v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [1000000] y: [175]\nswitch costume to (costume2 v)\nClone at x: [4505] y: [584]\nswitch costume to (costume3 v)\nClone at x: [4395] y: [590]\nClone at x: [4220] y: [560]\nswitch costume to (costume2 v)\nClone at x: [4193] y: [635]\nClone at x: [4300] y: [630]\nswitch costume to (costume3 v)\nClone at x: [4613] y: [575]\nClone at x: [4757] y: [607]\nswitch costume to (costume2 v)\nClone at x: [4575] y: [668]\nswitch costume to (costume4 v)\nClone at x: [4700] y: [658]\nswitch costume to (costume3 v)\nClone at x: [5560] y: [600]\nClone at x: [5668] y: [570]\nClone at x: [5985] y: [560]\nswitch costume to (costume4 v)\nClone at x: [5590] y: [645]\nClone at x: [5700] y: [645]\nClone at x: [5792] y: [580]\nClone at x: [5933] y: [625]\nClone at x: [999999999] y: [0]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen [space v] key pressed\n\n@Sprite11\n\n@Sprite14\n\ndefine print\nbroadcast (delete v)\nset [element v] to [1]\nif <(length of (coins)) < [3]> then\n    go to x: (((length of [22]) * (152)) / (2)) y: (152)\nelse\n    go to x: (((length of [22]) * (138)) / (2)) y: (152)\nend\nrepeat (length of (coins))\n    switch costume to (letter (element) of (coins))\n    create clone of (_myself_ v)\n    if <(length of (coins)) < [3]> then\n        change x by (25)\n    else\n        change x by (20)\n    end\n    change [element v] by (1)\nend\n\nwhen I receive [delete v]\ndelete this clone\n\nwhen I start as a clone\nif <(length of (coins)) < [3]> then\n    set size to (100) %\nelse\n    set size to (75) %\nend\nshow\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <(print) = [yes]> then\n        print\n        wait (0.05) seconds\n    end\nend\n\nwhen I receive [close v]\nbroadcast (delete v)\n\nset size to (100) %\n\nset size to (75) %\n\n@Sprite16\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to (mouse-pointer v)\nend\n\n@Sprite18\n\nwhen flag clicked\nshow\nforever\n    go to (cube v)\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [backward v] (20) layers\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [cube v]) = [11]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite17\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume1 v)\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [0] y: [500]\nClone at x: [360] y: [-500]\nClone at x: [600] y: [500]\nClone at x: [-240] y: [-500]\nClone at x: [360] y: [0]\nClone at x: [360] y: [100]\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [999999999] y: [0]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (120) layers\nend\n\n@collectibles9\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL 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 Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [1]> then\n        go to [front v] layer\n        go [backward v] (200) layers\n    end\nend\n\nwhen flag clicked\nset [open 2 v] to [no]\nset [checkpoints v] to [yes]\nswitch costume to (costume1 v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nswitch costume to (costume1 v)\nClone at x: [4925] y: [400]\nClone at x: [100000] y: [0]\n\nwhen I start as a clone\nset [moving platform x position v] to [4925]\nforever\n    repeat (100)\n        change [x v] by (5)\n        change [moving platform x position v] by (5)\n    end\n    wait (1) seconds\n    repeat (100)\n        change [x v] by (-5)\n        change [moving platform x position v] by (-5)\n    end\n    wait (1) seconds\nend\n\nrepeat (50)\n\nwait (0.5) seconds\nrepeat (50)\n    change [y v] by (-8)\n    change [platform speed v] by (-1)\nend\nset [platform speed v] to (platform speed)\nwait (0.5) seconds\n\nset size to (100) %\n\nwhen flag clicked\n\nset [moving platform x v] to (x)\n\nset [moving platform x v] to (x)\n\nwhen [space v] key pressed\ndelete this clone\n\n@fire\n\nwhen flag clicked\nforever\n    switch costume to (1 v)\n    repeat (10)\n        next costume\n        wait (0.05) seconds\n    end\n    if <([costume # v] of [cube v]) = [12]> then\n        create clone of (_myself_ v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(shop open?) = [no]> then\n        if <([costume # v] of [cube v]) = [12]> then\n            go to x: ([x position v] of [cube v]) y: (([y position v] of [cube v]) + (25))\n            go to [front v] layer\n            show\n            go [backward v] (10) layers\n        else\n            go to [back v] layer\n            hide\n        end\n    else\n        show\n        go to [front v] layer\n        go [forward v] (100) layers\n        go to x: (185) y: (-40)\n    end\nend\n\nwhen I start as a clone\nif <(shop open?) = [no]> then\n    set y to (([x position v] of [cube v]) - (10))\nend\nmove (pick random (-20) to (20)) steps\nset size to (75) %\nswitch costume to (12 v)\nset [speed y v] to (pick random (0.5) to (1.5))\nrepeat (100)\n    change y by (speed y)\n    change [ghost v] effect by (1)\n    change size by (-0.5)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (81) layers\nend\n\nwhen flag clicked\nforever\n\nwhen I receive [open shop v]\nforever\n    go to [front v] layer\nend\n\ngo [backward v] (81) layers\n\n@collectibles11\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <(open 10) = [yes]> then\n    switch costume to (key2 v)\nelse\n    switch costume to (key v)\nend\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\nset [open 10 v] to [no]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\n\nwhen I start as a clone\nforever\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    set size to (100) %\nend\n\nwhen I receive [open v]\n\nwhen flag clicked\nset [checkpoints v] to [yes]\nswitch costume to (key v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [5710] y: [250]\n\n@collectibles13\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (cube v)?> then\n    broadcast (win v)\n    delete this clone\nend\n\nbroadcast (Tick v) and wait\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nchange [collected max v] by (1)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nnext costume\n\nClone at x: [892] y: [538]\n\nClone at x: [650] y: [367]\nClone at x: [893] y: [510]\nClone at x: [885] y: [556]\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nClone at x: [978] y: [210]\nClone at x: [997] y: [220]\nClone at x: [1020] y: [229]\nClone at x: [1050] y: [211]\nClone at x: [1092] y: [204]\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\n\nwhen I start as a clone\nforever\n\ndelete this clone\n\nplay sound [Coin v] until done\n\nclear sound effects\n\nwhen flag clicked\nforever\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\nset size to (100) %\n\nwhen I receive [open v]\n\nwhen flag clicked\nset [checkpoints v] to [yes]\nswitch costume to (key v)\nclear sound effects\nhide\nset [x v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset size to (100) %\nClone at x: [5665] y: [258]\nClone at x: [9999999999] y: [258]\n\n@Sprite12\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume1 v)\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [0] y: [500]\nClone at x: [360] y: [-500]\nClone at x: [600] y: [500]\nClone at x: [-240] y: [-500]\nClone at x: [360] y: [0]\nClone at x: [360] y: [100]\nClone at x: [360] y: [0]\nClone at x: [500] y: [0]\nClone at x: [500] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [100000] y: [0]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (50) layers\nend\n\nwhen I start as a clone\nforever\n    if <<(costume [number v]) = [18]> or <(costume [number v]) = [17]>> then\n        go to [front v] layer\n        go [backward v] (30) layers\n    end\nend\n\ngo [forward v] () layers\n\n@Sprite15\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nwait (1) seconds\nforever\n    go to [front v] layer\n    front layer\n    front layer\n    front layer\n    front layer\n    set size to (100) %\nend\n\nwhen I start as a clone\nforever\n    go to x: ((mouse x) + (50)) y: ((mouse y) - (-25))\nend\n\ndefine front layer\ngo to [front v] layer\ngo to [front v] layer\n\ndefine check item\ngo to [front v] layer\nif <<(y position) < [60]> and <(shop open?) = [yes]>> then\n    go to [front v] layer\n    front layer\n    set [ghost v] effect to (20)\n    switch costume to (item)\nelse\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\n    switch costume to (costume3 v)\n    wait until <(y position) < [60]>\nend\n\nif <(touching) = [yes]> then\nswitch costume to (costume3 v)\n\nwhen I start as a clone\nforever\n    check item\nend\n\nwhen I receive [open shop v]\ncreate clone of (_myself_ v)\n\nwhen I receive [close v]\ndelete this clone\n\n@Sprite13\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@cloud\n\ndefine delete and rewrite code data list\ndelete all of [run:data v]\nset [readdata# v] to [1]\nset [datachars v] to [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-*/~`!@#$%^&*\(\)_=\[\]\{}|;':",./<>?]\nrepeat (99)\n    add [] to [run:data v]\nend\nrepeat (length of (datachars))\n    add (letter (readdata#) of (datachars)) to [run:data v]\n    change [readdata# v] by (1)\nend\nadd [ ] to [run:data v]\n\ndefine encode string (val) and add to encoded value (new encode section?) (boolean)\nswitch costume to (lowercase v)\nif <(boolean) = [true]> then\n    set [encoded value v] to []\nend\nset [readdata# v] to [1]\nrepeat (length of (val))\n    set [word v] to (letter (readdata#) of (val))\n    switch costume to (join (word) [\)])\n    set [word v] to (item # of (word) in [run:data v])\n    if <(costume [name v]) = [lowercase]> then\n        if <not <(word) = [0]>> then\n            set [encoded value v] to (join (encoded value) (word))\n        else\n            set [encoded value v] to (join (encoded value) (item # of [*] in [run:data v]))\n        end\n    else\n        if <not <(word) = [0]>> then\n            set [encoded value v] to (join (encoded value) ((word) + (26)))\n        else\n            set [encoded value v] to (join (encoded value) (item # of [*] in [run:data v]))\n        end\n    end\n    switch costume to (lowercase v)\n    change [readdata# v] by (1)\nend\nset [encoded value v] to (join (encoded value) [000])\n\ndefine decode string (code) and add to value (new decode section?) (boolean)\nset [decoded result v] to []\nif <(boolean) = [true]> then\n    set [encoded value v] to (code)\n    set [readdata# v] to [1]\nend\nforever\n    set [decode idx v] to (join (letter (readdata#) of (encoded value)) (join (letter ((readdata#) + (1)) of (encoded value)) (letter ((readdata#) + (2)) of (encoded value))))\n    change [readdata# v] by (3)\n    if <(decode IDX) < [1]> then\n        stop [this script v]\n    end\n    set [decoded result v] to (join (decoded result) (item (decode IDX) of [run:data v]))\nend\n\ndefine add word: (word) into code list\nif <not <[run:data v] contains (word)?>> then\n    if <(length of (word)) = [1]> then\n        ask [Are you sure that you want to add a new code element into the base list?] and wait\n        if < (answer) contains [yes]?> then\n            add (word) to [run:data v]\n        end\n    end\nend\n\nwhen flag clicked\nset [@my player #@ v] to [0]\nset [@username@ v] to (username)\nhide\nset up clones [6]\nbroadcast (allocate slot v)\nbroadcast (begin v)\n\ndefine set up clones (amount)\nset [clone# v] to [1]\nset [cloud: offline v] to [100]\nrepeat ((amount) - (1))\n    create clone of (_myself_ v)\n    change [clone# v] by (1)\nend\n\ndefine send (data) to cloud: (#)\nif <(#) = [1]> then\n    set [☁ c1 v] to (data)\nelse\n    if <(#) = [2]> then\n        set [☁ c2 v] to (data)\n    else\n        if <(#) = [3]> then\n            set [☁ c3 v] to (data)\n        else\n            if <(#) = [4]> then\n                set [☁ c4 v] to (data)\n            else\n                if <(#) = [5]> then\n                    set [☁ c5 v] to (data)\n                else\n                    if <(#) = [6]> then\n                        set [☁ c6 v] to (data)\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine value = cloud# (#)\nif <(#) = [1]> then\n    set [decoded result v] to (☁ C1)\nelse\n    if <(#) = [2]> then\n        set [decoded result v] to (☁ C2)\n    else\n        if <(#) = [3]> then\n            set [decoded result v] to (☁ C3)\n        else\n            if <(#) = [4]> then\n                set [decoded result v] to (☁ C4)\n            else\n                if <(#) = [5]> then\n                    set [decoded result v] to (☁ C5)\n                else\n                    if <(#) = [6]> then\n                        set [decoded result v] to (☁ C6)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [allocate slot v]\nbroadcast (conneecting v)\nset [@connected?@ v] to [false]\nvalue = cloud# (clone#)\nset [allocate_last val v] to (join [A] (decoded result))\nwait (2.5) seconds\nvalue = cloud# (clone#)\nif <(join [A] (decoded result)) = (allocate_last val)> then\n    set [@my player #@ v] to (clone#)\nend\nset [@connected?@ v] to [true]\nif <(@MY PLAYER #@) > [0]> then\n    broadcast (connected v)\nelse\n    broadcast (fail v)\nend\n\nwhen I receive [begin v]\nforever\n    if <(@MY PLAYER #@) = (clone#)> then\n        hide\n        encode string (round ([x v] of [cube v])) and add to encoded value (new encode section?) [true]\n        encode string (round ([y v] of [cube v])) and add to encoded value (new encode section?) []\n        encode string (@USERNAME@) and add to encoded value (new encode section?) []\n        encode string ([costume # v] of [cube v]) and add to encoded value (new encode section?) []\n        encode string (round ((days since 2000) * (10000000000))) and add to encoded value (new encode section?) []\n        send (encoded value) to cloud: (@MY PLAYER #@)\n    else\n        disconnection timeout: [10]\n        value = cloud# (clone#)\n        decode string (decoded result) and add to value (new decode section?) [true]\n        change [x v] by (round (((decoded result) - (x)) / (3)))\n        set size to (400) %\n        set x to ((x) - (SCROLL X))\n        set size to (100) %\n        decode string [] and add to value (new decode section?) []\n        change [y v] by (round (((decoded result) - (y)) / (3)))\n        set size to (400) %\n        set y to ((y) - (SCROLL Y))\n        set size to (100) %\n        decode string [] and add to value (new decode section?) []\n        say (decoded result)\n        decode string [] and add to value (new decode section?) []\n        switch costume to (join [player_] (decoded result))\n    end\nend\n\ndefine disconnection timeout: (frames)\nvalue = cloud# (clone#)\nif <(join [A] (decoded result)) = (last_val)> then\n    change [cloud: offline v] by (-1)\n    if <(cloud: offline) < (frames)> then\n        hide\n    end\nelse\n    set [cloud: offline v] to [100]\n    set [last_val v] to (join [A] (decoded result))\n    if <(@CONNECTED?@) = [true]> then\n        show\n    end\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I start as a clone\nshow\nswitch costume to (pick random (28) to (44))\nforever\n    set size to (72) %\n    go to [front v] layer\nend\n\n@messages\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [conneecting v]\ngo to [front v] layer\nswitch costume to (connecting v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [connected v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (connected v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nbroadcast (lf v)\n\nwhen I receive [fail v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (fail v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [lf v]\n\nwhen I receive [win v]\ngo to [front v] layer\nswitch costume to (won v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait until <<mouse down?> and <touching (mouse-pointer v)?>>\nbroadcast (delete2 v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nwait (pick random (10) to (50)) seconds\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (lf v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (4) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [win v]\nforever\n    go to [front v] layer\nend\n\n@Sprite19\n\ndefine print\nbroadcast (delete2 v)\nset [element 2 v] to [1]\ngo to x: (-105) y: (138)\nrepeat (length of (round (timer)))\n    switch costume to (letter (element 2) of (round (timer)))\n    create clone of (_myself_ v)\n    if <(length of (round (timer))) < [3]> then\n        change x by (25)\n    else\n        change x by (20)\n    end\n    change [element 2 v] by (1)\nend\nset size to (100) %\n\nwhen I start as a clone\nif <(length of (round (timer))) < [3]> then\n    set size to (100) %\nelse\n    set size to (75) %\nend\nshow\nforever\n    go to [front v] layer\n    go [forward v] (10) layers\nend\n\nset size to (75) %\n\n\n\nwhen I receive [win v]\nprint\n\nwhen I receive [delete2 v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\n