WORLDS 2 - a scrolling platformer 

Instructions: WORLDS 2 - a scrolling platformer\n\nWelcome to WORLDS 2 - a scrolling platformer! Explore 6 different levels full of fun! GrassLand, Sky, ScratchLand, Crystal Cave, Candy Wonderland, and finally a challenging boss level! Which one is your favorite? Let me know in the comments!\n\nINSTRUCTIONS: \n▻ Arrow keys or tap to move (this is mobile friendly :D)\n▻ Avoid spikes, lava and enemies (falling also hurts you)\n▻ Collect all the diamond to open the portal \n▻ Get to the portal to go to next level\n▻ ❤︎, ☆ and follow! (if this gets 100 loves or 100 favorites, then I will definitely make a part 3!)\n\nAchievements: \n✓ Shared\n✓ 10 views\n✓ 10 loves\n✓ 10 favorites\n✓ 50 views\n✓ 50 loves\n✓ 50 favorites\n✓ 100 views\n✘ 100 loves\n✘ 100 favorites\n✓ 500 views\n✘ 500 loves\n✘ 500 favorites\n✘ 1000 views\n✘ 1000 loves\n✘ 1000 favorites\n\n\n\n\n\n\n\n\n\n\n

@Stage\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 2 v)\nforever\n    if <(LEVEL) = [3]> then\nend\n\nwhen I receive [level 3 v]\nset [brightness v] effect to (90)\n\nrepeat (10)\n\nwait (5) seconds\nswitch backdrop to (blue sky 2 2 v)\n\nforever\n\nwhen I receive [level 4 v]\nset [brightness v] effect to (-100)\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 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) = [1]> then\n        switch backdrop to (blue sky 2 2 v)\n    end\nend\n\n@blank\n\n@Cube\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\nset size to (90) %\nset [sx v] to [0]\nset [x v] to [0]\nset [in air v] to [0]\nset [y v] to [0]\nset [sy 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    Change Player x by [-8]\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    Change Player x by [8]\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange player y by (sy)\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [restart]\nend\nchange [x v] by (8)\nchange [x v] by (-8)\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 (sprite1 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)\nchange [x v] by (sx)\nPosition\nTest Die\nif <touching (sprite1 v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (sprite1 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)?>>\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 (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\ndefine Test Die\nif <<touching (danger v)?> or <<touching (sprite5 v)?> and <(LEVEL) = [4]>>> then\n    set [exit v] to [restart]\nend\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\nhide\nchange [level v] by (1)\n\nif <(in air) < [4]> then\n    set [sy v] to [16]\nend\n\ndefine tick 2\n\nTick\n\nbroadcast (Tick v) and wait\n\nwait (0.02) seconds\n\nwhen flag clicked\nforever\n    switch costume to (costume11 v)\n    repeat (9)\n        next costume\n    end\n    repeat (9)\n        switch costume to ((costume [number v]) - (1))\n    end\n    wait (pick random (0) to (5)) seconds\nend\n\nswitch costume to (cu v)\n\nwhen flag clicked\nforever\n    if <<<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 <<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    else\n        point in direction (90)\n    end\nend\n\nwhen I receive [hide home screen v]\nbroadcast (Flag v) and wait\nbroadcast (Play game v) and wait\n\nbroadcast (Tick v) and wait\nTick\n\ntick 2\n\ndefine win\nplay sound [Win v] until done\n\nwhen I receive [win 2 v]\nset volume to (20) %\nif <(EXIT) = [win]> then\n    win\nend\n\nwhen I receive [crystal v]\nif <(sound effects) = [on]> then\n    set volume to (40) %\n    play sound [Collect v] until done\nend\n\nwhen flag clicked\nforever\n    if <(EXIT) = [restart]> then\n        play sound [Pew v] until done\n    end\nend\n\n@Sprite3\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(open portal?) = [yes]> and <touching (cube v)?>> then\n    set [exit v] to [win]\nend\n\ndelete this clone\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nset [ghost v] effect to (50)\nset [brightness v] effect to (-100)\nswitch costume to (costume1 v)\nhide\nset [open portal? v] to [no]\nset [x v] to [0]\nset [coins v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [2458] y: [152]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 1 1 v)\n        Clone at x: [3019] y: [1320]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 1 1 v)\n            Clone at x: [7385] y: [314]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at x: [2750] y: [307]\n            else\n                if <(LEVEL) = [5]> then\n                    Clone at x: [3752] y: [243]\n                else\n                    if <(LEVEL) = [6]> then\n                        Clone at x: [4313] y: [-29]\n                    end\n                end\n            end\n        end\n    end\nend\n\nClone at x: [240] y: [22]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\nnext costume\n\nwhen I receive [open portal v]\nswitch costume to (costume1 v)\nset [open portal? v] to [yes]\nclear graphic effects\n\nwhen flag clicked\nforever\n    turn right (10) degrees\n    wait (0.05) seconds\nend\n\nrepeat (6)\n    next costume\n    wait (0.05) seconds\nend\n\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    if <<touching (cube v)?> and <(open portal?) = [no]>> then\n        broadcast (portals is not opened v) and wait\n        wait (1) seconds\n    end\n    wait (1) seconds\nend\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    wait\nend\n\ndefine wait\nwait (1) seconds\nwait (0.1) seconds\n\n@Sprite1\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    broadcast (level 1 v)\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        broadcast (level 2 v) and wait\n        Clone at x: [370] y: [210]\n        Clone at x: [370] y: [210]\n        Clone at x: [100] y: [210]\n        Clone at x: [100] y: [210]\n        Clone at x: [100] y: [210]\n        Clone at x: [150] y: [210]\n        Clone at x: [350] y: [210]\n        Clone at x: [350] y: [210]\n        Clone at x: [600] y: [-200]\n        Clone at x: [400] y: [-200]\n        Clone at x: [20] y: [-230]\n    else\n        if <(LEVEL) = [3]> then\n            broadcast (level 3 v)\n            switch costume to (screen shot 2020-05-07 at 3 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [600] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [0] y: [300]\n            Clone at x: [600] y: [-300]\n            Clone at x: [700] y: [0]\n            Clone at x: [600] y: [0]\n            Clone at x: [600] y: [0]\n            Clone at x: [600] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                broadcast (level 4 v)\n                switch costume to (costume2 v)\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [200]\n            else\n                if <(LEVEL) = [5]> then\n                    broadcast (level 5 v)\n                    switch costume to (costume10 v)\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [100]\n                    Clone at x: [500] y: [0]\n                    Clone at x: [500] y: [100]\n                    Clone at x: [500] y: [0]\n                    Clone at x: [700] y: [0]\n                    Clone at x: [500] y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        broadcast (level 6 v)\n                        switch costume to (costume18 v)\n                        Clone at x: [360] y: [0]\n                        Clone at x: [360] y: [0]\n                        Clone at x: [600] y: [0]\n                        Clone at x: [600] y: [0]\n                        Clone at x: [600] y: [0]\n                        Clone at x: [500] y: [0]\n                        Clone at x: [500] y: [0]\n                        Clone at x: [500] y: [0]\n                    else\n                        show\n                    end\n                end\n            end\n        end\n    end\nend\n\ngo [backward v] (4) layers\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\nClone at x: [360] y: [100]\nClone at x: [360] y: [400]\n\nClone at x: [] y: []\n\nClone at x: [360] y: [0]\n\nrepeat (6)\n\nbroadcast (setup v)\n\nwhen I start as a clone\nforever\n    go to [back v] layer\nend\n\nif <(LEVEL) = [5]> then\nend\n\n@Sprite2\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    change [coins v] by (1)\n    if <(coins) = (COLLECTED MAX)> then\n        broadcast (Open portal v)\n    end\n    broadcast (crystal v)\n    delete this clone\nend\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nclear sound effects\nhide\nset [x v] to [0]\nset [coins v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    set size to (100) %\n    switch costume to (crystal v)\n    Clone at x: [410] y: [-66]\n    Clone at x: [425] y: [-26]\n    Clone at x: [457] y: [3]\n    Clone at x: [502] y: [4]\n    Clone at x: [592] y: [65]\n    Clone at x: [700] y: [0]\n    Clone at x: [723] y: [40]\n    Clone at x: [768] y: [60]\n    Clone at x: [818] y: [45]\n    Clone at x: [901] y: [112]\n    Clone at x: [1010] y: [128]\n    Clone at x: [1117] y: [79]\n    Clone at x: [1140] y: [110]\n    Clone at x: [1181] y: [125]\n    Clone at x: [1230] y: [110]\n    Clone at x: [1684] y: [-40]\n    Clone at x: [1700] y: [-10]\n    Clone at x: [1740] y: [2]\n    Clone at x: [1771] y: [-35]\n    Clone at x: [1820] y: [-13]\n    Clone at x: [1860] y: [0]\n    Clone at x: [1900] y: [0]\n    Clone at x: [1940] y: [0]\n    Clone at x: [1980] y: [0]\n    Clone at x: [2065] y: [120]\n    Clone at x: [2065] y: [87]\n    Clone at x: [2065] y: [52]\nelse\n    if <(LEVEL) = [2]> then\n        set size to (100) %\n        switch costume to (crystal v)\n        Clone at x: [200] y: [139]\n        Clone at x: [460] y: [230]\n        Clone at x: [420] y: [230]\n        Clone at x: [380] y: [230]\n        Clone at x: [340] y: [230]\n        Clone at x: [598] y: [310]\n        Clone at x: [614] y: [346]\n        Clone at x: [614] y: [346]\n        Clone at x: [650] y: [367]\n        Clone at x: [893] y: [510]\n        Clone at x: [885] y: [556]\n        Clone at x: [849] y: [577]\n        Clone at x: [1010] y: [1382]\n        Clone at x: [1010] y: [1420]\n        Clone at x: [1010] y: [1460]\n        Clone at x: [2854] y: [1100]\n        Clone at x: [2894] y: [1100]\n        Clone at x: [2934] y: [1100]\n    else\n        if <(LEVEL) = [3]> then\n            go to [back v] layer\n            set size to (120) %\n            switch costume to (crystal v)\n            Clone at x: [484] y: [91]\n            Clone at x: [604] y: [96]\n            Clone at x: [854] y: [95]\n            Clone at x: [1015] y: [151]\n            Clone at x: [1243] y: [99]\n            Clone at x: [1391] y: [307]\n            Clone at x: [1833] y: [74]\n            Clone at x: [1997] y: [151]\n            Clone at x: [2146] y: [272]\n            Clone at x: [2364] y: [117]\n            Clone at x: [3306] y: [-87]\n            Clone at x: [3498] y: [0]\n            Clone at x: [3686] y: [50]\n            Clone at x: [3854] y: [57]\n            Clone at x: [4428] y: [366]\n            Clone at x: [4549] y: [-154]\n            Clone at x: [4597] y: [-132]\n            Clone at x: [4637] y: [-128]\n            Clone at x: [4677] y: [-124]\n            Clone at x: [4707] y: [-120]\n            Clone at x: [5423] y: [-88]\n            Clone at x: [7420] y: [-56]\n        else\n            if <(LEVEL) = [4]> then\n                go to [back v] layer\n                set size to (120) %\n                switch costume to (crystal2 v)\n                Clone at x: [631 ] y: [72]\n                Clone at x: [822] y: [75]\n                Clone at x: [1337] y: [86]\n                Clone at x: [1474] y: [135]\n                Clone at x: [1617] y: [177]\n                Clone at x: [1765] y: [50]\n                Clone at x: [2206] y: [212]\n                Clone at x: [2528] y: [413]\n            else\n                if <(LEVEL) = [5]> then\n                    go to [back v] layer\n                    set size to (120) %\n                    switch costume to (crystal v)\n                    Clone at x: [258] y: [-100]\n                    Clone at x: [258] y: [-50]\n                    Clone at x: [258] y: [0]\n                    Clone at x: [258] y: [50]\n                    Clone at x: [1037] y: [234]\n                    Clone at x: [1806] y: [327]\n                    Clone at x: [1998] y: [433]\n                else\n                    if <(LEVEL) = [6]> then\n                        go to [back v] layer\n                        set size to (120) %\n                        switch costume to (crystal2 v)\n                        Clone at x: [1062] y: [-37]\n                        Clone at x: [1382] y: [-6]\n                        Clone at x: [1495] y: [85]\n                        Clone at x: [1753] y: [170]\n                        Clone at x: [1890] y: [125]\n                        Clone at x: [2012] y: [151]\n                        Clone at x: [2329] y: [47]\n                        Clone at x: [2492] y: [36]\n                        Clone at x: [2648] y: [-27]\n                        Clone at x: [2824] y: [-2]\n                        Clone at x: [2981] y: [-30]\n                        Clone at x: [3170] y: [-30]\n                    else\n                    end\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\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\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 flag clicked\nforever\n    if <(LEVEL) = [1]> then\n        set [collected max v] to [27]\n    else\n        if <(LEVEL) = [2]> then\n            set [collected max v] to [18]\n        else\n            if <(LEVEL) = [3]> then\n                set [collected max v] to [22]\n            else\n                if <(LEVEL) = [4]> then\n                    set [collected max v] to [8]\n                else\n                    if <(LEVEL) = [5]> then\n                        set [collected max v] to [7]\n                    else\n                        if <(LEVEL) = [6]> then\n                            set [collected max v] to [12]\n                        end\n                    end\n                end\n            end\n        end\n    end\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\n@Screen Shot 2020-05-07 at 3\n\n@Sprite5\n\nwhen I receive [level 3 v]\nshow\nset [ghost v] effect to (20)\n\nwhen flag clicked\nhide\n\ndefine position (y)\nset y to (y)\nif <<<(LEVEL) = [3]> or <(LEVEL) = [4]>> or <(LEVEL) = [6]>> then\n    if <(home screen?) < [yes]> then\n        if <(LEVEL) = [3]> then\n            switch costume to (costume1 v)\n            go to [front v] layer\n            if <(y) = (y position)> then\n                show\n            else\n                hide\n            end\n        else\n            check level\n            if <(y) = (y position)> then\n                show\n            else\n                hide\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nposition (join [-] (SCROLL Y))\n\nchange [y v] by (y)\n\nwhen flag clicked\nforever\n    check level\n    wait (0.03) seconds\n    waves\n    wait (0.03) seconds\nend\n\ndefine waves\nset [ghost v] effect to (30)\nset [fisheye v] effect to (-5)\nset [whirl v] effect to (-250)\nrepeat (50)\n    change [whirl v] effect by (12)\n    change [fisheye v] effect by (1)\n    wait (0.05) seconds\nend\nrepeat (50)\n    change [whirl v] effect by (-12)\n    change [fisheye v] effect by (-1)\n    wait (0.05) seconds\nend\n\ndefine check level\nif  then\n    switch costume to (costume1 v)\n    set [ghost v] effect to (20)\nelse\n    if <(LEVEL) = [4]> then\n        clear graphic effects\n        switch costume to (costume2 v)\n        go to [back v] layer\n    else\n        if <(LEVEL) = [5]> then\n            switch costume to (costume3 v)\n        end\n        switch costume to (costume4 v)\n    end\nend\n\nwhen flag clicked\nforever\n    check level\nend\n\nwhen I receive [home screen v]\nset [home screen? v] to [yes]\n\nwhen I receive [hide home screen v]\nset [home screen? v] to []\n\nif <(LEVEL) = [3]> then\n    wait (0.03) seconds\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [5]> then\n        switch costume to (costume3 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [6]> then\n        switch costume to (costume4 v)\n        show\n        set [ghost v] effect to (30)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(LEVEL) = [1]> or <<(LEVEL) = [2]> or <(LEVEL) = [5]>>> then\n        go to [back v] layer\n        set [ghost v] effect to (1000000)\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [4]> then\n        go to [back v] layer\n        go to [back v] layer\n        go [backward v] (1000000) layers\n    end\nend\n\nwhen I receive [level 5 v]\nshow\nset [ghost v] effect to (100)\n\n@Sprite6\n\n@Sprite4\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [3]> then\n    clear graphic effects\n    switch costume to (screen shot 2020-05-07 at 9 v)\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\nelse\n    if <(LEVEL) = [1]> then\n        set [ghost v] effect to (100)\n        hide\n        delete this clone\n    else\n        if <(LEVEL) = [4]> then\n            set [ghost v] effect to (100)\n            hide\n            delete this clone\n        else\n        end\n    end\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\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nnext costume\nchange [x v] by (x)\nchange [y v] by (y)\n\nClone at x: [0] y: [0]\n\nwhen I receive [level 1 v]\nhide\n\nif <(LEVEL) = [4]> then\n    set [ghost v] effect to (100)\n    hide\n    delete this clone\nend\n\nClone at x: [360] y: [100]\nClone at x: [360] y: [400]\n\n@Sprite9\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [number v]) = [2]> and <touching (cube v)?>> then\n    set [exit v] to [win]\nend\ndelete this clone\n\nchange [coins v] by (1)\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nset [ghost v] effect to (50)\nset [brightness v] effect to (-100)\nswitch costume to (costume1 v)\nhide\nset [x v] to [0]\nset [coins v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [2458] y: [152]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 1 1 v)\n        Clone at x: [3019] y: [1320]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 1 1 v)\n            Clone at x: [7385] y: [314]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (costume1 v)\n                Clone at x: [2750] y: [307]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (costume1 v)\n                    Clone at x: [3752] y: [243]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (costume1 v)\n                        Clone at x: [4313] y: [-29]\n                    end\n                end\n            end\n        end\n    end\nend\n\nClone at x: [240] y: [22]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\nnext costume\n\nwhen I receive [open portal v]\nset volume to (100) %\nplay sound [Connect v] until done\nswitch costume to (costume1 v)\nclear graphic effects\n\nwhen flag clicked\nforever\n    turn right (-10) degrees\n    wait (0.05) seconds\nend\n\nswitch costume to (costume1 v)\n\nrepeat (6)\n    next costume\n    wait (0.05) seconds\nend\n\nClone at x: [7385] y: [314]\n\nwhen I start as a clone\n\n@Sprite10\n\nwhen flag clicked\nhide\ngo to x: (0) y: (180)\n\nwhen I receive [portals is not opened v]\nclear graphic effects\nset [ghost v] effect to (30)\ngo to x: (0) y: (180)\nshow\nrepeat (25)\n    change y by (-3)\n    go to [front v] layer\n    go to [front v] layer\nend\ngo [forward v] (10000) layers\nwait (3) seconds\ngo to [front v] layer\ngo [forward v] (100000) layers\nrepeat (25)\n    go to [front v] layer\n    go to [front v] layer\n    change y by (3)\nend\nhide\n\nset [brightness v] effect to (100)\ngo to [front v] layer\nshow\nwait (4) seconds\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    go to [front v] layer\n    go to [front v] layer\nend\n\nwhen I receive [hide home screen v]\ngo to [front v] layer\nforever\n    go to [front v] layer\n    go to [front v] layer\nend\n\nwhen I receive [hide home screen v]\ngo to [front v] layer\nforever\n    go to [front v] layer\n    go to [front v] layer\nend\n\nwhen I receive [portals is not opened v]\nrepeat (10000)\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go [forward v] (1000000000) layers\n    go to [front v] layer\n    go to [front v] layer\nend\n\n@danger\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    broadcast (level 1 v)\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [370] y: [210]\n        Clone at x: [370] y: [210]\n        Clone at x: [100] y: [210]\n        Clone at x: [100] y: [210]\n        Clone at x: [100] y: [210]\n        Clone at x: [150] y: [210]\n        Clone at x: [350] y: [210]\n        Clone at x: [350] y: [210]\n        Clone at x: [600] y: [-200]\n        Clone at x: [400] y: [-200]\n        Clone at x: [20] y: [-230]\n    else\n        if <(LEVEL) = [3]> then\n            broadcast (level 3 v)\n            switch costume to (screen shot 2020-05-07 at 3 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [600] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [0] y: [300]\n            Clone at x: [600] y: [-300]\n            Clone at x: [700] y: [0]\n            Clone at x: [600] y: [0]\n            Clone at x: [600] y: [0]\n            Clone at x: [600] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                broadcast (level 4 v)\n                switch costume to (costume2 v)\n            else\n                if <(LEVEL) = [5]> then\n                    clear graphic effects\n                    switch costume to (costume2 v)\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        clear graphic effects\n                        switch costume to (costume3 v)\n                    end\n                end\n            end\n        end\n    end\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\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\nClone at x: [360] y: [100]\nClone at x: [360] y: [400]\n\nClone at x: [0] y: [0]\n\n@light\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [4]> then\n        show\n        go to [back v] layer\n        go [forward v] (1) layers\n        set [ghost v] effect to (0)\n        go to (cube v)\n        wait (0.03) seconds\n    else\n        if <(LEVEL) = [6]> then\n            show\n            go to [back v] layer\n            go [forward v] (1) layers\n            go to (cube v)\n            set [ghost v] effect to (49)\n            wait (0.03) seconds\n        else\n            hide\n            hide\n        end\n    end\nend\n\n@Sprite7\n\nwhen I receive [flag v]\nhide\n\nwhen I receive [tick v]\nif <not <(LEVEL) = [6]>> then\n    position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nelse\n    position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nend\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    set [ghost v] effect to (100)\n    hide\n    delete this clone\nelse\n    if <(LEVEL) = [2]> then\n        hide\n        delete this clone\n    else\n        if <(LEVEL) = [3]> then\n            hide\n            delete this clone\n        else\n            if <(LEVEL) = [4]> then\n                broadcast (level 4 v)\n                show\n                clear graphic effects\n                switch costume to (costume2 v)\n                go [backward v] (1) layers\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [200]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (228-2282773_candy-cane-svg-cut-file-candy-cane-svg \(1\) v)\n                    clear graphic effects\n                    go to [back v] layer\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                    Clone at x: [360] y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (istockphoto-165068447-612x4 v)\n                        clear graphic effects\n                        Clone at x: [475] y: [0]\n                        go to [back v] layer\n                        Clone at x: [475] y: [0]\n                        Clone at x: [475] y: [0]\n                        Clone at x: [475] y: [0]\n                        Clone at x: [475] y: [0]\n                        Clone at x: [475] y: [0]\n                        Clone at x: [475] y: [0]\n                        Clone at x: [475] y: [0]\n                        Clone at x: [475] y: [0]\n                        Clone at x: [475] y: [0]\n                        Clone at x: [360] y: [100]\n                    else\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <not <(LEVEL) = [3]>> then\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        show\n    else\n        hide\n    end\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\nClone at x: [] y: []\n\nwhen I start as a clone\nforever\n    if <not <(LEVEL) = [4]>> then\n        go to [back v] layer\n        go [backward v] (1) layers\n        go [backward v] (1) layers\n        go [backward v] (1) layers\n        go [backward v] (1) layers\n    else\n        go to [back v] layer\n        go [forward v] (10) layers\n    end\nend\n\n@Sprite8\n\nwhen flag clicked\nhide\ngo to x: (0) y: (180)\n\nwhen I receive [open portal v]\nclear graphic effects\nset [ghost v] effect to (30)\ngo to x: (0) y: (180)\nshow\nrepeat (10)\n    change y by (-2)\nend\nwait (3) seconds\nrepeat (10)\n    change y by (2)\nend\nhide\n\nset [brightness v] effect to (100)\ngo to [front v] layer\nshow\nwait (4) seconds\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\n\nwhen I receive [open portal v]\nforever\n    go to [front v] layer\n    go to [front v] layer\n    go [forward v] (100000000) layers\n    go to [front v] layer\n    go to [front v] layer\nend\n\n@Sprite11\n\nwhen flag clicked\nbroadcast (home screen v)\nshow\nforever\n    go to [back v] layer\nend\n\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\n\nwhen I receive [hide home screen v]\nhide\n\nwhen flag clicked\nforever\n    switch costume to (world)\nend\n\nwhen I receive [home screen v]\nshow\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\n    go [backward v] (1) layers\n    go [backward v] (1) layers\n    go [backward v] (1) layers\n    go [backward v] (1) layers\n    go [backward v] (1) layers\nend\n\ngo [backward v] (1) layers\ngo [backward v] (1) layers\ngo [backward v] (1) layers\n\ngo [backward v] (1) layers\n\n@Sprite16\n\nwhen flag clicked\nshow\nforever\n    set [brightness v] effect to (100)\n    set size to (120) %\n    turn right (0.5) degrees\n    go to [front v] layer\n    go [backward v] (4) layers\nend\n\nwhen flag clicked\nshow\nforever\n    if <(world) = [4]> then\n        set [ghost v] effect to (80)\n    else\n        set [ghost v] effect to (60)\n    end\nend\n\nwhen I receive [hide home screen v]\nhide\n\nwhen I receive [home screen v]\nshow\nforever\n    set [brightness v] effect to (100)\n    set size to (120) %\n    turn right (0.5) degrees\n    go to [front v] layer\n    go [backward v] (4) layers\nend\n\n@Sprite12\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\nforever\n    set size to (150) %\n    go to x: (0) y: (03)\n    go to [front v] layer\n    set [ghost v] effect to (15)\n    go to [front v] layer\n    go [forward v] (10000) layers\nend\n\nwhen I receive [previous level  v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen I receive [next level v]\nswitch costume to ((costume [number v]) + (1))\n\nwhen flag clicked\nforever\n    set [world v] to (costume [number v])\nend\n\nwhen I receive [hide home screen v]\nhide\n\nwhen I receive [home screen v]\nswitch costume to (LEVEL)\nshow\nforever\n    set size to (150) %\n    go to x: (0) y: (03)\n    go to [front v] layer\n    set [ghost v] effect to (15)\n    go to [front v] layer\n    go [forward v] (10000) layers\nend\n\ndefine front 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\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    front layer\nend\n\n@previous\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nforever\n    set [ghost v] effect to (15)\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go to x: (0) y: (3)\nend\n\nwhen this sprite clicked\nset volume to (10) %\nbroadcast (previous level  v)\nif <(sound effects) = [on]> then\n    play sound [click v] until done\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [hide home screen v]\nhide\n\nwhen I receive [home screen v]\nshow\nswitch costume to (costume1 v)\nforever\n    set [ghost v] effect to (15)\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go to x: (0) y: (3)\nend\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nforever\n    set [ghost v] effect to (15)\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go to x: (0) y: (3)\nend\n\nwhen I receive [front layer v]\nshow\nswitch costume to (costume1 v)\nforever\n    set [ghost v] effect to (15)\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go to x: (0) y: (3)\nend\n\nwhen I receive [front layer v]\nshow\nswitch costume to (costume1 v)\nforever\n    if <(LEVEL) > []> then\n        set [ghost v] effect to (15)\n        go to [front v] layer\n        go [forward v] (1) layers\n        go to [front v] layer\n        go to x: (0) y: (3)\n    end\nend\n\ndefine front 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\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    front layer\nend\n\n@next\n\nwhen flag clicked\nbroadcast (front layer v)\nshow\nset [ghost v] effect to (15)\nswitch costume to (costume1 v)\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go to x: (0) y: (3)\nend\n\nwhen this sprite clicked\nbroadcast (next level v)\nset volume to (10) %\nif <(sound effects) = [on]> then\n    play sound [click v] until done\nend\n\nwhen flag clicked\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [hide home screen v]\nhide\n\nwhen I receive [home screen v]\nshow\nset [ghost v] effect to (15)\nswitch costume to (costume1 v)\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go to x: (0) y: (3)\nend\n\nwhen I receive [hide home screen v]\nhide\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go to x: (0) y: (3)\nend\n\nwhen I receive [front layer v]\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go to x: (0) y: (3)\nend\n\ndefine front 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\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    front layer\nend\n\n@play?\n\nwhen flag clicked\nset [ghost v] effect to (15)\nshow\nswitch costume to (costume1 v)\nforever\n    go to x: (0) y: (-80)\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n        set size to (110) %\n    else\n        switch costume to (costume1 v)\n        set size to (100) %\n    end\nend\n\nwhen this sprite clicked\nset [level v] to (world)\nhide\nbroadcast (hide home screen v)\nset volume to (10) %\nif <(sound effects) = [on]> then\n    play sound [click v] until done\nend\n\nwhen I receive [home screen v]\nset [ghost v] effect to (15)\nshow\nswitch costume to (costume1 v)\nforever\n    go to x: (0) y: (-80)\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n        set size to (110) %\n    else\n        switch costume to (costume1 v)\n        set size to (100) %\n    end\nend\n\nwhen I receive [front layer v]\nset [ghost v] effect to (15)\nshow\nswitch costume to (costume1 v)\nforever\n    go to x: (0) y: (-80)\n    go to [front v] layer\nend\n\ndefine front 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\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    front layer\nend\n\n@home\n\nwhen flag clicked\nshow\ngo to x: (-216) y: (162)\n\nwhen I receive [hide home screen v]\ngo to [front v] layer\nshow\n\nwhen this sprite clicked\nbroadcast (home screen v)\nset volume to (10) %\nif <(sound effects) = [on]> then\n    play sound [click v] until done\nend\n\nwhen I receive [hide home screen v]\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\nend\n\nwhen I receive [home screen v]\nhide\n\n@sound effects\n\nwhen flag clicked\nshow\ngo to x: (-176) y: (162)\n\nwhen I receive [hide home screen v]\ngo to [front v] layer\nshow\n\nwhen flag clicked\nswitch costume to (5_ \(1\) v)\n\nwhen this sprite clicked\nset volume to (10) %\nif <(sound effects) = [on]> then\n    play sound [click v] until done\n    set [sound effects v] to [off]\n    next costume\nelse\n    set [sound effects v] to [on]\n    next costume\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\nend\n\nwhen flag clicked\n\nwhen I receive [hide home screen v]\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\nend\n\nwhen I receive [home screen v]\nhide\n\nwhen flag clicked\nset [sound effects v] to [on]\nswitch costume to (5_ \(1\)2 v)\nforever\n\n@restart\n\nwhen flag clicked\nshow\ngo to x: (-96) y: (162)\n\nwhen I receive [hide home screen v]\ngo to [front v] layer\nshow\n\nwhen flag clicked\nswitch costume to (5_ \(1\) v)\n\nwhen this sprite clicked\nset [exit v] to [restart]\nset volume to (10) %\nif <(sound effects) = [on]> then\n    play sound [click v] until done\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\nend\n\nwhen flag clicked\n\nwhen I receive [hide home screen v]\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\nend\n\nwhen I receive [home screen v]\nhide\n\n@music\n\nwhen flag clicked\nshow\ngo to x: (-136) y: (162)\n\nwhen I receive [hide home screen v]\ngo to [front v] layer\nshow\n\nwhen flag clicked\nswitch costume to (5_ \(1\) v)\n\nwhen this sprite clicked\nif <(music) = [on]> then\n    set [music v] to [off]\n    next costume\nelse\n    set [music v] to [on]\n    next costume\nend\nset volume to (10) %\nif <(sound effects) = [on]> then\n    play sound [click v] until done\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\nend\n\nwhen I receive [hide home screen v]\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go [forward v] (1) layers\nend\n\nwhen I receive [home screen v]\nhide\n\nwhen I receive [hide home screen v]\nforever\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to [front v] layer\n    go [forward v] (1) layers\nend\n\nwhen flag clicked\nswitch costume to (5_ \(1\) v)\nset [music v] to [on]\n\n@Sprite18\n\nwhen flag clicked\nset [ghost v] effect to (30)\nforever\n    if <(cursor) = [home]> then\n        show\n        clear graphic effects\n        switch costume to (home v)\n        go to [front v] layer\n    end\n    if <(cursor) = [restart]> then\n        show\n        clear graphic effects\n        switch costume to (restart v)\n        go to [front v] layer\n    end\n    if <(cursor) = [music]> then\n        clear graphic effects\n        show\n        switch costume to (music v)\n    end\n    if <(cursor) = [sound effects]> then\n        show\n        clear graphic effects\n        switch costume to (sound effects v)\n    end\n    if <(cursor) = [previous]> then\n        show\n        clear graphic effects\n        switch costume to (previous v)\n    end\n    if <(cursor) = [next]> then\n        show\n        clear graphic effects\n        switch costume to (next v)\n    end\n    if <(cursor) = [play]> then\n        show\n        clear graphic effects\n        switch costume to (play? v)\n    end\n    if <(cursor) = []> then\n        set [ghost v] effect to (100)\n        show\n    end\nend\n\n\n\nwhen flag clicked\nforever\n    go to (mouse-pointer v)\nend\n\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go to [front v] layer\n    go [forward v] (1000000000) layers\n    go to [front v] layer\n    go to [front v] layer\nend\n\nwhen flag clicked\n\nwhen I receive [hide home screen v]\nforever\n    go to [front v] layer\n    go to [front v] layer\n    go [forward v] (1000000000) layers\n    go to [front v] layer\n    go to [front v] layer\nend\n\nwhen I receive [home screen v]\nforever\n    go to [front v] layer\n    go to [front v] layer\n    go [forward v] (1000000000) layers\n    go to [front v] layer\n    go to [front v] layer\nend\n\nwhen I receive [front layer v]\nforever\n    go to [front v] layer\n    go to [front v] layer\n    go [forward v] (1000000000) layers\n    go to [front v] layer\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@Sprite17\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [backward v] (3) layers\n    if <not <(LEVEL) = [4]>> then\n        set [brightness v] effect to (0)\n        set [ghost v] effect to (70)\n    else\n        set [brightness v] effect to (-40)\n        set [ghost v] effect to (85)\n    end\nend\n\n@Sprite13\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    if <touching (previous v)?> then\n        set [cursor v] to [previous]\n    else\n        if <touching (next v)?> then\n            set [cursor v] to [next]\n        else\n            if <touching (play? v)?> then\n                set [cursor v] to [play]\n            else\n                if <touching (home v)?> then\n                    set [cursor v] to [home]\n                else\n                    if <touching (sound effects v)?> then\n                        set [cursor v] to [sound effects]\n                    else\n                        if <touching (restart v)?> then\n                            set [cursor v] to [restart]\n                        else\n                            if <touching (music v)?> then\n                                set [cursor v] to [music]\n                            else\n                                set [cursor v] to []\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    go to (mouse-pointer v)\nend\n\n@Sprite14\n\nwhen flag clicked\nforever\n    if <(coins) = [0]> then\n        switch costume to (costume1 v)\n    else\n        if <(coins) = [1]> then\n            switch costume to (costume2 v)\n        else\n            if <(coins) = [2]> then\n                switch costume to (costume3 v)\n            else\n                if <(coins) = [3]> then\n                    switch costume to (costume4 v)\n                else\n                    if <(coins) = [4]> then\n                        switch costume to (costume5 v)\n                    else\n                        if <(coins) = [5]> then\n                            switch costume to (costume6 v)\n                        else\n                            if <(coins) = [6]> then\n                                switch costume to (costume7 v)\n                            else\n                                if <(coins) = [7]> then\n                                    switch costume to (costume8 v)\n                                else\n                                    if <(coins) = [8]> then\n                                        switch costume to (costume9 v)\n                                    else\n                                        if <(coins) = [9]> then\n                                            switch costume to (costume10 v)\n                                        else\n                                            if <(coins) = [10]> then\n                                                switch costume to (costume11 v)\n                                            else\n                                                if <(coins) = [11]> then\n                                                    switch costume to (costume12 v)\n                                                else\n                                                    if <(coins) = [12]> then\n                                                        switch costume to (costume13 v)\n                                                    else\n                                                        if <(coins) = [13]> then\n                                                            switch costume to (costume14 v)\n                                                        else\n                                                            if <(coins) = [14]> then\n                                                                switch costume to (costume15 v)\n                                                            else\n                                                                if <(coins) = [15]> then\n                                                                    switch costume to (costume16 v)\n                                                                else\n                                                                    if <(coins) = [16]> then\n                                                                        switch costume to (costume17 v)\n                                                                    else\n                                                                        if <(coins) = [17]> then\n                                                                            switch costume to (costume18 v)\n                                                                        else\n                                                                            if <(coins) = [18]> then\n                                                                                switch costume to (costume19 v)\n                                                                            else\n                                                                                if <(coins) = [19]> then\n                                                                                    switch costume to (costume20 v)\n                                                                                else\n                                                                                    if <(coins) = [20]> then\n                                                                                        switch costume to (costume21 v)\n                                                                                    else\n                                                                                        if <(coins) = [21]> then\n                                                                                            switch costume to (costume22 v)\n                                                                                        else\n                                                                                            if <(coins) = [22]> then\n                                                                                                switch costume to (costume23 v)\n                                                                                            else\n                                                                                                if <(coins) = [23]> then\n                                                                                                    switch costume to (costume24 v)\n                                                                                                else\n                                                                                                    if <(coins) = [24]> then\n                                                                                                        switch costume to (costume25 v)\n                                                                                                    else\n                                                                                                        if <(coins) = [25]> then\n                                                                                                            switch costume to (costume26 v)\n                                                                                                        else\n                                                                                                            if <(coins) = [26]> then\n                                                                                                                switch costume to (costume27 v)\n                                                                                                            else\n                                                                                                                if <(coins) = [27]> then\n                                                                                                                    switch costume to (costume28 v)\n                                                                                                                end\n                                                                                                            end\n                                                                                                        end\n                                                                                                    end\n                                                                                                end\n                                                                                            end\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@Sprite15\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [1]> then\n        switch costume to (costume1 v)\n    else\n        if <(LEVEL) = [2]> then\n            switch costume to (costume2 v)\n        else\n            if <(LEVEL) = [3]> then\n                switch costume to (costume3 v)\n            else\n                if <(LEVEL) = [4]> then\n                    switch costume to (costume4 v)\n                else\n                    if <(LEVEL) = [5]> then\n                        switch costume to (costume5 v)\n                    else\n                        if <(LEVEL) = [6]> then\n                            switch costume to (costume6 v)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@Sprite19\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 [exit v] to [reset]\nend\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [coins v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    set size to (100) %\n    hide\nelse\n    if <(LEVEL) = [2]> then\n        hide\n    else\n        if <(LEVEL) = [3]> then\n            hide\n        else\n            if <(LEVEL) = [4]> then\n                hide\n            else\n                if <(LEVEL) = [5]> then\n                    hide\n                else\n                    if <(LEVEL) = [6]> then\n                        show\n                        Clone at x: [360] y: [0]\n                        Clone at x: [3420] y: [16]\n                        Clone at x: [3600] y: [16]\n                        Clone at x: [3813] y: [16]\n                        Clone at x: [4026] y: [16]\n                        Clone at x: [4239] y: [16]\n                        Clone at x: [4652] y: [16]\n                    end\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\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\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\nset [color v] effect to (150)\nset [brightness v] effect to (0)\nset [ghost v] effect to (30)\nforever\n    repeat (23)\n        switch costume to ((costume [number v]) + (1))\n    end\n    switch costume to (costume24 v)\n    repeat (23)\n        switch costume to ((costume [number v]) - (1))\n    end\nend\n\ndelete this clone\n\nrepeat (23)\nend\n\n@Sprite20\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 [exit v] to [reset]\nend\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [coins v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    set size to (100) %\n    hide\nelse\n    if <(LEVEL) = [2]> then\n        hide\n    else\n        if <(LEVEL) = [3]> then\n            hide\n        else\n            if <(LEVEL) = [4]> then\n                hide\n            else\n                if <(LEVEL) = [5]> then\n                    hide\n                else\n                    if <(LEVEL) = [6]> then\n                        show\n                        Clone at x: [600] y: [0]\n                        Clone at x: [1555] y: [139]\n                        Clone at x: [3420] y: [16]\n                        Clone at x: [3600] y: [16]\n                        Clone at x: [3813] y: [16]\n                        Clone at x: [4026] y: [16]\n                        Clone at x: [4239] y: [16]\n                        Clone at x: [4652] y: [16]\n                    end\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\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\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\nset [ghost v] effect to (30)\nset [color v] effect to (150)\nforever\n    switch costume to (costume24 v)\n    repeat (23)\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (23)\n        switch costume to ((costume [number v]) + (1))\n    end\nend\n\ndelete this clone\n\nrepeat (23)\n\nif <(SCROLL X) > [3000]> then\n    switch costume to (costume24 v)\n    repeat (23)\n        switch costume to ((costume [number v]) - (1))\n        wait (0.015) seconds\n    end\n    repeat (23)\n        wait (0.015) seconds\n        switch costume to ((costume [number v]) + (1))\n    end\nelse\nend\n\n@Sprite21\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 [exit v] to [reset]\nend\n\nbroadcast (Tick v) and wait\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [coins v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    set size to (100) %\n    hide\nelse\n    if <(LEVEL) = [2]> then\n        hide\n    else\n        if <(LEVEL) = [3]> then\n            hide\n        else\n            if <(LEVEL) = [4]> then\n                hide\n            else\n                if <(LEVEL) = [5]> then\n                    hide\n                else\n                    if <(LEVEL) = [6]> then\n                        show\n                        Clone at x: [1070] y: [-200]\n                        Clone at x: [1390] y: [-200]\n                        Clone at x: [1650] y: [-200]\n                        Clone at x: [1895] y: [-200]\n                        Clone at x: [2423] y: [-200]\n                        Clone at x: [2579] y: [-200]\n                        Clone at x: [2751] y: [-200]\n                        Clone at x: [2915] y: [-200]\n                        Clone at x: [3080] y: [-200]\n                    end\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\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\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\nset [ghost v] effect to (30)\nset [color v] effect to (150)\nforever\n    repeat (22)\n        switch costume to ((costume [number v]) + (1))\n    end\n    switch costume to (costume23 v)\n    repeat (22)\n        switch costume to ((costume [number v]) - (1))\n    end\n    wait (pick random (0) to (1.5)) seconds\nend\n\ndelete this clone\n\nrepeat (23)\n\nClone at x: [2784] y: [-175]\nClone at x: [2717] y: [-150]\n\n@Sprite22\n\nwhen flag clicked\nforever\n    \nend\n\nwhen flag clicked\nforever\n    if <(music) = [on]> then\n        set volume to (100) %\n        play sound [music v] until done\n    else\n        set volume to (0) %\n    end\nend\n\n@Sprite23\n\nwhen flag clicked\nhide\n\nwhen I receive [crystal v]\ncreate clone of (_myself_ v)\nwait (0.5) seconds\n\ngo to (cube v)\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nset [ghost v] effect to (30)\ngo to x: (123) y: (180)\nglide (0.3) secs to x: (124) y: (161)\ndelete this clone\n\nwhen [space v] key pressed\nset [mouse pointer v] to (join (mouse x) (join [, ] (mouse y)))\n\n@Sprite24\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    front layer\nend\n\ndefine front layer\nforever\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\nend\n\n