Tilt(100% pen platformer)

Instructions: Figure it out :) :) :) :) :) :) :) :) :) :) :) :) :)⚡This was inspired by @1dat_doodles and his amazing games tilt and tilt 2⚡\n\n⚡If i get enough support I will make a part 2⚡\n⚠️https://turbowarp.org/528536329⚠️\n⚠️use turbowarp if you want faster running speed it will not keep highscore⚠️ 150 likes and favs for part 2

@Stage\n\n@.\n\n@pls don't steal:                                                                         Thegoatedboat\n\ndefine Draw Line (x1) (y1) (x2) (y2) clipping at xmax: (xmax) xmin: (xmin) ymax: (ymax) ymin: (ymin)\nset [p1 bitset v] to (join (join (round <(x1) < (xmin)>) (round <(x1) > (xmax)>)) (join (round <(y1) < (ymin)>) (round <(y1) > (ymax)>)))\nset [p2 bitset v] to (join (join (round <(x2) < (xmin)>) (round <(x2) > (xmax)>)) (join (round <(y2) < (ymin)>) (round <(y2) > (ymax)>)))\nif <((P1 bitset) + (P2 bitset)) = [0]> then\n    go to x: (x1) y: (y1)\n    pen down\n    go to x: (x2) y: (y2)\n    pen up\nelse\n    if <not < ((P1 bitset) + (P2 bitset)) contains [2]?>> then\n        if <(P1 bitset) > [0]> then\n            if <(letter (1) of (P1 bitset)) = [1]> then\n                Draw Line (xmin) ((y1) + (((y2) - (y1)) * (((xmin) - (x1)) / ((x2) - (x1))))) (x2) (y2) clipping at xmax: (xmax) xmin: (xmin) ymax: (ymax) ymin: (ymin)\n            else\n                if <(letter (2) of (P1 bitset)) = [1]> then\n                    Draw Line (xmax) ((y1) + (((y2) - (y1)) * (((xmax) - (x1)) / ((x2) - (x1))))) (x2) (y2) clipping at xmax: (xmax) xmin: (xmin) ymax: (ymax) ymin: (ymin)\n                else\n                    if <(letter (3) of (P1 bitset)) = [1]> then\n                        Draw Line ((x1) + (((x2) - (x1)) * (((ymin) - (y1)) / ((y2) - (y1))))) (ymin) (x2) (y2) clipping at xmax: (xmax) xmin: (xmin) ymax: (ymax) ymin: (ymin)\n                    else\n                        Draw Line ((x1) + (((x2) - (x1)) * (((ymax) - (y1)) / ((y2) - (y1))))) (ymax) (x2) (y2) clipping at xmax: (xmax) xmin: (xmin) ymax: (ymax) ymin: (ymin)\n                    end\n                end\n            end\n        else\n            Draw Line (x2) (y2) (x1) (y1) clipping at xmax: (xmax) xmin: (xmin) ymax: (ymax) ymin: (ymin)\n        end\n    end\nend\n\ndefine add rectangle X-Y-H-W-T (x) (y) (h) (w) (t)\nadd (x) to [x/y v]\nadd (y) to [x/y v]\nadd (h) to [h/w v]\nadd (w) to [h/w v]\nadd (t) to [type v]\n\ndefine colision/draw <no player draw> <editor> <adding?>\ndelete all of [id v]\ndelete all of [collision v]\nerase all\nset [i v] to [0]\ngo to x: (0) y: (0)\nset pen color to (#000000)\nset pen size to (600)\npen down\npen up\nrepeat ((length of [x/y v]) / (2))\n    change [i v] by (2)\n    if <adding?> then\n        check collision Player stats ((((mouse x) - (ADDX)) / (2)) + (ADDX)) ((((mouse y) - (ADDY)) / (2)) + (ADDY)) ([abs v] of ((mouse y) - (ADDY)) ) ([abs v] of ((mouse x) - (ADDX)) ) rectangle ((item ((i) - (1)) of [x/y v]) - (scrollx)) ((item (i) of [x/y v]) - (scrolly)) (item ((i) - (1)) of [h/w v]) (item (i) of [h/w v]) [nope] editor <editor> <> <no player draw> <adding?>\n    else\n        if <editor> then\n            check collision Player stats (mouse x) (mouse y) [0] [0] rectangle ((item ((i) - (1)) of [x/y v]) - (scrollx)) ((item (i) of [x/y v]) - (scrolly)) (item ((i) - (1)) of [h/w v]) (item (i) of [h/w v]) (item ((i) / (2)) of [type v]) editor <editor> <> <no player draw> <>\n        else\n            check collision Player stats ((scrolled-x-set) - (scrollx)) ((scrolled-y-set) - (scrolly)) [25] [25] rectangle ((item ((i) - (1)) of [x/y v]) - (scrollx)) ((item (i) of [x/y v]) - (scrolly)) (item ((i) - (1)) of [h/w v]) (item (i) of [h/w v]) (item ((i) / (2)) of [type v]) editor <editor> <> <no player draw> <>\n        end\n    end\nend\nset pen size to (10)\nset pen color to (#1a61d2)\n\ndraw line X: [300] Y: [300] X2: [-300] Y2: [300] S [20] tilt? <>\ndraw line X: [-300] Y: [300] X2: [-300] Y2: [-300] S [20] tilt? <>\ndraw line X: [-300] Y: [-300] X2: [300] Y2: [-300] S [20] tilt? <>\ndraw line X: [300] Y: [-300] X2: [300] Y2: [300] S [20] tilt? <>\n\ndefine draw rectangle at X: (x) Y: (y) H: (h) W: (w) S: (s) Tilt? <t?>\ndraw line X: ((x) + ((w) / (2))) Y: ((y) + ((h) / (2))) X2: ((x) - ((w) / (2))) Y2: ((y) + ((h) / (2))) S (s) tilt? <t?>\ndraw line X: ((x) - ((w) / (2))) Y: ((y) + ((h) / (2))) X2: ((x) - ((w) / (2))) Y2: ((y) - ((h) / (2))) S (s) tilt? <t?>\ndraw line X: ((x) - ((w) / (2))) Y: ((y) - ((h) / (2))) X2: ((x) + ((w) / (2))) Y2: ((y) - ((h) / (2))) S (s) tilt? <t?>\ndraw line X: ((x) + ((w) / (2))) Y: ((y) - ((h) / (2))) X2: ((x) + ((w) / (2))) Y2: ((y) + ((h) / (2))) S (s) tilt? <t?>\n\ndefine draw line X: (x) Y: (y) X2: (x-2) Y2: (y-2) S (s) tilt? <t?>\nif <t?> then\n    set pen size to (s)\n    Draw Line (((x) * ([cos v] of (Dir) )) - ((y) * ([sin v] of (Dir) ))) (((x) * ([sin v] of (Dir) )) + ((y) * ([cos v] of (Dir) ))) (((x-2) * ([cos v] of (Dir) )) - ((y-2) * ([sin v] of (Dir) ))) (((x-2) * ([sin v] of (Dir) )) + ((y-2) * ([cos v] of (Dir) ))) clipping at xmax: (240) xmin: (-240) ymax: (180) ymin: (-180)\nelse\n    set pen size to (s)\n    go to x: (x) y: (y)\n    pen down\n    go to x: (x-2) y: (y-2)\n    pen up\nend\n\ngo to x: (((x) * ([cos v] of (Dir) )) - ((y) * ([sin v] of (Dir) ))) y: (((x) * ([sin v] of (Dir) )) + ((y) * ([cos v] of (Dir) )))\npen down\ngo to x: (((x-2) * ([cos v] of (Dir) )) - ((y-2) * ([sin v] of (Dir) ))) y: (((x-2) * ([sin v] of (Dir) )) + ((y-2) * ([cos v] of (Dir) )))\npen up\n\ndefine 2.5 d rectangle at X: (x) Y: (y) H: (h) W: (w) E: (e) size (s) Tilt? <t?>\ndraw rectangle at X: (x) Y: (y) H: (h) W: (w) S: (s) Tilt? <t?>\ndraw rectangle at X: ((x) + ((x) / (e))) Y: ((y) + ((y) / (e))) H: (h) W: (w) S: (s) Tilt? <t?>\ndraw line X: ((x) + ((w) / (2))) Y: ((y) + ((h) / (2))) X2: (((x) + ((x) / (e))) + ((w) / (2))) Y2: (((y) + ((y) / (e))) + ((h) / (2))) S (s) tilt? <t?>\ndraw line X: ((x) - ((w) / (2))) Y: ((y) + ((h) / (2))) X2: (((x) + ((x) / (e))) - ((w) / (2))) Y2: (((y) + ((y) / (e))) + ((h) / (2))) S (s) tilt? <t?>\ndraw line X: ((x) - ((w) / (2))) Y: ((y) - ((h) / (2))) X2: (((x) + ((x) / (e))) - ((w) / (2))) Y2: (((y) + ((y) / (e))) - ((h) / (2))) S (s) tilt? <t?>\ndraw line X: ((x) + ((w) / (2))) Y: ((y) - ((h) / (2))) X2: (((x) + ((x) / (e))) + ((w) / (2))) Y2: (((y) + ((y) / (e))) - ((h) / (2))) S (s) tilt? <t?>\n\nif <[SCROLL] > [0]> then\n    repeat until <((((i) * (90)) + (-300)) - (SCROLL)) > [300]>\n        set pen size to (1)\n        2.5 d rectangle at X: ((((i) * (90)) + (-300)) - (SCROLL)) Y: [45] H: [15] W: [15] E: [1.5] size [] Tilt? <>\n        change [i v] by (1)\n    end\nelse\n    repeat until <((((i) * (-90)) + (300)) - ((SCROLL) + (150))) < [-300]>\n        set pen size to (1)\n        2.5 d rectangle at X: ((((i) * (-90)) + (300)) - ((SCROLL) + (150))) Y: [45] H: [15] W: [15] E: [1.5] size [] Tilt? <>\n        change [i v] by (1)\n    end\nend\n\ndefine run engine\nchange [dir v] by ((((x-V) * (-2)) - (Dir)) / (6))\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x-v v] by (1)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x-v v] by (-1)\nend\nset [x-v v] to ((x-V) * (0.9))\nchange [scrolled-x-set v] by (x-V)\ncolision/draw <> <> <>\nif <[collision v] contains [touch]?> then\n    repeat until <not <[collision v] contains [touch]?>>\n        colision/draw <> <> <>\n        change [scrolled-x-set v] by (() - ((x-V) / ([abs v] of (x-V) )))\n        colision/draw <> <> <>\n    end\n    set [x-v v] to [0]\nend\nchange [scrolled-y-set v] by (y-V)\nset [collision v] to [0]\ny col\nchange [scrollx v] by (((scrolled-x-set) - (scrollx)) / (7))\nchange [scrolly v] by (((scrolled-y-set) - (scrolly)) / (7))\nchange [y-v v] by (-1)\n\ndefine respawn <death> instant? <instant>\nif <death> then\n    set [scrolled-x-set v] to ({spawn} x)\n    set [scrolled-y-set v] to ({spawn} y)\n    set [x-v v] to [0]\n    set [y-v v] to [0]\n    if <instant> then\n        set [scrollx v] to ({spawn} x)\n        set [scrolly v] to ({spawn} y)\n    else\n        repeat until <<([abs v] of ((scrolled-y-set) - (scrolly)) ) < [15]> and <([abs v] of ((scrolled-x-set) - (scrollx)) ) < [15]>>\n            change [scrollx v] by (((scrolled-x-set) - (scrollx)) / (10))\n            change [scrolly v] by (((scrolled-y-set) - (scrolly)) / (10))\n            colision/draw   <>\n        end\n    end\nend\n\ndefine y col\ncolision/draw <> <> <>\nif <[collision v] contains [touch]?> then\n    repeat until <not <[collision v] contains [touch]?>>\n        colision/draw <> <> <>\n        change [scrolled-y-set v] by (() - ((y-V) / ([abs v] of (y-V) )))\n    end\n    if <<(collision) = [1]> and <(y-V) < [0]>> then\n        set [y-v v] to [19]\n        stop [this script v]\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(y-V) < [0]>> then\n        set [y-v v] to [15]\n        stop [this script v]\n    end\n    set [y-v v] to [0]\nend\n\nwhen flag clicked\nset [dir v] to [0]\nrespawn  instant? \nset [{spawn} x v] to [0]\nset [{spawn} y v] to [0]\nrespawn  instant? \nforever\n    main menu\n    reset timer\nend\n\ndefine add\nset [addx v] to (mouse x)\nset [addy v] to (mouse y)\nrepeat until <not <key (space v) pressed?>>\n    erase all\n    colision/draw <>  \n    if <key (x v) pressed?> then\n        stop [this script v]\n    end\nend\nif <<not <[collision v] contains [nope]?>> and <<([abs v] of ((ADDX) - (mouse x)) ) > [10]> and <([abs v] of ((mouse y) - (ADDY)) ) > [10]>>> then\n    add rectangle X-Y-H-W-T ((((mouse x) - (ADDX)) / (2)) + ((ADDX) + (scrollx))) ((((mouse y) - (ADDY)) / (2)) + ((ADDY) + (scrolly))) ([abs v] of ((ADDY) - (mouse y)) ) ([abs v] of ((ADDX) - (mouse x)) ) (TYPE)\nend\n\ndefine remove square with (id)\ndelete (id) of [h/w v]\ndelete ((id) - (1)) of [h/w v]\ndelete (id) of [x/y v]\ndelete ((id) - (1)) of [x/y v]\ndelete ((id) / (2)) of [type v]\n\ndefine check collision Player stats (px) (py) (ph) (pw) rectangle (x) (y) (h) (w) (t) editor <editor?> <2.5d?> <player draw?> <adding?>\nif <(x) > [0]> then\n    if <((x) - (w)) > [240]> then\n        stop [this script v]\n    end\nelse\n    if <((x) + (w)) < [-240]> then\n        stop [this script v]\n    end\nend\nif <(y) > [0]> then\n    if <((y) - (h)) > [180]> then\n        stop [this script v]\n    end\nelse\n    if <((y) + (h)) < [-180]> then\n        stop [this script v]\n    end\nend\nif <((px) + ((pw) / (2))) > ((x) - ((w) / (2)))> then\n    if <((py) - ((ph) / (2))) < ((y) + ((h) / (2)))> then\n        if <((px) - ((pw) / (2))) < ((x) + ((w) / (2)))> then\n            if <((py) + ((ph) / (2))) > ((y) - ((h) / (2)))> then\n                add (t) to [collision v]\n                if <editor?> then\n                    add (i) to [id v]\n                end\n                if <adding?> then\n                    set [collision v] to [1]\n                end\n            end\n        end\n    end\nend\nif <(t) = [1]> then\n    set pen color to (#0062ff)\nelse\n    if <<(t) = [2]> or <<(collision) = [1]> and <[collision v] contains [nope]?>>> then\n        set pen color to (#ff0000)\n    else\n        if <(t) = [3]> then\n            set pen color to (#ff7b00)\n        else\n            if <(t) = [R]> then\n                set pen color to (#ff00ae)\n            else\n                if <(t) = [E]> then\n                    set pen color to (#26ff00)\n                else\n                    if <(t) = [cp]> then\n                        set pen color to (#96ff50)\n                        if <(round ({spawn} x)) = (round ((scrollx) + (x)))> then\n                            if <(round ({spawn} y)) = (round ((y) + (scrolly)))> then\n                                set pen color to (#1dff00)\n                            end\n                        end\n                    else\n                        if <(t) = (mode)> then\n                            set pen color to (#00ff21)\n                        else\n                            set pen color to (#00a9ff)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <adding?> then\n    set [collision v] to [0]\nend\nif <[collision v] contains [cp]?> then\n    set [{spawn} x v] to (item ((i) - (1)) of [x/y v])\n    set [{spawn} y v] to (item (i) of [x/y v])\nend\nif  then\n    2.5 d rectangle at X: (x) Y: (y) H: (h) W: (w) E: [5] size [7] Tilt? \n    set pen color to (#ffffff)\n    2.5 d rectangle at X: (x) Y: (y) H: (h) W: (w) E: [5] size [1] Tilt? \nelse\n    draw rectangle at X: (x) Y: (y) H: (h) W: (w) S: [7] Tilt? \n    set pen color to (#ffffff)\n    draw rectangle at X: (x) Y: (y) H: (h) W: (w) S: [1] Tilt? \nend\nif <not <player draw?>> then\n    set pen color to (#23ff1f)\n    if <not <editor?>> then\n    draw rectangle at X: (px) Y: ((py) - (0)) H: (ph) W: (pw) S: [5] Tilt? \nend\nif <[collision v] contains [1]?> then\n    add [touch] to [collision v]\nend\nif <[collision v] contains [3]?> then\n    set [collision v] to [1]\n    add [touch] to [collision v]\nend\nif <<[collision v] contains [R]?> and <not <editor?>>> then\n    set [x-v v] to [30]\nend\nset pen color to (#19d7e4)\nif <[collision v] contains [e]?> then\n    broadcast (end v)\n    stop [other scripts in sprite v]\n    stop [this script v]\nend\n\ndefine main menu\ndelete all of [collision v]\ngo to x: (0) y: (0)\nerase all\nset pen color to (#000000)\nset pen size to (650)\npen down\npen up\ncheck collision Player stats (mouse x) (mouse y) [] [] rectangle [0] [] [45] [90] [levels] editor <>  <> <>\nif <[collision v] contains [levels]?> then\n    set pen color to (#00ff21)\n    draw rectangle at X: [] Y: [] H: [45] W: [90] S: [10] Tilt? <>\n    set pen color to (#ffffff)\n    draw rectangle at X: [] Y: [] H: [45] W: [90] S: [1] Tilt? <>\n    if <mouse down?> then\n        broadcast (message1 v)\n    end\nend\ndraw line X: [-7] Y: [7] X2: [-7] Y2: [-7] S [5] tilt? <>\ndraw line X: [-7] Y: [-7] X2: [5] Y2: [0] S [5] tilt? <>\ndraw line X: [-7] Y: [7] X2: [5] Y2: [0] S [5] tilt? <>\n\nwhen I receive [message1 v]\nstop [other scripts in sprite v]\nforever\n    run engine\n    respawn <[collision v] contains [2]?> instant? <>\n    respawn <(scrolly) < [-400]> instant? <>\nend\n\nwhen I receive [message 2 v]\nstop [other scripts in sprite v]\nwait (0.3) seconds\nforever\n    set [dir v] to [0]\n    set [x-v v] to ((<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) * (20))\n    set [y-v v] to ((<key (up arrow v) pressed?> - <key (down arrow v) pressed?>) * (20))\n    change [scrolled-x-set v] by (x-V)\n    change [scrolled-y-set v] by (y-V)\n    colision/draw   <>\n    if <key (space v) pressed?> then\n        if  then\n            if <(mode) = [drawer]> then\n                add\n            else\n                if <(length of [id v]) > [0]> then\n                    remove square with (item (1) of [id v])\n                end\n            end\n        end\n    end\n    change [scrollx v] by (((scrolled-x-set) - (scrollx)) / (1))\n    change [scrolly v] by (((scrolled-y-set) - (scrolly)) / (1))\n    colision/draw   <>\n    set pen color to (#14fef1)\n    set pen color to (#19d7e4)\n    check collision Player stats (mouse x) (mouse y) [] [] rectangle [-200] [150] [45] [45] [eraser] editor   <> <>\n    check collision Player stats (mouse x) (mouse y) [] [] rectangle [-150] [150] [45] [45] [drawer] editor   <> <>\n    if <<[collision v] contains [eraser]?> and <mouse down?>> then\n        set [mode v] to [eraser]\n    end\n    if <<[collision v] contains [drawer]?> and <mouse down?>> then\n        set [mode v] to [drawer]\n    end\n    set pen color to (#ec14dc)\n    go to x: (0) y: (0)\n    pen down\n    pen up\nend\n\nset [x-v v] to ((x-V) * (0.5))\nset [y-v v] to ((y-V) * (0.5))\n\nwhen [2 v] key pressed\nif <(username) = [thegoatedboat]> then\n    stop [other scripts in sprite v]\n    broadcast (message 2 v)\nend\n\nwhen [1 v] key pressed\nif <(username) = [thegoatedboat]> then\n    stop [other scripts in sprite v]\n    broadcast (message1 v)\nend\n\nwhen I receive [end v]\n\nbroadcast (message 2 v)\n\ncheck collision Player stats (mouse x) (mouse y) [] [] rectangle [0] [-90] [45] [90] [editor] editor <>  <> <>\nif <[collision v] contains [editor]?> then\n    set pen color to (#00ff21)\n    draw rectangle at X: [0] Y: [-90] H: [45] W: [90] S: [10] Tilt? <>\n    set pen color to (#ffffff)\n    draw rectangle at X: [0] Y: [-90] H: [45] W: [90] S: [1] Tilt? <>\nend\n\nwhen flag clicked\nforever\n    if <[collision v] contains [E]?> then\n        broadcast (end v)\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\n@highscore lol                                                                             thegoatedboat\n\nwhen I receive [end v]\nshow variable [time v]\nshow variable [☁ highscore v]\nshow variable [decoded\(cloud\) v]\nset [time v] to (timer)\nerase all\nshow\nif <(timer) < (☁ highscore)> then\n    replace first place\nend\ndecode (☁ highscore holder)\nstop [all v]\n\nwhen flag clicked\nhide\nhide variable [time v]\nhide variable [☁ highscore holder v]\nhide variable [☁ highscore v]\nhide variable [decoded\(cloud\) v]\n\ndefine replace first place\nset [☁ highscore v] to (timer)\nencode (username)\n\ndefine encode (encode)\nset [cloud letters v] to [         abcdefghijklmnopqrstuvwxyz123456789-_]\nset [encoded\(cloud\) v] to []\nset [cloud var v] to [0]\nrepeat (length of (encode))\n    change [cloud var v] by (1)\n    get letter from [9] (encode)\nend\nset [☁ highscore holder v] to (encoded\(cloud\))\n\ndefine get letter from (numb) (encode2)\nif <(letter (cloud var) of (encode2)) = (letter (numb) of (cloud letters))> then\n    set [encoded\(cloud\) v] to (join (encoded\(cloud\)) (numb))\nelse\n    get letter from ((numb) + (1)) (encode2)\nend\n\ndefine decode (decode)\nset [cloud letters v] to [         abcdefghijklmnopqrstuvwxyz123456789-_]\nset [cloud var v] to [0]\nset [decoded\(cloud\) v] to []\nrepeat (length of ((decode) / (2)))\n    change [cloud var v] by (2)\n    set [decoded\(cloud\) v] to (join (decoded\(cloud\)) (letter (join (letter ((cloud var) - (1)) of (decode)) (letter (cloud var) of (decode))) of (cloud letters)))\nend\n\n