List Platformer Creator

Instructions: Hey! After creating my variable game, i decided that I wanted to revisit something I've always wanted to do: A list platformer level creator. So, here it is! Please Read the Instructions very carefully, for there are a lot of keys the you will need to know:\nspace = place block\np = toggle editor/play mode\ns = save\nl = load\nc(or green flag) = clear(in editor)\nm = switch material(or 1-4, 1 being ground, 2 being bouncy, 3 being spikes, and 4 being eraser(which are the 'X's ))\nArrow keys or WASD to move in play mode.\n\n\nAlso, since i'm using characters, here's a quick overview of what's what:\n'~' = Ground\n'=' = Bounce pad\n'∆' = Spike\nX = Eraser(in editor) \n\nThat's all, Thanks!

@Stage\n\ndefine convert (text) to list\ndelete all of [str v]\nset [letter # v] to [1]\nrepeat (length of (text))\n    add (letter (letter #) of (text)) to [str v]\n    change [letter # v] by (1)\nend\n\ndefine convert (list) to string\nset [str out v] to []\nrepeat (length of [str v])\n    set [str out v] to (join (str out) (item (1) of [str v]))\n    delete (1) of [str v]\nend\n\nwhen flag clicked\nhide list [list platformer creator v]\ndelete all of [blocks v]\nshow list [save code v]\nadd [~~~] to [blocks v]\nadd [===] to [blocks v]\nadd [∆∆∆] to [blocks v]\nadd [XXX] to [blocks v]\nadd [🙂] to [blocks v]\nset [code v] to []\nset [block v] to [0]\nset [editor v] to [1]\nrepeat (9)\n    set [code v] to (join (code) [1111111111111111111111111111111111111111111111111111111111111111110])\nend\nrepeat (4)\n    set [code v] to (join (code) [111111111111111111111111111111111111111111111111111111111111111110])\nend\nforever\n    if <key (p v) pressed?> then\n        wait until <not <key (p v) pressed?>>\n        change [editor v] by (1)\n        set [x v] to [1]\n        set [y v] to [12]\n        set [beat level? v] to [0]\n    end\n    if <key (s v) pressed?> then\n        show save code\n        wait until <not <key (s v) pressed?>>\n        wait until <key (x v) pressed?>\n        show list [save code v]\n    end\n    if <key (l v) pressed?> then\n        ask [Save Code:] and wait\n        set [code v] to (answer)\n    end\n    if <[1] = ((editor) mod (2))> then\n        edit\n    else\n        play\n    end\nend\n\ndefine generate (code)\ndelete all of [list platformer creator v]\nset [counter v] to [1]\nset [item v] to []\ndelete all of [rows v]\nrepeat (length of (code))\n    if <(letter (counter) of (code)) = [0]> then\n        add (item) to [list platformer creator v]\n        set [item v] to []\n    end\n    if <(letter (counter) of (code)) = [1]> then\n        set [item v] to (join (item) [_])\n    end\n    if <(letter (counter) of (code)) = [2]> then\n        set [item v] to (join (item) [~])\n    end\n    if <(letter (counter) of (code)) = [3]> then\n        set [item v] to (join (item) [=])\n    end\n    if <(letter (counter) of (code)) = [4]> then\n        set [item v] to (join (item) [∆])\n    end\n    change [counter v] by (1)\nend\n\ndefine draw place\nset [block_replaced v] to []\nidentify rows\nif <[rows v] contains (round (Y))?> then\n    convert (item (Y) of [list platformer creator v]) to list\n    if <(((block) mod ((5) - <((editor) mod (2)) = [1]>)) + (1)) = [5]> then\n        replace item (X) of [str v] with (item (5) of [blocks v])\n        if <<<(item # of [~] in [str v]) > (X)> or <(item # of [=] in [str v]) > (X)>> or <(item # of [∆] in [str v]) > (X)>> then\n            delete (item # of [_] in [str v]) of [str v]\n        end\n    else\n        set [counter v] to [0]\n        repeat (length of (item (((block) mod ((5) - <((editor) mod (2)) = [1]>)) + (1)) of [blocks v]))\n            set [block_replaced v] to (join (block_replaced) (item ((X) + (counter)) of [str v]))\n            replace item ((X) + (counter)) of [str v] with (letter (1) of (item (((block) mod ((5) - <((editor) mod (2)) = [1]>)) + (1)) of [blocks v]))\n            change [counter v] by (1)\n        end\n    end\n    convert (str) to string\n    replace item (Y) of [list platformer creator v] with (str out)\nelse\n    set space ((X) - (1))\n    replace item (Y) of [list platformer creator v] with (join (space) (item (((block) mod ((5) - <((editor) mod (2)) = [1]>)) + (1)) of [blocks v]))\n    if <(Y) > [9]> then\n        set space ((65) - ((X) + (2)))\n    else\n        set space ((66) - ((X) + (2)))\n    end\n    replace item (Y) of [list platformer creator v] with (join (item (Y) of [list platformer creator v]) (space))\nend\n\ndefine identify rows\nset [counter v] to [1]\nrepeat (13)\n    if <not <<(item (counter) of [list platformer creator v]) = [__________________________________________________________________]> or <(item (counter) of [list platformer creator v]) = [_________________________________________________________________]>>> then\n        add (counter) to [rows v]\n    end\n    change [counter v] by (1)\nend\n\ndefine generate new code\nset [item# v] to [1]\nset [code v] to []\nrepeat (13)\n    set [counter v] to [1]\n    repeat (length of (item (item#) of [list platformer creator v]))\n        if <<(letter (counter) of (item (item#) of [list platformer creator v])) = [X]> or <(letter (counter) of (item (item#) of [list platformer creator v])) = [_]>> then\n            set [code v] to (join (code) [1])\n        end\n        if <(letter (counter) of (item (item#) of [list platformer creator v])) = [~]> then\n            set [code v] to (join (code) [2])\n        end\n        if <(letter (counter) of (item (item#) of [list platformer creator v])) = [=]> then\n            set [code v] to (join (code) [3])\n        end\n        if <(letter (counter) of (item (item#) of [list platformer creator v])) = [∆]> then\n            set [code v] to (join (code) [4])\n        end\n        change [counter v] by (1)\n    end\n    set [code v] to (join (code) [0])\n    change [item# v] by (1)\nend\n\ndefine fit list\nset [item# v] to [1]\nrepeat (13)\n    set [extra length v] to [0]\n    set [letter # v] to [1]\n    repeat (length of (item (item#) of [list platformer creator v]))\n        if <(letter (letter #) of (item (item#) of [list platformer creator v])) = [~]> then\n            change [extra length v] by (0.067)\n        end\n        if <(letter (letter #) of (item (item#) of [list platformer creator v])) = [=]> then\n            change [extra length v] by (0.067)\n        end\n        if <(letter (letter #) of (item (item#) of [list platformer creator v])) = [∆]> then\n            change [extra length v] by ((1) / (6))\n        end\n        if <(letter (letter #) of (item (item#) of [list platformer creator v])) = [X]> then\n            change [extra length v] by (0.27)\n        end\n        if <(letter (letter #) of (item (item#) of [list platformer creator v])) = [🙂]> then\n            change [extra length v] by (2)\n        end\n        change [letter # v] by (1)\n    end\n    set [extra length v] to ([floor v] of (extra length) )\n    if <not <(((65) + <[10] > (item#)>) - (extra length)) = (length of (item (item#) of [list platformer creator v]))>> then\n        convert (item (item#) of [list platformer creator v]) to list\n        repeat ((extra length) - ((((65) + <[10] > (item#)>) - (length of (item (item#) of [list platformer creator v]))) + ()))\n            delete (length of [str v]) of [str v]\n        end\n        convert (str) to string\n        replace item (item#) of [list platformer creator v] with (str out)\n    end\n    fill list item (item#)\n    change [item# v] by (1)\nend\n\ndefine show save code\nhide list [save code v]\ndelete all of [save code v]\nadd [Triple Click on the item below and copy it on to your clipboard!] to [save code v]\nadd (code) to [save code v]\nadd [Please do not post this in the comments, it's far too long.] to [save code v]\nadd [Press 'x' to exit] to [save code v]\n\ndefine clear\nset [code v] to []\nrepeat (9)\n    set [code v] to (join (code) [1111111111111111111111111111111111111111111111111111111111111111110])\nend\nrepeat (4)\n    set [code v] to (join (code) [111111111111111111111111111111111111111111111111111111111111111110])\nend\n\ndefine fill list item (i)\nif <not <((65) + <[10] > (i)>) = ((length of (item (i) of [list platformer creator v])) + (extra length))>> then\n    repeat until <((65) + <[10] > (i)>) = ((length of (item (i) of [list platformer creator v])) + (extra length))>\n        replace item (i) of [list platformer creator v] with (join (item (i) of [list platformer creator v]) (letter (length of (item (i) of [list platformer creator v])) of (item (i) of [list platformer creator v])))\n    end\nend\n\ndefine play\nif <(beat level?) = [0]> then\n    set [block v] to [4]\n    generate (code)\n    if <(letter ((X) + (-2)) of (item (Y) of [list platformer creator v])) = [~]> then\n        change [x v] by (2)\n    end\n    if <(round (Y)) = [1]> then\n        change [y v] by (2)\n    end\n    if <(round (X)) > [60]> then\n        set [beat level? v] to [1]\n    end\n    replace item (5) of [blocks v] with [🙂]\n    if <(letter ((round (X)) + (0)) of (item ((Y) - (1)) of [list platformer creator v])) = [~]> then\n        set [player y vel v] to [0]\n        change [y v] by (1)\n    end\n    if <(letter ((round (X)) + (0)) of (item ((Y) - (-1)) of [list platformer creator v])) = [∆]> then\n        replace item (5) of [blocks v] with [😖]\n        change [y v] by (-1)\n        draw place\n        wait (1) seconds\n        set [x v] to [1]\n        set [y v] to [12]\n    end\n    if <(block_replaced) = [∆]> then\n        replace item (5) of [blocks v] with [😖]\n        change [y v] by (-2)\n        draw place\n        fit list\n        wait (1) seconds\n        set [x v] to [1]\n        set [y v] to [12]\n    end\n    if <(letter ((round (X)) + (0)) of (item ((Y) - (-1)) of [list platformer creator v])) = [=]> then\n        set [player y vel v] to [0]\n        set [player y vel v] to [-1.3]\n    end\n    if <(Y) > [13]> then\n        replace item (5) of [blocks v] with [😖]\n        change [y v] by (((round (Y)) - (11)) * (-1))\n        draw place\n        fit list\n        fit item\n        wait (1) seconds\n        set [x v] to [1]\n        set [y v] to [12]\n    end\n    if <(letter (([floor v] of (X) ) + (0)) of (item (round (([floor v] of (Y) ) - (-1))) of [list platformer creator v])) = [~]> then\n        if <[0] > (player y vel)> then\n            change [player y vel v] by (0.1)\n            set [in air? v] to [1]\n            change [y v] by (player y vel)\n        end\n        set [in air? v] to [0]\n        set [player y vel v] to [0]\n    else\n        change [player y vel v] by (0.1)\n        set [in air? v] to [1]\n        change [y v] by (player y vel)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-2)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (2)\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(in air?) = [0]>> then\n        set [player y vel v] to [-0.8]\n    end\n    if <(letter ((X) + (0)) of (item (Y) of [list platformer creator v])) = [~]> then\n        change [x v] by (-2)\n    end\n    if <(X) < [1]> then\n        set [x v] to [2]\n    end\n    draw place\n    fit list\n    fit item\n    wait (0) seconds\nelse\n    draw finish screen\nend\n\ndefine edit\nif <key (c v) pressed?> then\n    ask [Are you sure you want to clear? \(y/n\)] and wait\n    if <(answer) = [y]> then\n        clear\n    end\nend\ngenerate (code)\nset [x v] to (round ((((mouse x) + (240)) / (7.5)) + ((mouse x) / (400))))\nset [y v] to (round (((180) - (mouse y)) / (25)))\nif <(Y) < [1]> then\n    set [y v] to [1]\nend\nif <(X) < [1]> then\n    set [x v] to [1]\nend\nif <[13] < (Y)> then\n    set [y v] to [13]\nend\nif <[63] < (X)> then\n    if <(Y) > [9]> then\n        set [x v] to [63]\n    else\n        set [x v] to [64]\n    end\nend\ndraw place\nfit list\nif <key (m v) pressed?> then\n    wait until <not <key (m v) pressed?>>\n    change [block v] by (1)\nend\nif <key (1 v) pressed?> then\n    set [block v] to [4]\nend\nif <key (2 v) pressed?> then\n    set [block v] to [1]\nend\nif <key (3 v) pressed?> then\n    set [block v] to [2]\nend\nif <key (4 v) pressed?> then\n    set [block v] to [3]\nend\nif <key (space v) pressed?> then\n    generate new code\nend\n\ndefine set space (space)\nset [space v] to []\nrepeat (space)\n    set [space v] to (join (space) [_])\nend\n\ndefine draw finish screen\ndelete all of [list platformer creator v]\nrepeat (5)\n    add [] to [list platformer creator v]\nend\nadd [                                                   You Beat The Level!!] to [list platformer creator v]\nadd [                         Press 'p' to return to editor or press 's' to save this level] to [list platformer creator v]\nrepeat (6)\n    add [] to [list platformer creator v]\nend\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0)\nshow list [list platformer creator v]\n\ndefine fit item\nrepeat (1)\n    convert (item (Y) of [list platformer creator v]) to list\n    delete (length of [str v]) of [str v]\n    convert (str) to string\n    replace item (Y) of [list platformer creator v] with (str out)\nend\n\n