level editor! a platformer generator v.1.2

Instructions: \nhttps://scratch.mit.edu/projects/851921220/ vote for me!\ngo here to share your projects!!! and check other people's out too!\nhttps://scratch.mit.edu/discuss/topic/684959/?page=1#post-7238567 \nmilestone: 2K views\n\nhttps://scratch.mit.edu/studios/28715018/comments/\ncan we get this on featured??\n\nhi! welcome to level editor! rate this out of 10!\nhere's how it works: use the ''Load a level'' to use the levels that are broadcasted in the messages!\nclick ''new level'' to create a level! To save the level click ''save'' then where it looks like a bunch of random keys triple click then ctrl S to copy it then ctrl V to post it in the speech bubble! \nhttps://turbowarp.org/850546277 runs better\n100 likes and faves for new textures\n\n

@Stage\n\n@main-menu\n\nwhen I receive [tick v]\nif <(id) < [5]> then\n    go to [front v] layer\n    go [backward v] (1) layers\n    change y by (((0) - (y position)) / (5))\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (13)\n        change size by (((110) - (size)) / (8))\n    else\n        set [brightness v] effect to (0)\n        change size by (((100) - (size)) / (8))\n    end\nend\n\nwhen flag clicked\nset size to (100) %\nset [mode v] to [0]\nset [id v] to [0]\ncreate clone of (_myself_ v)\nset [id v] to [1]\ncreate clone of (_myself_ v)\nshow\nset [id v] to [99]\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\nend\n\nwhen I start as a clone\nset [@wait v] to [0]\nset size to (0) %\ngo to x: (0) y: (100)\nif <(id) = [0]> then\n    switch costume to (new v)\n    forever\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (hide v)\n            set [mode v] to [edit]\n            stop [this script v]\n        end\n    end\nelse\n    if <[1] = (id)> then\n        switch costume to (load v)\n        forever\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                broadcast (import v) and wait\n                if <(import) = [invalid]> then\n                    set [mode v] to [edit]\n                else\n                    set [mode v] to [preview]\n                end\n                broadcast (hide v)\n                stop [this script v]\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nwait (0.1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [hide v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\nwhen flag clicked\nforever\n    delete (4) of [save v]\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nwhen [timer v] > ((TIME) + (0.01))\ngo to [front v] layer\nshow\n\nwhen flag clicked\nforever\n    set [time v] to (timer)\nend\n\n@Select Block\n\nwhen flag clicked\nhide\nset size to (88) %\nset [@id v] to [0]\nrepeat (11)\n    change [@id v] by (1)\n    create clone of (_myself_ v)\nend\nset [@id v] to [e]\ncreate clone of (_myself_ v)\nset [@id v] to [null]\n\nwhen I receive [tick v]\nif <<(MODE) = [edit]> and <not <(@ID) = [null]>>> then\n    show\n    if <(@ID) = [1]> then\n        switch costume to (join [g] (((Theme Type) * (2)) + (1)))\n        go to x: (-215) y: (-165)\n    else\n        if <(@ID) = [2]> then\n            switch costume to (l0 v)\n            go to x: (-179) y: (-165)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                set [block # v] to [l]\n            end\n        else\n            if <(@ID) = [3]> then\n                switch costume to (w0 v)\n                go to x: (-143) y: (-165)\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    set [block # v] to [l]\n                end\n            else\n                if <(@ID) = [4]> then\n                    switch costume to (s1 v)\n                    go to x: (-108) y: (-165)\n                else\n                    if <(@ID) = [e]> then\n                        switch costume to (eraser v)\n                        go to x: (72) y: (-165)\n                    else\n                        if <(@ID) = [5]> then\n                            switch costume to (c1 v)\n                            go to x: (14) y: (-165)\n                        else\n                            if <(@ID) = [6]> then\n                                go to x: (42) y: (-165)\n                                if <[type v] contains [f]?> then\n                                    switch costume to (f2 v)\n                                else\n                                    switch costume to (f1 v)\n                                end\n                            else\n                                if <(@ID) = [7]> then\n                                    switch costume to (b1 v)\n                                    go to x: (-77) y: (-165)\n                                else\n                                    if <(@ID) = [8]> then\n                                        switch costume to (p1 v)\n                                        go to x: (-47) y: (-165)\n                                    else\n                                        if <(@ID) = [9]> then\n                                            switch costume to (n1 v)\n                                            go to x: (-16) y: (-165)\n                                        else\n                                            if <(@ID) = [10]> then\n                                                switch costume to (t1 v)\n                                                go to x: (102) y: (-165)\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [block # v] to (letter (1) of (costume [name v]))\n    end\n    if <(Block #) = (letter (1) of (costume [name v]))> then\n        set [ghost v] effect to (0)\n    else\n        if <touching (mouse-pointer v)?> then\n            set [ghost v] effect to (0)\n        else\n            set [ghost v] effect to (75)\n        end\n    end\nelse\n    hide\nend\n\nwhen I start as a clone\nset size to (88) %\ngo to [front v] layer\n\n@Mobile\n\nwhen flag clicked\ngo to x: (176) y: (91)\nshow\nset [ghost v] effect to (100)\nforever\n    if <<(Mobile User?) = [1]> and <(MODE) = [edit]>> then\n        show\n        set [size_velocity v] to (((size_velocity) * (0.77)) + (((100) - (size)) / (6)))\n        change size by (size_velocity)\n        change [ghost v] effect by (-10)\n        switch costume to (hitbox1 v)\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            set [mobile click? v] to [1]\n            switch costume to (main1 v)\n        else\n            switch costume to (hitbox2 v)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                set [mobile click? v] to [2]\n                switch costume to (main2 v)\n            else\n                switch costume to (hitbox3 v)\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    set [mobile click? v] to [3]\n                    switch costume to (main3 v)\n                else\n                    switch costume to (hitbox4 v)\n                    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                        set [mobile click? v] to [4]\n                        switch costume to (main4 v)\n                    else\n                        set [mobile click? v] to [0]\n                        switch costume to (main0 v)\n                    end\n                end\n            end\n        end\n    else\n        change [ghost v] effect by (10)\n        change size by (((0) - (size)) / (6))\n        if <(size) < [10]> then\n            hide\n        end\n    end\nend\n\n@Invalid\n\nwhen I receive [tick v]\ngo to [back v] layer\n\nwhen flag clicked\ngo to x: (0) y: (50)\nhide\n\nwhen I receive [invalid v]\nshow\nrepeat until <(y position) < [12]>\n    change y by (((11) - (y position)) / (6))\nend\nwait (2.5) seconds\nrepeat until <(y position) > [49.5]>\n    change y by (((y position) - (8)) / (5))\nend\nhide\n\n@Invalid2\n\nwhen I receive [tick v]\ngo to [back v] layer\n\nwhen flag clicked\ngo to x: (0) y: (50)\nhide\n\nwhen I receive [invalid v]\nshow\nrepeat until <(y position) < [12]>\n    change y by (((11) - (y position)) / (6))\nend\nwait (2.5) seconds\nrepeat until <(y position) > [49.5]>\n    change y by (((y position) - (8)) / (5))\nend\nhide\n\n@You Win!\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [win v]\ngo to x: (0) y: (120)\nset [ghost v] effect to (100)\nwait (0.2) seconds\nshow\nrepeat until <([abs v] of ((((-1) - (y position)) / (9)) + ((yvel) * (0.8))) ) < [0.03]>\n    set [yvel v] to ((((-1) - (y position)) / (10)) + ((yvel) * (0.84)))\n    change y by (yvel)\n    change [ghost v] effect by (-25)\nend\nwait until <mouse down?>\nset [play ▮▮ v] to [0]\nrepeat until <(y position) < [-150]>\n    change y by (((y position) - (6)) / (3))\n    change [ghost v] effect by (0)\nend\nhide\n\nwhen I receive [edit v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@sign_text\n\nwhen flag clicked\nshow\n\nwhen I receive [tick v]\nset [ghost v] effect to (100)\nif <(MODE) = [edit]> then\n    mouse\nelse\n    if <(MODE) = [play]> then\n        if <[collisons v] contains [n]?> then\n            go to x: ((item (item # of [n] in [collisons v]) of [x v]) - (SCROLL X)) y: ((item (item # of [n] in [collisons v]) of [y v]) - (SCROLL Y))\n            say (item (item # of [n] in [collisons v]) of [sign's text v])\n        else\n            say []\n        end\n    else\n        say []\n    end\nend\n\ndefine mouse\nset [c2 v] to [0]\nrepeat until <<(c2) > (length of [x v])> or <<((round (((mouse x) + (SCROLL X)) / (30))) * (30)) = (item (c2) of [x v])> and <((round (((mouse y) + (SCROLL Y)) / (30))) * (30)) = (item (c2) of [y v])>>>\n    change [c2 v] by (1)\nend\nif <(item (c2) of [sign's text v]) = []> then\n    say []\nelse\n    go to x: ((item (c2) of [x v]) - (SCROLL X)) y: ((item (c2) of [y v]) - (SCROLL Y))\n    say (item (c2) of [sign's text v])\n    if <<key (e v) pressed?> and <(ASK_WAIT) = [0]>> then\n        set [ask_wait v] to [1]\n        set [sign # v] to (c2)\n        broadcast (rename v)\n    end\nend\nif <key (1 v) pressed?> then\n    set [block # v] to [g]\nelse\n    if <key (2 v) pressed?> then\n        set [block # v] to [l]\n    else\n        if <key (3 v) pressed?> then\n            set [block # v] to [w]\n        else\n            if <key (4 v) pressed?> then\n                set [block # v] to [s]\n            else\n                if <key (5 v) pressed?> then\n                    set [block # v] to [b]\n                else\n                    if <key (6 v) pressed?> then\n                        set [block # v] to [p]\n                    else\n                        if <key (7 v) pressed?> then\n                            set [block # v] to [n]\n                        else\n                            if <key (8 v) pressed?> then\n                                set [block # v] to [c]\n                            else\n                                if <key (9 v) pressed?> then\n                                    set [block # v] to [f]\n                                else\n                                    if <key (0 v) pressed?> then\n                                        set [block # v] to [e]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <key (r v) pressed?> then\n    set [scroll x v] to [0]\n    set [scroll y v] to [30]\nend\nstop [this script v]\n\n@buttons\n\nwhen flag clicked\nset [@id v] to [1]\ncreate clone of (_myself_ v)\nset [@id v] to [3]\ncreate clone of (_myself_ v)\nset [@id v] to [m]\ncreate clone of (_myself_ v)\nset [@id v] to [u]\ncreate clone of (_myself_ v)\nset [@id v] to [r]\ncreate clone of (_myself_ v)\nset [@id v] to [2]\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (save v)\n    if <(MODE) = [edit]> then\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (export v) and wait\n            wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n        end\n    end\nend\n\nwhen I start as a clone\nshow\nset size to (100) %\ngo to [front v] layer\nif <(@ID) = [3]> then\n    forever\n        if <(MODE) = [play]> then\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                set [click v] to [1]\n                broadcast (edit v) and wait\n            else\n                set [click v] to [0]\n            end\n        else\n            if <(MODE) = [edit]> then\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    broadcast (play v) and wait\n                end\n            end\n        end\n    end\nelse\n    if <(@ID) = [1]> then\n        switch costume to (load v)\n        forever\n            if <(MODE) = [edit]> then\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    broadcast (import v) and wait\n                    wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n                end\n            end\n        end\n    else\n        if <(@ID) = [m]> then\n            switch costume to (menu v)\n            forever\n                if <(MODE) = [edit]> then\n                    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                        if <(round ([x vel v] of [menu v])) = [0]> then\n                            set [ui menu 2 v] to ((1) - (UI MENU 2))\n                            wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n                        end\n                    end\n                else\n                    set [ui menu 2 v] to [0]\n                end\n            end\n        else\n            if <(@ID) = [u]> then\n                switch costume to (undo v)\n                forever\n                    if <(MODE) = [edit]> then\n                        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                            broadcast (undo v) and wait\n                            wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n                        end\n                    end\n                end\n            else\n                if <(@ID) = [r]> then\n                    switch costume to (redo v)\n                    forever\n                        if <(MODE) = [edit]> then\n                            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                                broadcast (redo v) and wait\n                                wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <(@ID) = [3]> then\n    if <(MODE) = [play]> then\n        show\n        switch costume to (return v)\n    else\n        if <(MODE) = [edit]> then\n            show\n            switch costume to (play v)\n        else\n            hide\n        end\n    end\nelse\n    if <(MODE) = [edit]> then\n        show\n    else\n        hide\n    end\nend\nif <touching (mouse-pointer v)?> then\n    set [brightness v] effect to (4)\nelse\n    set [brightness v] effect to (0)\nend\nif <(@ID) = [u]> then\n    if <(history_current) > [1]> then\n        switch costume to (undo v)\n    else\n        switch costume to (undo2 v)\n        set [brightness v] effect to (0)\n    end\nelse\n    if <(@ID) = [r]> then\n        if <(history_current) < (length of [history v])> then\n            switch costume to (redo v)\n        else\n            switch costume to (redo2 v)\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\n@fade\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [tick v]\ngo to [front v] layer\n\nwhen I receive [play v]\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [mode v] to [play]\nwait (0.3) seconds\nbroadcast (mode v)\nwait (0.1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [edit v]\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [mode v] to [edit]\nwait (0.3) seconds\nbroadcast (mode v)\nwait (0.1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [preview v]\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [mode v] to [preview]\nwait (0.7) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@Border\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nforever\n    go to [back v] layer\nend\n\nwhen I receive [tick v]\nif <(MODE) = [edit]> then\n    switch costume to (edit v)\n    show\nelse\n    switch costume to (edit2 v)\n    show\nend\n\n@menu\n\nwhen flag clicked\nset [ui menu 2 v] to [0]\nset [mobile user? v] to [0]\ngo to x: (-100) y: (0)\nshow\nswitch costume to (menu v)\nset [@id v] to [0]\ncreate clone of (_myself_ v)\nset [@id v] to [1]\ncreate clone of (_myself_ v)\nset [@id v] to [2]\ncreate clone of (_myself_ v)\nset [@id v] to [99]\nforever\n    go to [back v] layer\nend\n\nwhen I receive [tick v]\nif <(UI MENU 2) = [1]> then\n    set [x vel v] to ((((30) - (x position)) / (9)) + ((x vel) * (0.74)))\nelse\n    set [x vel v] to (((-100) - (x position)) / (5))\nend\nchange x by (x vel)\nif <(MODE) = [edit]> then\n    show\nelse\n    hide\nend\nif <touching (mouse-pointer v)?> then\n    set [brightness v] effect to (15)\nelse\n    set [brightness v] effect to (0)\nend\n\nwhen I start as a clone\ngo to [back v] layer\nif <(@id) = [0]> then\n    switch costume to (delete all v)\n    forever\n        if <<<mouse down?> and <touching (mouse-pointer v)?>> and <(MODE) = [edit]>> then\n            broadcast (delete all v) and wait\n            wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n        end\n    end\nelse\n    if <(@id) = [1]> then\n        switch costume to (mobile 0 v)\n        forever\n            switch costume to (join [Mobile ] (Mobile User?))\n            if <<(MODE) = [edit]> and <<mouse down?> and <touching (mouse-pointer v)?>>> then\n                set [mobile user? v] to ((1) - (Mobile User?))\n                switch costume to (join [Mobile ] (Mobile User?))\n                wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n            end\n        end\n    else\n        if <(@id) = [2]> then\n            switch costume to (go to x&y v)\n            forever\n                if <<(MODE) = [edit]> and <<mouse down?> and <touching (mouse-pointer v)?>>> then\n                    broadcast (go to v) and wait\n                    wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                end\n            end\n        end\n    end\nend\n\n@Preview\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\n    wait (0) seconds\nend\n\nwhen I receive [tick v]\nif <(MODE) = [preview]> then\n    set y to (-17)\n    change [ghost v] effect by (-10)\n    set size to (100) %\nelse\n    change y by (((-6) - (y position)) / (4))\n    switch costume to (sizer v)\n    if <(MODE) = [play]> then\n        change size by (((230) - (size)) / (12))\n        if <(size) > [216]> then\n            change [ghost v] effect by (20)\n        end\n    else\n        change size by (((175) - (size)) / (11))\n        if <(size) > [173]> then\n            change [ghost v] effect by (10)\n        end\n    end\n    switch costume to (border v)\nend\n\n@Preview \n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nswitch costume to (edit v)\nset [ghost v] effect to (100)\ncreate clone of (_myself_ v)\nforever\n    if <(MODE) = [preview]> then\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [mode v] to [edit]\n        end\n    end\nend\n\nwhen I start as a clone\nswitch costume to (play v)\nforever\n    if <(MODE) = [preview]> then\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [mode v] to [play]\n        end\n    end\nend\n\nwhen I receive [tick v]\ngo to [front v] layer\ngo [backward v] (1) layers\nif <(MODE) = [preview]> then\n    set y to (0)\n    change [ghost v] effect by (-10)\nelse\n    change y by (((y position) - (80)) / (12))\n    if <(y position) = [-49]> then\n        set [ghost v] effect to (100)\n    end\nend\nif <not <(MODE) = [play]>> then\n    set [previous settings v] to (MODE)\nend\nif <touching (mouse-pointer v)?> then\n    set [brightness v] effect to (25)\nelse\n    set [brightness v] effect to (0)\nend\n\n@Blocks\n\nwhen flag clicked\nset [timer v] to [0]\nset [pause ▶ v] to [0]\nset [history_current v] to [1]\nhide\nset rotation style [all around v]\nshow list [save v]\ndelete all of [history v]\ndelete all of [x v]\ndelete all of [y v]\ndelete all of [type v]\ndelete all of [c v]\ndelete all of [sign's text v]\nadd [] to [sign's text v]\nadd [0] to [x v]\nadd [-30] to [y v]\nadd [g] to [type v]\nadd [1] to [c v]\nadd [0] to [x v]\nadd [0] to [y v]\nadd [c] to [type v]\nadd [1] to [c v]\nadd [] to [sign's text v]\nset [ask_wait v] to [0]\nset [block # v] to [g]\nset [theme type v] to [0]\nBlock Costume # [1]\nSave\nadd (Save Level Code) to [history v]\nset [history_current v] to (length of [history v])\n\nwhen I receive [tick v]\nTICK - BLOCKS\nstop [this script v]\n\ndefine TICK - BLOCKS\nif <(Pause ▶) = [0]> then\n    erase all\n    if <<(MODE) = [edit]> and <mouse down?>> then\n        if <(Block #) = [e]> then\n            Remove Block At X&Y ((round (((mouse x) + (SCROLL X)) / (30))) * (30)) ((round (((mouse y) + (SCROLL Y)) / (30))) * (30))\n        else\n            Add Block At X&Y ((round (((mouse x) + (SCROLL X)) / (30))) * (30)) ((round (((mouse y) + (SCROLL Y)) / (30))) * (30))\n        end\n    end\n    BLOCKS\n    Mouse Curser\nend\nchange [timer v] by (0.3)\n\ndefine BLOCKS\nclear graphic effects\nset size to (100) %\nset [counter1 v] to [0]\nrepeat (length of [x v])\n    change [counter1 v] by (1)\n    if <<([abs v] of ((item (counter1) of [x v]) - (SCROLL X)) ) < [255]> and <([abs v] of ((item (counter1) of [y v]) - (SCROLL Y)) ) < [195]>> then\n        switch costume to (blank v)\n        go to x: ((item (counter1) of [x v]) - (SCROLL X)) y: ((item (counter1) of [y v]) - (SCROLL Y))\n        Set Costume # (item (counter1) of [type v]) (item (counter1) of [c v])\n        stamp\n    end\nend\n\ndefine Add Block At X&Y (x) (y)\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nshow\nif <<<<<<<<<(ASK_WAIT) = [1]> or <touching (main-menu v)?>> or <<[type v] contains [f]?> and <(Block #) = [f]>>> or <touching (mobile v)?>> or <touching (current block v)?>> or <touching (border v)?>> or <touching (menu v)?>> or <touching (preview v)?>> or <touching (ui v)?>> then\n    hide\n    stop [this script v]\nend\nhide\nset [counter3 v] to [0]\nrepeat (length of [x v])\n    change [counter3 v] by (1)\n    if <<(item (counter3) of [x v]) = (x)> and <(item (counter3) of [y v]) = (y)>> then\n        stop [this script v]\n    end\nend\nif <(Block #) = [n]> then\n    add [] to [sign's text v]\n    add (x) to [x v]\n    add (y) to [y v]\n    add (Block #) to [type v]\n    add [1] to [c v]\n    Block Costume # (length of [x v])\n    set [sign_length v] to (length of [x v])\n    set [ask_wait v] to [1]\n    broadcast (sign v)\nelse\n    add [] to [sign's text v]\n    add (x) to [x v]\n    add (y) to [y v]\n    add (Block #) to [type v]\n    add [1] to [c v]\n    Block Costume # (length of [x v])\n    Save\n    add (Save Level Code) to [history v]\n    set [history_current v] to (length of [history v])\nend\n\ndefine Block Costume # (val)\nif <(item (val) of [type v]) = [p]> then\n    set [counter4 v] to [0]\n    repeat (length of [x v])\n        change [counter4 v] by (1)\n        if <<<(item (counter4) of [x v]) = (item (val) of [x v])> and <(item (counter4) of [y v]) = ((item (val) of [y v]) + (-30))>> and <(item (counter4) of [type v]) = [p]>> then\n            replace item (val) of [c v] with [0]\n        end\n    end\n    set [counter4 v] to [0]\n    repeat (length of [x v])\n        change [counter4 v] by (1)\n        if <<<(item (counter4) of [x v]) = (item (val) of [x v])> and <(item (counter4) of [y v]) = ((item (val) of [y v]) - (-30))>> and <(item (counter4) of [type v]) = [p]>> then\n            replace item (counter4) of [c v] with [0]\n        end\n    end\nelse\n    if <(item (val) of [type v]) = [b]> then\n        set [counter4 v] to [0]\n        repeat (length of [x v])\n            change [counter4 v] by (1)\n            if <<<(item (counter4) of [x v]) = (item (val) of [x v])> and <(item (counter4) of [y v]) = ((item (val) of [y v]) + (30))>> and <(item (counter4) of [type v]) = [b]>> then\n                replace item (val) of [c v] with [0]\n            end\n        end\n        set [counter4 v] to [0]\n        repeat (length of [x v])\n            change [counter4 v] by (1)\n            if <<<(item (counter4) of [x v]) = (item (val) of [x v])> and <(item (counter4) of [y v]) = ((item (val) of [y v]) - (30))>> and <(item (counter4) of [type v]) = [b]>> then\n                replace item (counter4) of [c v] with [0]\n            end\n        end\n    else\n        set [counter4 v] to [0]\n        repeat (length of [x v])\n            change [counter4 v] by (1)\n            if <<<(item (counter4) of [x v]) = (item (val) of [x v])> and <(item (counter4) of [y v]) = ((item (val) of [y v]) + (30))>> and <not < [ersfcpbn] contains (item (counter4) of [type v])?>>> then\n                replace item (val) of [c v] with [0]\n            end\n        end\n        set [counter4 v] to [0]\n        repeat (length of [x v])\n            change [counter4 v] by (1)\n            if <<<(item (counter4) of [x v]) = (item (val) of [x v])> and <(item (counter4) of [y v]) = ((item (val) of [y v]) - (30))>> and <<not < [ersfcn] contains (item (val) of [type v])?>> and <not < [pb] contains (item (counter4) of [type v])?>>>> then\n                replace item (counter4) of [c v] with [0]\n            end\n        end\n    end\nend\n\ndefine Set Costume # (val) (val 2)\nif <(val) = [g]> then\n    switch costume to (join (val) (((Theme Type) * (2)) + (val 2)))\nelse\n    if <<(val) = [l]> or <(val) = [w]>> then\n        switch costume to (join (val) ((val 2) + <(join ((round ((TIMER) * (6))) mod (2)) (val 2)) = [1]>))\n    else\n        if <(val) = [s]> then\n            switch costume to (s1 v)\n        else\n            if <(val) = [f]> then\n                if <<(counter1) = (Checkpoint #)> and <not <(MODE) = [edit]>>> then\n                    switch costume to (f0 v)\n                else\n                    switch costume to (f1 v)\n                end\n            else\n                if <(val) = [b]> then\n                    switch costume to (join [b] (val 2))\n                else\n                    if <(val) = [p]> then\n                        switch costume to (join [p] (val 2))\n                    else\n                        if <(val) = [n]> then\n                            switch costume to (n1 v)\n                        else\n                            if <(val) = [c]> then\n                                if <<(counter1) = (Checkpoint #)> and <not <(MODE) = [edit]>>> then\n                                    switch costume to (c0 v)\n                                else\n                                    switch costume to (c1 v)\n                                end\n                            else\n                                if <(val) = [t]> then\n                                    switch costume to (t1 v)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Mouse Curser\nif <<(MODE) = [edit]> and <(ASK_WAIT) = [0]>> then\n    if <(Block #) = [e]> then\n        switch costume to (e v)\n        go to (mouse-pointer v)\n        set [ghost v] effect to (30)\n        stamp\n    else\n        go to x: (((round (((mouse x) + (SCROLL X)) / (30))) * (30)) - (SCROLL X)) y: (((round (((mouse y) + (SCROLL Y)) / (30))) * (30)) - (SCROLL Y))\n        set size to (99) %\n        if <(Block #) = [g]> then\n            switch costume to (join [g] ((Theme Type) * (2)))\n        else\n            if <<(Block #) = [l]> or <(Block #) = [w]>> then\n                switch costume to (join (Block #) [0])\n            else\n                if <(Block #) = [s]> then\n                    switch costume to (s1 v)\n                else\n                    if <(Block #) = [f]> then\n                        switch costume to (f1 v)\n                        if <[type v] contains [f]?> then\n                            stop [this script v]\n                        end\n                    else\n                        if <(Block #) = [c]> then\n                            switch costume to (c1 v)\n                        else\n                            if <(Block #) = [b]> then\n                                switch costume to (b1 v)\n                            else\n                                if <(Block #) = [p]> then\n                                    switch costume to (p1 v)\n                                else\n                                    if <(Block #) = [n]> then\n                                        switch costume to (n1 v)\n                                    else\n                                        if <(Block #) = [t]> then\n                                            switch costume to (t1 v)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        set [counter5 v] to [0]\n        repeat (length of [x v])\n            change [counter5 v] by (1)\n            if <<(item (counter5) of [x v]) = ((round (((mouse x) + (SCROLL X)) / (30))) * (30))> and <(item (counter5) of [y v]) = ((round (((mouse y) + (SCROLL Y)) / (30))) * (30))>> then\n                stop [this script v]\n            end\n        end\n        set [ghost v] effect to (50)\n        stamp\n    end\nend\n\ndefine Remove Block At X&Y (x) (y)\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nshow\nif <<<<<<<<touching (mobile v)?> or <(ASK_WAIT) = [1]>> or <touching (current block v)?>> or <touching (border v)?>> or <touching (menu v)?>> or <touching (preview v)?>> or <touching (ui v)?>> or <<[0] = (x)> and <<[0] = (y)> or <[-30] = (y)>>>> then\n    hide\n    stop [this script v]\nend\nhide\nset [counter0 v] to [1]\nrepeat until <<(counter0) > (length of [x v])> or <<(item (counter0) of [x v]) = (x)> and <(item (counter0) of [y v]) = (y)>>>\n    change [counter0 v] by (1)\nend\nset [erased_ground? v] to [0]\nif <<(item (counter0) of [x v]) = (x)> and <(item (counter0) of [y v]) = (y)>> then\n    set [erased_ground? v] to [1]\n    set [deleted_type v] to (item (counter0) of [type v])\n    delete (counter0) of [x v]\n    delete (counter0) of [y v]\n    delete (counter0) of [type v]\n    delete (counter0) of [c v]\n    delete (counter0) of [sign's text v]\nend\nset [counter0 v] to [1]\nif <(deleted_type) = [p]> then\n    repeat until <<(counter0) > (length of [x v])> or <<(item (counter0) of [x v]) = (x)> and <(item (counter0) of [y v]) = ((y) + (30))>>>\n        change [counter0 v] by (1)\n    end\nelse\n    repeat until <<(counter0) > (length of [x v])> or <<(item (counter0) of [x v]) = (x)> and <((item (counter0) of [y v]) + (30)) = (y)>>>\n        change [counter0 v] by (1)\n    end\nend\nreplace item (counter0) of [c v] with [1]\nif <(erased_ground?) = [1]> then\n    Save\n    add (Save Level Code) to [history v]\n    set [history_current v] to (length of [history v])\nend\n\ndefine Save\nset [c2 v] to [0]\nset [save level code v] to (join (join (Theme Type) (Wall Jump?)) [{])\nrepeat (length of [x v])\n    change [c2 v] by (1)\n    set [save level code v] to (join (Save Level Code) ((item (c2) of [x v]) / (30)))\n    set [save level code v] to (join (Save Level Code) [}])\nend\nset [save level code v] to (join (Save Level Code) [{])\nset [c2 v] to [0]\nrepeat (length of [x v])\n    change [c2 v] by (1)\n    set [save level code v] to (join (Save Level Code) ((item (c2) of [y v]) / (30)))\n    set [save level code v] to (join (Save Level Code) [}])\nend\nset [save level code v] to (join (Save Level Code) [{])\nset [c2 v] to [0]\nrepeat (length of [x v])\n    change [c2 v] by (1)\n    set [save level code v] to (join (Save Level Code) (item (c2) of [type v]))\n    set [save level code v] to (join (Save Level Code) [}])\nend\nset [save level code v] to (join (Save Level Code) [{])\nset [c2 v] to [0]\nrepeat (length of [x v])\n    change [c2 v] by (1)\n    set [save level code v] to (join (Save Level Code) (item (c2) of [c v]))\n    set [save level code v] to (join (Save Level Code) [}])\nend\nset [save level code v] to (join (Save Level Code) [{])\nset [c2 v] to [0]\nrepeat (length of [x v])\n    change [c2 v] by (1)\n    set [save level code v] to (join (Save Level Code) (item (c2) of [sign's text v]))\n    set [save level code v] to (join (Save Level Code) [}])\nend\nset [save level code v] to (join (Save Level Code) [{])\n\ndefine Load (i)\nset [c2 v] to [4]\ndelete all of [x v]\nrepeat until <(letter (c2) of (i)) = [{]>\n    set [c3 v] to []\n    repeat until <(letter (c2) of (i)) = [}]>\n        set [c3 v] to (join (c3) (letter (c2) of (i)))\n        change [c2 v] by (1)\n        if <(c2) > (length of (i))> then\n            set [import v] to [invalid]\n            stop [this script v]\n        end\n    end\n    add ((c3) * (30)) to [x v]\n    change [c2 v] by (1)\nend\nchange [c2 v] by (1)\ndelete all of [y v]\nrepeat until <(letter (c2) of (i)) = [{]>\n    set [c3 v] to []\n    repeat until <(letter (c2) of (i)) = [}]>\n        set [c3 v] to (join (c3) (letter (c2) of (i)))\n        change [c2 v] by (1)\n        if <(c2) > (length of (i))> then\n            set [import v] to [invalid]\n            stop [this script v]\n        end\n    end\n    add ((c3) * (30)) to [y v]\n    change [c2 v] by (1)\nend\nchange [c2 v] by (1)\ndelete all of [type v]\nrepeat until <(letter (c2) of (i)) = [{]>\n    set [c3 v] to (letter (c2) of (i))\n    add (c3) to [type v]\n    change [c2 v] by (2)\n    if <(c2) > (length of (i))> then\n        set [import v] to [invalid]\n        stop [this script v]\n    end\nend\nchange [c2 v] by (1)\ndelete all of [c v]\nrepeat until <(letter (c2) of (i)) = [{]>\n    set [c3 v] to (letter (c2) of (i))\n    add (c3) to [c v]\n    change [c2 v] by (2)\n    if <(c2) > (length of (i))> then\n        set [import v] to [invalid]\n        stop [this script v]\n    end\nend\nchange [c2 v] by (1)\ndelete all of [sign's text v]\nrepeat until <(letter (c2) of (i)) = [{]>\n    set [c3 v] to []\n    repeat until <(letter (c2) of (i)) = [}]>\n        set [c3 v] to (join (c3) (letter (c2) of (i)))\n        change [c2 v] by (1)\n        if <(c2) > (length of (i))> then\n            set [import v] to [invalid]\n            stop [this script v]\n        end\n    end\n    add (c3) to [sign's text v]\n    change [c2 v] by (1)\nend\nif <not <(length of [x v]) = (length of [y v])>> then\n    set [import v] to [invalid]\n    stop [this script v]\nend\n\nwhen I receive [redo v]\nif <<(history_current) < (length of [history v])> and <(ASK_WAIT) = [0]>> then\n    change [history_current v] by (1)\n    Load (item (history_current) of [history v])\nend\n\nwhen I receive [undo v]\nif <<(history_current) > [1]> and <(ASK_WAIT) = [0]>> then\n    change [history_current v] by (-1)\n    Load (item (history_current) of [history v])\nend\n\nwhen I receive [export v]\nSave\ndelete all of [save v]\nadd [Click 4 times \(Triple-Click\) to highlight it, then copy it \(ctrl+c\)] to [save v]\nadd (Save Level Code) to [save v]\nif <(length of (Save Level Code)) < [501]> then\n    add [Next paste \(ctrl+v\) it in the comments! ] to [save v]\nelse\n    add [If, your code is too long to fit in a comment, post it here:] to [save v]\n    add [https://scratch.mit.edu/discuss/topic/564309/] to [save v]\n    add [Your code is separated below so you can fit in multiple comments:] to [save v]\n    Separate Blocks\n    if <(length of [save v]) > [9]> then\n        repeat (4)\n            add [] to [save v]\n        end\n    end\nend\nhide list [save v]\nask [Paste your code here to confirm that you copied the whole thing:] and wait\nif <<not <(answer) = (item (2) of [save v])>> or <not <(answer) = (join (item (2) of [save v]) [ 3])>>> then\n    repeat until <<(answer) = (join (item (2) of [save v]) [ 3])> or <(answer) = (item (2) of [save v])>>\n        ask [You didn’t copy the entire code! Remember to triple click on the code, and copy it. Try again:] and wait\n    end\nend\nshow list [save v]\n\nwhen I receive [import v]\nask [Paste your code below:] and wait\nif <not <(answer) = []>> then\n    set [pause ▶ v] to [1]\n    set [import v] to (answer)\n    Load (import)\n    if <(import) = [invalid]> then\n        set [pause ▶ v] to [0]\n        Load (item (length of [history v]) of [history v])\n        broadcast (invalid v)\n    else\n        broadcast (preview v)\n        set [theme type v] to (letter (1) of (import))\n        set [wall jump? v] to (letter (2) of (import))\n        add (import) to [history v]\n        set [history_current v] to (length of [history v])\n        wait until <(MODE) = [preview]>\n        set [pause ▶ v] to [0]\n    end\nend\n\nwhen I receive [delete all v]\nif <(length of [x v]) > [2]> then\n    delete all of [c v]\n    delete all of [x v]\n    delete all of [y v]\n    delete all of [type v]\n    add [0] to [x v]\n    add [-30] to [y v]\n    add [g] to [type v]\n    add [1] to [c v]\n    add [0] to [x v]\n    add [0] to [y v]\n    add [c] to [type v]\n    add [1] to [c v]\n    Save\n    add (Save Level Code) to [history v]\n    set [history_current v] to (length of [history v])\nend\n\ndefine Separate Blocks\nset [i2 v] to [0]\nrepeat until <(i2) > (length of (Save Level Code))>\n    set [i3 v] to []\n    repeat (500)\n        change [i2 v] by (1)\n        if <(i2) > (length of (Save Level Code))> then\n            add (i3) to [save v]\n            stop [this script v]\n        end\n        set [i3 v] to (join (i3) (letter (i2) of (Save Level Code)))\n    end\n    add (i3) to [save v]\nend\n\nwhen I receive [go to v]\nask [Enter X Position:] and wait\nif <not <(answer) = []>> then\n    set [scroll x v] to (round (answer))\nend\nask [Enter Y Position:] and wait\nif <not <(answer) = []>> then\n    set [scroll y v] to (round (answer))\nend\n\nwhen I receive [sign v]\nask [Enter the text for the sign.] and wait\nif <(answer) = []> then\n    delete (sign_length) of [sign's text v]\n    delete (sign_length) of [x v]\n    delete (sign_length) of [y v]\n    delete (sign_length) of [type v]\n    delete (sign_length) of [c v]\nelse\n    replace item (sign_length) of [sign's text v] with (answer)\n    Save\n    add (Save Level Code) to [history v]\n    set [history_current v] to (length of [history v])\nend\nset [ask_wait v] to [0]\n\nwhen I receive [rename v]\nask [What do you want to rename the sign to?] and wait\nif <not <(answer) = []>> then\n    replace item (Sign #) of [sign's text v] with (answer)\n    Save\n    add (Save Level Code) to [history v]\n    set [history_current v] to (length of [history v])\nend\nset [ask_wait v] to [0]\n\nwhen flag clicked\nforever\n    point in direction (90)\nend\n\n@Player\n\ndefine tick-play\ngo to [back v] layer\nif <<<key (right arrow v) pressed?> or <<<mouse down?> and <(mouse x) > ((x position) + (20))>> or <key (d v) pressed?>>> and <(Click) = [0]>> then\n    if <(Play ▮▮) = [0]> then\n        if <[collisons v] contains [w]?> then\n            change [x y v] by (0.7)\n        else\n            change [x y v] by (1.2)\n        end\n    end\nelse\n    if <<<key (left arrow v) pressed?> or <<<mouse down?> and <(mouse x) < ((x position) - (20))>> or <key (a v) pressed?>>> and <(Click) = [0]>> then\n        if <(Play ▮▮) = [0]> then\n            if <[collisons v] contains [w]?> then\n                change [x y v] by (-0.7)\n            else\n                change [x y v] by (-1.2)\n            end\n        end\n    end\nend\nif <[collisons v] contains [w]?> then\n    if <<key (up arrow v) pressed?> or <<<mouse down?> and <(mouse y) > ((y position) + (10))>> or <key (w v) pressed?>>> then\n        if <(Play ▮▮) = [0]> then\n            set [yv v] to [5.5]\n        end\n    end\n    change [yv v] by (-1)\n    set [yv v] to ((YV) * (0.76))\nelse\n    if <<<key (up arrow v) pressed?> or <<<mouse down?> and <(mouse y) > ((y position) + (20))>> or <key (w v) pressed?>>> and <(Click) = [0]>> then\n        if <(in air) < [4]> then\n            if <(Play ▮▮) = [0]> then\n                set [yv v] to [9]\n            end\n        end\n    end\n    change [yv v] by (-0.82)\nend\nset [x y v] to ((X Y) * (0.73))\nif <(YV) < [-13]> then\n    set [yv v] to [-13]\nend\nchange x by (round ((X Y) * (1.4)))\nchange y by (round (YV))\nchange [scroll x v] by (round (((Offset X) - (SCROLL X)) / (7)))\nchange [scroll y v] by ((round (((Offset Y) - (SCROLL Y)) / (5))) + (2))\nif <(SCROLL Y) < [-88]> then\n    set [scroll y v] to [-88]\nend\nposition\nif <<<[collisons v] contains [s]?> or <[collisons v] contains [l]?>> or <<(Offset Y) < [-430]> or <[collisons v] contains [t]?>>> then\n    reset\nend\nif <[collisons v] contains [b]?> then\n    set [yv v] to [14]\nelse\n    if <[collisons v] contains [p]?> then\n        set [yv v] to [-10]\n    end\nend\nif <[collisons v] contains [c]?> then\n    set [checkpoint # v] to (item # of [c] in [collisons v])\nelse\n    if <[collisons v] contains [f]?> then\n        set [checkpoint # v] to (item # of [f] in [collisons v])\n    end\nend\ncollision test\n\ndefine change y by (sy)\nchange [offset y v] by (sy)\nchange [in air v] by (1)\nif <<[collisons v] contains [p]?> and <(sy) > [0]>> then\n    change [offset y v] by ((0) - (sy))\nend\nposition\nrepeat until <not <[collisons v] contains [g]?>>\n    if <(sy) > [0]> then\n        change [offset y v] by (-1)\n    else\n        change [offset y v] by (1)\n        set [in air v] to [0]\n    end\n    position\n    set [yv v] to [0]\nend\n\ndefine change x by (sx)\nchange [offset x v] by (sx)\nposition\nif <[collisons v] contains [g]?> then\n    repeat (10)\n        change [offset y v] by (0.5)\n        position\n        if <not <[collisons v] contains [g]?>> then\n            stop [this script v]\n        end\n    end\n    change [offset y v] by (-5)\n    repeat until <not <[collisons v] contains [g]?>>\n        if <(sx) < [0]> then\n            change [offset x v] by (1)\n        else\n            change [offset x v] by (-1)\n        end\n        position\n        set [x y v] to [0]\n    end\n    if <(Wall Jump?) = [1]> then\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>> then\n            if <(Play ▮▮) = [0]> then\n                if <[collisons v] contains [w]?> then\n            end\n        end\n    end\nend\n\ndefine position\ngo to x: ((Offset X) - (SCROLL X)) y: ((Offset Y) - (SCROLL Y))\ncollision test\n\ndefine collision test\ndelete all of [collisons v]\nset [c1 v] to [0]\nrepeat (length of [type v])\n    add [0] to [collisons v]\n    change [c1 v] by (1)\n    if <(item (C1) of [type v]) = [s]> then\n        if <<<not <((item (C1) of [x v]) - (-17.5)) < (Offset X)>> and <((item (C1) of [y v]) - (23.5)) < (Offset Y)>> and <<not <((item (C1) of [y v]) - (-9.5)) < (Offset Y)>> and <((item (C1) of [x v]) - (17.5)) < (Offset X)>>> then\n            replace item (C1) of [collisons v] with (item (C1) of [type v])\n        end\n    else\n        if <<<not <((item (C1) of [x v]) - (-24.5)) < (Offset X)>> and <((item (C1) of [y v]) - (23.5)) < (Offset Y)>> and <<not <((item (C1) of [y v]) - (-23.5)) < (Offset Y)>> and <((item (C1) of [x v]) - (24.5)) < (Offset X)>>> then\n            replace item (C1) of [collisons v] with (item (C1) of [type v])\n        end\n    end\nend\n\ndefine Tick-edit\ngo to [back v] layer\nclear graphic effects\nswitch costume to (player v)\nposition\nchange [scroll x v] by ((<<<(Mobile Click?) = [2]> or <key (right arrow v) pressed?>> or <key (d v) pressed?>> - <<<(Mobile Click?) = [4]> or <key (left arrow v) pressed?>> or <key (a v) pressed?>>) * (4))\nchange [scroll y v] by ((<<<(Mobile Click?) = [1]> or <key (up arrow v) pressed?>> or <key (w v) pressed?>> - <<<(Mobile Click?) = [3]> or <key (down arrow v) pressed?>> or <key (s v) pressed?>>) * (4))\nif <(SCROLL Y) < [-88]> then\n    set [scroll y v] to [-88]\nend\nset [play ▮▮ v] to [0]\nset [wined? v] to [0]\n\nwhen I receive [tick v]\nif <(MODE) = [edit]> then\n    Tick-edit\nelse\n    if <(MODE) = [preview]> then\n        go to [back v] layer\n        set [scroll x v] to [0]\n        set [scroll y v] to [35]\n        set [offset x v] to [0]\n        set [offset y v] to [-5]\n        set [yv v] to [0]\n        set [x y v] to [0]\n        set [in air v] to [0]\n        set [play ▮▮ v] to [0]\n        set [wined? v] to [0]\n        position\n    else\n        if <(MODE) = [play]> then\n            repeat (1)\n                tick-play\n            end\n        end\n    end\nend\n\nwhen I receive [start! v]\nforever\n    broadcast (Tick v)\nend\n\ndefine reset\nset [play ▮▮ v] to [0]\nset [yv v] to [0]\nset [x y v] to [0]\nset [in air v] to [0]\nif <(MODE) = [play]> then\n    set [scroll x v] to (item (Checkpoint #) of [x v])\n    set [scroll y v] to (item (Checkpoint #) of [y v])\n    set [offset x v] to (item (Checkpoint #) of [x v])\n    set [offset y v] to (item (Checkpoint #) of [y v])\nelse\n    set [scroll x v] to [0]\n    set [scroll y v] to [30]\n    set [offset x v] to [0]\n    set [offset y v] to [-5]\nend\n\nwhen flag clicked\nset [wined? v] to [0]\nreset\nset size to (60) %\npoint in direction (90)\nshow\nswitch costume to (player v)\nbroadcast (start! v)\n\nwhen I receive [mode v]\nreset\n\nwhen flag clicked\nforever\n    if <<<[collisons v] contains [f]?> and <(MODE) = [play]>> and <(Wined?) = [0]>> then\n        set [wined? v] to [1]\n        broadcast (win v)\n        set [play ▮▮ v] to [1]\n    end\nend\n\n@UI\n\nwhen flag clicked\nset [ui menu 1 v] to [0]\nset [wall jump? v] to [0]\ngo to x: (0) y: (0)\nset [@id v] to [1]\ncreate clone of (_myself_ v)\nset [@id v] to [2]\ncreate clone of (_myself_ v)\nset [@id v] to [c]\ncreate clone of (_myself_ v)\nset [@id v] to [0]\nforever\n    if <(MODE) = [edit]> then\n        show\n        switch costume to (join [Wall Jump] (Wall Jump?))\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (-4)\n            if <mouse down?> then\n                set [wall jump? v] to ((1) - (Wall Jump?))\n                switch costume to (join [Wall Jump] (Wall Jump?))\n                wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n            end\n        else\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\nwhen I start as a clone\nshow\nset size to (100) %\nif <(@ID) = [1]> then\n    switch costume to (theme v)\n    go to x: (0) y: (0)\n    go to [front v] layer\n    forever\n        if <(MODE) = [edit]> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-4)\n                if <<mouse down?> and <<(Y POS MENU) > [-0.6]> or <(Y POS MENU) < [-59.4]>>> then\n                    set [ui menu 1 v] to ((1) - (UI MENU 1))\n                    wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                end\n            else\n                set [brightness v] effect to (0)\n            end\n        else\n            set [ui menu 1 v] to [0]\n        end\n    end\nelse\n    if <(@ID) = [c]> then\n        switch costume to (cover v)\n    else\n        if <(@ID) = [2]> then\n            switch costume to (menu 0000 v)\n            set [y pos menu v] to [-60]\n            go to [back v] layer\n            forever\n                if <(MODE) = [edit]> then\n                    if <(UI MENU 1) = [1]> then\n                        change [y pos menu v] by (((20) - (Y POS MENU)) / (5))\n                    else\n                        change [y pos menu v] by (((-60) - (Y POS MENU)) / (5))\n                    end\n                    if <(Y POS MENU) > [-0.5]> then\n                        switch costume to (h0 v)\n                        if <touching (mouse-pointer v)?> then\n                            switch costume to (menu 1000 v)\n                            if <mouse down?> then\n                                set [theme type v] to [0]\n                            end\n                        else\n                            switch costume to (h1 v)\n                            if <touching (mouse-pointer v)?> then\n                                switch costume to (menu 0100 v)\n                                if <mouse down?> then\n                                    set [theme type v] to [1]\n                                end\n                            else\n                                switch costume to (h2 v)\n                                if <touching (mouse-pointer v)?> then\n                                    switch costume to (menu 0010 v)\n                                    if <mouse down?> then\n                                        set [theme type v] to [2]\n                                    end\n                                else\n                                    switch costume to (h3 v)\n                                    if <touching (mouse-pointer v)?> then\n                                        switch costume to (menu 0001 v)\n                                        if <mouse down?> then\n                                            set [theme type v] to [3]\n                                        end\n                                    else\n                                        switch costume to (menu 0000 v)\n                                    end\n                                end\n                            end\n                        end\n                    else\n                        switch costume to (menu 0000 v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <(MODE) = [edit]> then\n    show\n    if <(@ID) = [2]> then\n        go to x: (0) y: (Y POS MENU)\n    end\nelse\n    hide\nend\n\n@Blank\n\n