Hard,Fall! ! platformer  
@Stage\n\nwhen I receive [tick v]\nswitch backdrop to (a level)\n\nwhen I receive [start game v]\nforever\n    play sound [Vexento - Cloud Nine v] until done\nend\n\nwhen I receive [start game v]\nset volume to (20) %\nrepeat (60)\n    change volume by (1)\nend\nforever\n    set volume to ((?music) * (0.8)) %\nend\n\nwhen I receive [update textbox v]\nif <(t textbox) = [13]> then\n    repeat (20)\n        change volume by (-5)\n    end\n    stop [other scripts in sprite v]\n    stop all sounds\nend\n\nwhen I receive [credits v]\nstop [other scripts in sprite v]\nstop all sounds\nstart sound [Vexento - Happy Robot v]\nset volume to (20) %\nrepeat ((?music) * (0.8))\n    change volume by (1)\nend\nforever\n    play sound [Vexento - Happy Robot v] until done\nend\n\n@empty\n\n@3D Engine\n\ndefine point towards x: (x) y: (y)\nif <not <(y) < (y position)>> then\n    point in direction ([atan v] of (((x) - (x position)) / ((y) - (y position))) )\nelse\n    point in direction ((180) + ([atan v] of (((x) - (x position)) / ((y) - (y position))) ))\nend\n\ndefine fill (ax) (ay) (bx) (by) (cx) (cy) resolution: (res)\nif <(?wireframe) = [0]> then\n    set [lena v] to ([sqrt v] of ((((bx) - (cx)) * ((bx) - (cx))) + (((by) - (cy)) * ((by) - (cy)))) )\n    set [lenb v] to ([sqrt v] of ((((ax) - (cx)) * ((ax) - (cx))) + (((ay) - (cy)) * ((ay) - (cy)))) )\n    set [lenc v] to ([sqrt v] of ((((ax) - (bx)) * ((ax) - (bx))) + (((ay) - (by)) * ((ay) - (by)))) )\n    set [peri v] to ((1) / (((lena) + (lenb)) + (lenc)))\n    set [incx v] to (((((lena) * (ax)) + ((lenb) * (bx))) + ((lenc) * (cx))) * (peri))\n    set [incy v] to (((((lena) * (ay)) + ((lenb) * (by))) + ((lenc) * (cy))) * (peri))\n    set [ind v] to ([sqrt v] of ((((((lenb) + (lenc)) - (lena)) * (((lenc) + (lena)) - (lenb))) * (((lena) + (lenb)) - (lenc))) * (peri)) )\n    set [aox v] to ((incx) - (ax))\n    set [aoy v] to ((incy) - (ay))\n    set [box v] to ((incx) - (bx))\n    set [boy v] to ((incy) - (by))\n    set [cox v] to ((incx) - (cx))\n    set [coy v] to ((incy) - (cy))\n    if <<(lena) < (lenb)> and <(lena) < (lenc)>> then\n        set [td v] to ([sqrt v] of (((Aox) * (Aox)) + ((Aoy) * (Aoy))) )\n    else\n        if <<(lenb) > (lena)> or <(lenb) > (lenc)>> then\n            set [td v] to ([sqrt v] of (((Cox) * (Cox)) + ((Coy) * (Coy))) )\n        else\n            set [td v] to ([sqrt v] of (((Box) * (Box)) + ((Boy) * (Boy))) )\n        end\n    end\n    set [rate v] to ((((td) * (2)) - (ind)) / ((td) * (4)))\n    set [td v] to ((1) + (0))\n    go to x: (round (incx)) y: (round (incy))\n    set pen size to (ind)\n    pen down\n    repeat ([ceiling v] of (([log v] of ((res) / (ind)) ) / ([log v] of (rate) )) )\n        set [td v] to ((td) * (rate))\n        set pen size to ((ind) * (td))\n        go to x: (((Aox) * (td)) + (ax)) y: (((Aoy) * (td)) + (ay))\n        go to x: (((Box) * (td)) + (bx)) y: (((Boy) * (td)) + (by))\n        go to x: (((Cox) * (td)) + (cx)) y: (((Coy) * (td)) + (cy))\n        go to x: (((Aox) * (td)) + (ax)) y: (((Aoy) * (td)) + (ay))\n    end\n    set pen size to (res)\n    go to x: (ax) y: (ay)\n    go to x: (bx) y: (by)\n    go to x: (cx) y: (cy)\n    go to x: (ax) y: (ay)\n    pen up\nelse\n    set pen size to (res)\n    go to x: (ax) y: (ay)\n    pen down\n    go to x: (bx) y: (by)\n    go to x: (cx) y: (cy)\n    go to x: (ax) y: (ay)\n    pen up\nend\n\ndefine set point 1 (x1) (y1) (z1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\nset [z1 v] to (z1)\n\ndefine set point 2 (x2) (y2) (z2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nset [z2 v] to (z2)\n\ndefine set point 3 (x3) (y3) (z3)\nset [x3 v] to (x3)\nset [y3 v] to (y3)\nset [z3 v] to (z3)\n\ndefine 3D fill (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3)\nif <not <<(item (y i) of [triangle t v]) = [1000]> or <(item (y i) of [triangle t v]) = [2000]>>> then\n    set render things I guess\nend\nchange [a tri drawn v] by (1)\nset point 1 ((x1) - (camX)) ((y1) - (camY)) ((z1) - (camZ))\nset point 2 ((x2) - (camX)) ((y2) - (camY)) ((z2) - (camZ))\nset point 3 ((x3) - (camX)) ((y3) - (camY)) ((z3) - (camZ))\nset point 1 (((x1) * (cosY)) - ((z1) * (sinY))) (y1) (((z1) * (cosY)) + ((x1) * (sinY)))\nset point 2 (((x2) * (cosY)) - ((z2) * (sinY))) (y2) (((z2) * (cosY)) + ((x2) * (sinY)))\nset point 3 (((x3) * (cosY)) - ((z3) * (sinY))) (y3) (((z3) * (cosY)) + ((x3) * (sinY)))\nset point 1 (x1) (((y1) * (cosX)) - ((z1) * (sinX))) (((z1) * (cosX)) + ((y1) * (sinX)))\nset point 2 (x2) (((y2) * (cosX)) - ((z2) * (sinX))) (((z2) * (cosX)) + ((y2) * (sinX)))\nset point 3 (x3) (((y3) * (cosX)) - ((z3) * (sinX))) (((z3) * (cosX)) + ((y3) * (sinX)))\nif <<<(z1) > [5]> and <(z2) > [5]>> and <(z3) > [5]>> then\n    fill (((r FOV) * (x1)) / (z1)) (((r FOV) * (y1)) / (z1)) (((r FOV) * (x2)) / (z2)) (((r FOV) * (y2)) / (z2)) (((r FOV) * (x3)) / (z3)) (((r FOV) * (y3)) / (z3)) resolution: (res)\nelse\n    do z clip\nend\n\ndefine render\ncalculate trig values\nset cam\ncalculate shadow [1]\ncheck if behind wall\ny sort\nset [a tri drawn v] to [0]\nset [c i v] to (length of [tri sort v])\nrepeat (length of [triangle x1 v])\n    change [c i v] by (-1)\n    set [y i v] to (item (c i) of [tri sort v])\n    if <(item (y i) of [triangle d v]) < (?render distance)> then\n        if <not <<(item (y i) of [triangle t v]) = [1000]> or <(item (y i) of [triangle t v]) = [2000]>>> then\n            set [res v] to (round (?triangle resolution))\n            if <(item (y i) of [triangle dir v]) = [0]> then\n                3D fill (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) (item (y i) of [triangle x2 v]) (item (y i) of [triangle y2 v]) (item (y i) of [triangle z2 v]) (item (y i) of [triangle x3 v]) (item (y i) of [triangle y3 v]) (item (y i) of [triangle z3 v])\n            end\n            if <<(item (y i) of [triangle dir v]) = [1]> and <(camY) > (item (y i) of [triangle y1 v])>> then\n                3D fill (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) (item (y i) of [triangle x2 v]) (item (y i) of [triangle y2 v]) (item (y i) of [triangle z2 v]) (item (y i) of [triangle x3 v]) (item (y i) of [triangle y3 v]) (item (y i) of [triangle z3 v])\n            end\n            if <<(item (y i) of [triangle dir v]) = [2]> and <(item (y i) of [triangle y1 v]) > (camY)>> then\n                3D fill (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) (item (y i) of [triangle x2 v]) (item (y i) of [triangle y2 v]) (item (y i) of [triangle z2 v]) (item (y i) of [triangle x3 v]) (item (y i) of [triangle y3 v]) (item (y i) of [triangle z3 v])\n            end\n            if <<(item (y i) of [triangle dir v]) = [3]> and <(item (y i) of [triangle z1 v]) > (camZ)>> then\n                3D fill (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) (item (y i) of [triangle x2 v]) (item (y i) of [triangle y2 v]) (item (y i) of [triangle z2 v]) (item (y i) of [triangle x3 v]) (item (y i) of [triangle y3 v]) (item (y i) of [triangle z3 v])\n            end\n            if <<(item (y i) of [triangle dir v]) = [4]> and <(camZ) > (item (y i) of [triangle z1 v])>> then\n                3D fill (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) (item (y i) of [triangle x2 v]) (item (y i) of [triangle y2 v]) (item (y i) of [triangle z2 v]) (item (y i) of [triangle x3 v]) (item (y i) of [triangle y3 v]) (item (y i) of [triangle z3 v])\n            end\n            if <<(item (y i) of [triangle dir v]) = [5]> and <(item (y i) of [triangle x1 v]) > (camX)>> then\n                3D fill (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) (item (y i) of [triangle x2 v]) (item (y i) of [triangle y2 v]) (item (y i) of [triangle z2 v]) (item (y i) of [triangle x3 v]) (item (y i) of [triangle y3 v]) (item (y i) of [triangle z3 v])\n            end\n            if <<(item (y i) of [triangle dir v]) = [6]> and <(camX) > (item (y i) of [triangle x1 v])>> then\n                3D fill (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) (item (y i) of [triangle x2 v]) (item (y i) of [triangle y2 v]) (item (y i) of [triangle z2 v]) (item (y i) of [triangle x3 v]) (item (y i) of [triangle y3 v]) (item (y i) of [triangle z3 v])\n            end\n        end\n    end\nend\nset [y i v] to [0]\nrepeat (length of [triangle x1 v])\n    change [y i v] by (1)\n    if <(item (y i) of [triangle t v]) = [2000]> then\n        set pen color to (#333333)\n        set pen (transparency v) to (r player transparency)\n        if <not <(b falling?) < [1]>> then\n            if <(b animation) = [3]> then\n                if <(n in wall?) = [0]> then\n                    set [res v] to [1]\n                    3D fill (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) (item (y i) of [triangle x2 v]) (item (y i) of [triangle y2 v]) (item (y i) of [triangle z2 v]) (item (y i) of [triangle x3 v]) (item (y i) of [triangle y3 v]) (item (y i) of [triangle z3 v])\n                end\n            else\n                set [res v] to [1]\n                3D fill (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) (item (y i) of [triangle x2 v]) (item (y i) of [triangle y2 v]) (item (y i) of [triangle z2 v]) (item (y i) of [triangle x3 v]) (item (y i) of [triangle y3 v]) (item (y i) of [triangle z3 v])\n            end\n        end\n    end\nend\nset [y i v] to [0]\nrepeat (length of [triangle x1 v])\n    change [y i v] by (1)\n    if <(item (y i) of [triangle t v]) = [1000]> then\n        if <<(n in wall?) = [0]> or <(n i 2) = [1]>> then\n            set pen color to (#0007ed)\n            set pen (brightness v) to (item (y i) of [triangle c v])\n            set pen (transparency v) to (r player transparency)\n        else\n            set pen color to (#2d2d2d)\n        end\n        if <(b animation) = [3]> then\n            if <(n in wall?) = [0]> then\n                set [res v] to [1]\n                3D fill ((b player x) + (item (y i) of [triangle x1 v])) ((b player y) + (item (y i) of [triangle y1 v])) ((b player z) + (item (y i) of [triangle z1 v])) ((b player x) + (item (y i) of [triangle x2 v])) ((b player y) + (item (y i) of [triangle y2 v])) ((b player z) + (item (y i) of [triangle z2 v])) ((b player x) + (item (y i) of [triangle x3 v])) ((b player y) + (item (y i) of [triangle y3 v])) ((b player z) + (item (y i) of [triangle z3 v]))\n            end\n        else\n            set [res v] to [1]\n            3D fill ((b player x) + (item (y i) of [triangle x1 v])) ((b player y) + (item (y i) of [triangle y1 v])) ((b player z) + (item (y i) of [triangle z1 v])) ((b player x) + (item (y i) of [triangle x2 v])) ((b player y) + (item (y i) of [triangle y2 v])) ((b player z) + (item (y i) of [triangle z2 v])) ((b player x) + (item (y i) of [triangle x3 v])) ((b player y) + (item (y i) of [triangle y3 v])) ((b player z) + (item (y i) of [triangle z3 v]))\n        end\n    end\nend\n\nset [y render this? v] to [0]\nif <(y render this?) = [0]> then\nend\n\nset render things I guess\n\ndefine calculate trig values\nset [sinx v] to ([sin v] of (camRotX) )\nset [cosx v] to ([cos v] of (camRotX) )\nset [siny v] to ([sin v] of (camRotY) )\nset [cosy v] to ([cos v] of (camRotY) )\n\ndefine do z clip\nif <(z1) < [5]> then\n    if <(z2) < [5]> then\n        if <not <(z3) < [5]>> then\n            z clip type 2 (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3)\n        end\n    else\n        if <(z3) < [5]> then\n            if <not <(z2) < [5]>> then\n                z clip type 2 (x1) (y1) (z1) (x3) (y3) (z3) (x2) (y2) (z2)\n            end\n        else\n            z clip type 1 (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3)\n        end\n    end\nelse\n    if <(z2) < [5]> then\n        if <(z3) < [5]> then\n            if <not <(z1) < [5]>> then\n                z clip type 2 (x2) (y2) (z2) (x3) (y3) (z3) (x1) (y1) (z1)\n            end\n        else\n            if <(z1) < [5]> then\n                if <not <(z3) < [5]>> then\n                    z clip type 2 (x2) (y2) (z2) (x1) (y1) (z1) (x3) (y3) (z3)\n                end\n            else\n                z clip type 1 (x2) (y2) (z2) (x3) (y3) (z3) (x1) (y1) (z1)\n            end\n        end\n    else\n        if <(z3) < [5]> then\n            if <(z1) < [5]> then\n                if <not <(z2) < [5]>> then\n                    z clip type 2 (x3) (y3) (z3) (x1) (y1) (z1) (x2) (y2) (z2)\n                end\n            else\n                if <(z2) < [5]> then\n                    if <not <(z1) < [5]>> then\n                        z clip type 2 (x3) (y3) (z3) (x2) (y2) (z2) (x1) (y1) (z1)\n                    end\n                else\n                    z clip type 1 (x3) (y3) (z3) (x1) (y1) (z1) (x2) (y2) (z2)\n                end\n            end\n        end\n    end\nend\n\ndefine z clip type 2 (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3)\nset [percent v] to (((z3) - (5)) / ((z3) - (z1)))\nset [x1 v] to ((54) * ((x3) - (((x3) - (x1)) * (percent))))\nset [y1 v] to ((54) * ((y3) - (((y3) - (y1)) * (percent))))\nset [percent v] to (((z3) - (5)) / ((z3) - (z2)))\nfill (x1) (y1) ((54) * ((x3) - (((x3) - (x2)) * (percent)))) ((54) * ((y3) - (((y3) - (y2)) * (percent)))) ((270) * ((x3) / (z3))) ((270) * ((y3) / (z3))) resolution: (res)\n\ndefine z clip type 1 (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3)\nset [percent v] to (((z2) - (5)) / ((z2) - (z1)))\nset [x1 v] to ((54) * ((x2) - (((x2) - (x1)) * (percent))))\nset [y1 v] to ((54) * ((y2) - (((y2) - (y1)) * (percent))))\nset [percent v] to (((z3) - (5)) / ((z3) - (z1)))\nset [x2 v] to ((54) * ((x3) - (((x3) - (x1)) * (percent))))\nset [y2 v] to ((54) * ((y3) - (((y3) - (y1)) * (percent))))\nfill (x1) (y1) ((270) * ((x2) / (z2))) ((270) * ((y2) / (z2))) ((270) * ((x3) / (z3))) ((270) * ((y3) / (z3))) resolution: (res)\nfill (x1) (y1) (x2) (y2) ((270) * ((x3) / (z3))) ((270) * ((y3) / (z3))) resolution: (res)\n\ndefine tick\nif <(b animation) = [0]> then\n    if <(e mobile controls?) = [0]> then\n        if <key (d v) pressed?> then\n            change [b player xvel v] by ((cosY) * (5))\n            change [b player zvel v] by ((sinY) * (-5))\n            set [a start timer? v] to [1]\n        end\n        if <key (a v) pressed?> then\n            change [b player xvel v] by ((cosY) * (-5))\n            change [b player zvel v] by ((sinY) * (5))\n            set [a start timer? v] to [1]\n        end\n        if <key (w v) pressed?> then\n            change [b player xvel v] by (([cos v] of ((camRotY) + (90)) ) * (-5))\n            change [b player zvel v] by (([sin v] of ((camRotY) + (90)) ) * (5))\n            set [a start timer? v] to [1]\n        end\n        if <key (s v) pressed?> then\n            change [b player xvel v] by (([cos v] of ((camRotY) + (90)) ) * (5))\n            change [b player zvel v] by (([sin v] of ((camRotY) + (90)) ) * (-5))\n            set [a start timer? v] to [1]\n        end\n        if <key (space v) pressed?> then\n            set [a start timer? v] to [1]\n            if <(b space pressed?) = [0]> then\n                if <<(b falling?) < [5]> and <(b double jump?) = [ 0]>> then\n                    set [b space pressed? v] to [1]\n                    set [b double jump? v] to [1]\n                    set [b player yvel v] to [14]\n                    set [b falling? v] to [55]\n                    start sound [jump v]\n                else\n                    if <<(b double jump?) = [ 0]> or <(b double jump?) = [1]>> then\n                        if <(b player yvel) < [7]> then\n                            set [b space pressed? v] to [1]\n                            set [b double jump? v] to [2]\n                            set [b player yvel v] to [14]\n                            start sound [jump v]\n                        end\n                    end\n                end\n            end\n        end\n        change x by (b player xvel)\n        change z by (b player zvel)\n        if <(a level) = [4]> then\n            if <(b falling?) < [5]> then\n                set [b player xvel v] to ((b player xvel) * (0.6))\n                set [b player zvel v] to ((b player zvel) * (0.6))\n            else\n                set [b player xvel v] to ((b player xvel) * (0.4))\n                set [b player zvel v] to ((b player zvel) * (0.4))\n            end\n        else\n            set [b player xvel v] to [0]\n            set [b player zvel v] to [0]\n        end\n        if <not <key (space v) pressed?>> then\n            set [b space pressed? v] to [0]\n        end\n        if <key (right arrow v) pressed?> then\n            change [camroty v] by (5)\n        end\n        if <key (left arrow v) pressed?> then\n            change [camroty v] by (-5)\n        end\n        if <key (up arrow v) pressed?> then\n            change [camrotx v] by (5)\n        end\n        if <key (down arrow v) pressed?> then\n            change [camrotx v] by (-5)\n        end\n        change [b player yvel v] by (-1)\n        if <[-50] > (b player yvel)> then\n            set [b player yvel v] to [-50]\n        end\n        change [b falling? v] by (1)\n        change y by (b player yvel)\n        if <(f hit something y) = [1]> then\n            if <(f on ground sound?) = [0]> then\n                start sound [ground v]\n                set [f on ground sound? v] to [1]\n            end\n        else\n            set [f on ground sound? v] to [0]\n        end\n        if <(camRotX) > [0]> then\n            set [camrotx v] to [0]\n        end\n        if <[-90] > (camRotX)> then\n            set [camrotx v] to [-90]\n        end\n        if <[-500] > (b player y)> then\n            set [b animation frame v] to [0]\n            set [b animation v] to [1]\n        end\n        set [a tri count v] to (length of [triangle x1 v])\n    else\n        mobile controls\n    end\n    if <<(item (2) of [textbox v]) = [0]> and <<(a level) = [1]> and <(b player z) > [250]>>> then\n        replace item (2) of [textbox v] with [1]\n        set [t textbox v] to [6]\n    end\n    if <<(item (3) of [textbox v]) = [0]> and <<(a level) = [1]> and <(b player z) > [500]>>> then\n        replace item (3) of [textbox v] with [1]\n        set [t textbox v] to [7]\n    end\nend\nif <(e speedrun?) = [1]> then\n    if <<key (q v) pressed?> and <key (r v) pressed?>> then\n        set [r circle size v] to [1000]\n        set [a level v] to [1]\n        set [a start timer? v] to [0]\n        set [a timer \(frames\) v] to [0]\n        level (a level)\n        reset\n        calculate trig values\n        stop [this script v]\n    end\nend\nif <(b animation) = [1]> then\n    change [b animation frame v] by (1)\n    if <(b animation frame) > [0]> then\n        set [b animation v] to [12]\n        set [b animation sound played? v] to [0]\n    end\nelse\n    if <(b animation) = [12]> then\n        if <(b animation sound played?) = [0]> then\n            stop all sounds\n            start sound [fall v]\n            set [b animation sound played? v] to [1]\n        end\n        change [b player y v] by (-20)\n        if <[-1000] > (b player y)> then\n            set [b animation frame v] to [0]\n            set [b animation v] to [13]\n            set [r circle size v] to [400]\n        end\n    else\n        if <(b animation) = [2]> then\n            if <(b animation sound played?) = [0]> then\n                stop all sounds\n                start sound [lava v]\n                set [b animation sound played? v] to [1]\n            end\n            change [b animation frame v] by (1)\n            if <(b animation frame) > [0]> then\n                change [r player transparency v] by (7)\n            end\n            if <(r player transparency) > [99]> then\n                set [b animation frame v] to [0]\n                set [b animation v] to [13]\n                set [r circle size v] to [400]\n            end\n        else\n            if <(b animation) = [3]> then\n                change [b animation frame v] by (1)\n                if <(b animation sound played?) = [0]> then\n                    stop all sounds\n                    start sound [win v]\n                    set [b animation sound played? v] to [1]\n                end\n                change [camrotx v] by (((-35) - (camRotX)) / (2.5))\n                change [camroty v] by (((0) - (camRotY)) / (2.5))\n                if <(b animation frame) > [10]> then\n                    set [b animation frame v] to [0]\n                    set [b animation v] to [13]\n                    set [r circle size v] to [400]\n                end\n            end\n        end\n    end\nend\nset volume to (?sound effects) %\n\ndefine level (level)\nbroadcast (finished level at v) and wait\nif <(a level) = [6]> then\n    set [t textbox v] to [13]\n    stop [this script v]\nend\nbroadcast (show loading v) and wait\nset [b checkpoint x v] to [0]\nset [b checkpoint y v] to [0]\nset [b checkpoint z v] to [0]\ndelete all of [block x1 v]\ndelete all of [block x2 v]\ndelete all of [block y1 v]\ndelete all of [block y2 v]\ndelete all of [block z1 v]\ndelete all of [block z2 v]\ndelete all of [triangle x1 v]\ndelete all of [triangle x2 v]\ndelete all of [triangle x3 v]\ndelete all of [triangle y1 v]\ndelete all of [triangle y2 v]\ndelete all of [triangle y3 v]\ndelete all of [triangle z1 v]\ndelete all of [triangle z2 v]\ndelete all of [triangle z3 v]\ndelete all of [triangle t v]\ndelete all of [triangle c v]\ndelete all of [blocks t v]\ndelete all of [triangle dir v]\n-- [level]\nif <(level) = [1]> then\n    add block [-200] [-100] [-300] to [200] [-80] [300] [5]\n    add block [200] [-100] [-350] to [250] [350] [1100] [5]\n    add block [-250] [-100] [-350] to [-200] [350] [1100] [5]\n    add block [-200] [-100] [-350] to [200] [90] [-300] [5]\n    add block [-200] [225] [-300] to [200] [250] [-250] [5]\n    add block [-200] [-100] [350] to [200] [-80] [550] [5]\n    add block [-200] [-100] [725] to [200] [-80] [900] [5]\n    add block [-200] [-100] [900] to [200] [-10] [1000] [5]\n    add block [-200] [-10] [1000] to [200] [150] [1380] [5]\n    add block [50] [150] [1100] to [200] [350] [1380] [5]\n    add block [-200] [150] [1100] to [-50] [350] [1380] [5]\n    add block [-50] [160] [1150] to [50] [170] [1160] [6]\n    add block [-50] [160] [1250] to [50] [170] [1260] [6]\n    add block [-50] [180] [1250] to [50] [190] [1260] [6]\n    add block [-30] [150] [1020] to [30] [170] [1080] [7]\n    add block [-50] [150] [1380] to [50] [250] [1400] [10]\n    add block [-50] [250] [1350] to [50] [350] [1380] [5]\n    -- [green alien :\)]\n    add block [-180] [350] [1350] to [-170] [375] [1360] [12]\n    add block [-160] [350] [1350] to [-150] [375] [1360] [12]\n    add block [-185] [375] [1345] to [-145] [395] [1365] [12]\n    add block [-182] [387] [1343] to [-177] [392] [1345] [13]\n    add block [-153] [387] [1343] to [-148] [392] [1345] [13]\n    add block [-170] [377] [1343] to [-160] [379] [1345] [13]\n    -- [ok]\nelse\n    if <(level) = [2]> then\n        add block [-100] [-100] [-100] to [100] [-80] [100] [1]\n        add block [-100] [-500] [-100] to [100] [-100] [100] [2]\n        add block [-50] [-500] [-200] to [50] [-480] [-100] [31]\n        -- [appelmoeshapje :\)]\n        add block [-10] [-480] [-190] to [10] [-450] [-170] [11]\n        add block [-5] [-450] [-185] to [5] [-445] [-175] [13]\n        add block [-10] [-445] [-190] to [10] [-437] [-170] [12]\n        add block [-7] [-460] [-192] to [-2] [-455] [-190] [14]\n        add block [2] [-460] [-192] to [7] [-455] [-190] [14]\n        add block [-5] [-458] [-194] to [-4] [-457] [-192] [13]\n        add block [4] [-458] [-194] to [5] [-457] [-192] [13]\n        add block [-7] [-475] [-195] to [7] [-473] [-190] [13]\n        -- [not appelmoeshapje :\(]\n        add block [-80] [-80] [150] to [80] [-60] [200] [1]\n        add block [-80] [-500] [150] to [80] [-80] [200] [2]\n        add block [-60] [-60] [250] to [60] [-40] [300] [1]\n        add block [-60] [-500] [250] to [60] [-60] [300] [2]\n        add block [-50] [-40] [350] to [50] [-20] [400] [1]\n        add block [-50] [-500] [350] to [50] [-40] [400] [2]\n        add block [-50] [-40] [450] to [50] [-20] [550] [1]\n        add block [-50] [-500] [450] to [50] [-40] [550] [2]\n        add block [-250] [-40] [500] to [-150] [-20] [600] [1]\n        add block [-250] [-500] [500] to [-150] [-40] [600] [2]\n        add block [-300] [-40] [700] to [-200] [-20] [800] [1]\n        add block [-300] [-500] [700] to [-200] [-40] [800] [2]\n        add block [-700] [-40] [750] to [-400] [-20] [850] [1]\n        add block [-800] [-40] [750] to [-700] [-20] [950] [1]\n        add block [-700] [-500] [750] to [-400] [-40] [950] [2]\n        add block [-800] [-500] [750] to [-700] [-40] [950] [2]\n        add block [-760] [-20] [890] to [-740] [55] [910] [3]\n        add block [-790] [55] [860] to [-710] [135] [940] [15]\n        add block [-700] [105] [850] to [-600] [125] [950] [1]\n        add block [-700] [-40] [850] to [-600] [105] [950] [2]\n        add block [-600] [-40] [850] to [-500] [250] [950] [2]\n        add block [-500] [-40] [850] to [-400] [495] [950] [2]\n        add block [-600] [250] [850] to [-500] [270] [950] [1]\n        add block [-500] [495] [850] to [-400] [515] [950] [1]\n        add block [-660] [125] [890] to [-640] [200] [910] [3]\n        add block [-690] [200] [860] to [-610] [280] [940] [15]\n        add block [-560] [270] [890] to [-540] [345] [910] [3]\n        add block [-590] [345] [860] to [-510] [425] [940] [15]\n        add block [-550] [-500] [1025] to [-350] [495] [1575] [2]\n        add block [-550] [495] [1025] to [-350] [515] [1575] [1]\n        add block [-550] [515] [1175] to [-350] [550] [1195] [3]\n        add block [-550] [550] [1175] to [-530] [565] [1195] [4]\n        add block [-530] [550] [1175] to [-510] [565] [1195] [4]\n        add block [-510] [550] [1175] to [-490] [565] [1195] [4]\n        add block [-490] [550] [1175] to [-470] [565] [1195] [4]\n        add block [-470] [550] [1175] to [-450] [565] [1195] [4]\n        add block [-450] [550] [1175] to [-430] [565] [1195] [4]\n        add block [-430] [550] [1175] to [-410] [565] [1195] [4]\n        add block [-410] [550] [1175] to [-390] [565] [1195] [4]\n        add block [-390] [550] [1175] to [-370] [565] [1195] [4]\n        add block [-370] [550] [1175] to [-350] [565] [1195] [4]\n        add block [-550] [515] [1275] to [-350] [550] [1295] [3]\n        add block [-550] [550] [1275] to [-530] [565] [1295] [4]\n        add block [-530] [550] [1275] to [-510] [565] [1295] [4]\n        add block [-510] [550] [1275] to [-490] [565] [1295] [4]\n        add block [-490] [550] [1275] to [-470] [565] [1295] [4]\n        add block [-470] [550] [1275] to [-450] [565] [1295] [4]\n        add block [-450] [550] [1275] to [-430] [565] [1295] [4]\n        add block [-430] [550] [1275] to [-410] [565] [1295] [4]\n        add block [-410] [550] [1275] to [-390] [565] [1295] [4]\n        add block [-390] [550] [1275] to [-370] [565] [1295] [4]\n        add block [-370] [550] [1275] to [-350] [565] [1295] [4]\n        -- [idk why I put this here but atleast now you have something to read while looking inside this project]\n        add block [-550] [515] [1375] to [-350] [550] [1395] [3]\n        add block [-550] [550] [1375] to [-530] [565] [1395] [4]\n        add block [-530] [550] [1375] to [-510] [565] [1395] [4]\n        add block [-510] [550] [1375] to [-490] [565] [1395] [4]\n        add block [-490] [550] [1375] to [-470] [565] [1395] [4]\n        add block [-470] [550] [1375] to [-450] [565] [1395] [4]\n        add block [-450] [550] [1375] to [-430] [565] [1395] [4]\n        add block [-430] [550] [1375] to [-410] [565] [1395] [4]\n        add block [-410] [550] [1375] to [-390] [565] [1395] [4]\n        add block [-390] [550] [1375] to [-370] [565] [1395] [4]\n        add block [-370] [550] [1375] to [-350] [565] [1395] [4]\n        add block [-500] [515] [1505] to [-400] [615] [1525] [10]\n        add block [-550] [515] [1475] to [-500] [690] [1575] [2]\n        add block [-400] [515] [1475] to [-350] [690] [1575] [2]\n        add block [-500] [615] [1475] to [-400] [690] [1575] [32]\n        add block [-550] [690] [1475] to [-350] [710] [1575] [1]\n        add block [-480] [-20] [770] to [-420] [0] [830] [7]\n        add block [-480] [515] [1070] to [-420] [535] [1130] [7]\n    else\n        if <(level) = [3]> then\n            add block [-100] [-100] [-100] to [100] [-80] [100] [16]\n            add block [-100] [-500] [-100] to [100] [-100] [100] [17]\n            add block [25] [-80] [275] to [125] [-60] [375] [16]\n            add block [25] [-500] [275] to [125] [-80] [375] [17]\n            add block [-100] [-60] [525] to [0] [-40] [625] [16]\n            add block [-100] [-500] [525] to [0] [-60] [625] [17]\n            add block [175] [-40] [625] to [275] [-20] [725] [16]\n            add block [175] [-500] [625] to [275] [-40] [725] [17]\n            add block [475] [-20] [575] to [675] [0] [775] [16]\n            add block [475] [-500] [575] to [675] [-20] [775] [17]\n            add block [475] [-20] [575] to [675] [0] [775] [16]\n            add block [475] [-500] [575] to [675] [-20] [775] [17]\n            add block [545] [0] [645] to [605] [20] [705] [7]\n            add block [475] [-500] [850] to [525] [500] [1000] [17]\n            add block [625] [-500] [850] to [675] [500] [1000] [17]\n            add block [475] [500] [850] to [525] [520] [1000] [16]\n            add block [625] [500] [850] to [675] [520] [1000] [16]\n            add block [525] [-20] [850] to [575] [0] [1000] [16]\n            add block [575] [130] [850] to [625] [150] [1000] [16]\n            add block [525] [280] [850] to [575] [300] [1000] [16]\n            add block [575] [430] [850] to [625] [450] [1000] [16]\n            add block [525] [-40] [850] to [575] [-20] [1000] [19]\n            add block [575] [110] [850] to [625] [130] [1000] [19]\n            add block [525] [260] [850] to [575] [280] [1000] [19]\n            add block [575] [410] [850] to [625] [430] [1000] [19]\n            add block [542] [0] [950] to [562] [75] [975] [18]\n            add block [605] [150] [870] to [620] [220] [885] [18]\n            add block [593] [150] [872] to [602] [200] [885] [18]\n            add block [605] [150] [887] to [613] [180] [896] [18]\n            add block [590] [450] [890] to [610] [530] [910] [18]\n            add block [594] [490] [870] to [606] [502] [890] [18]\n            add block [594] [490] [870] to [606] [525] [882] [18]\n            add block [594] [475] [910] to [606] [487] [920] [18]\n            add block [594] [475] [920] to [606] [510] [932] [18]\n            add block [425] [350] [1250] to [725] [370] [1350] [16]\n            add block [425] [-500] [1250] to [725] [350] [1350] [17]\n            add block [425] [200] [1600] to [725] [220] [1700] [16]\n            add block [425] [-500] [1600] to [725] [200] [1700] [17]\n            add block [425] [50] [1950] to [725] [70] [2050] [16]\n            add block [425] [-500] [1950] to [725] [50] [2050] [17]\n            add block [425] [50] [2250] to [725] [70] [2500] [16]\n            add block [425] [-500] [2250] to [725] [50] [2500] [17]\n            add block [525] [70] [2430] to [625] [170] [2450] [10]\n            add block [625] [70] [2400] to [725] [220] [2500] [17]\n            add block [425] [70] [2400] to [525] [220] [2500] [17]\n            add block [525] [170] [2400] to [625] [220] [2500] [19]\n            add block [425] [220] [2400] to [725] [240] [2500] [16]\n            add block [525] [70] [2450] to [625] [170] [2460] [17]\n            -- [steve but faceless]\n            add block [565] [70] [2470] to [585] [100] [2480] [22]\n            add block [565] [100] [2470] to [585] [130] [2480] [23]\n            add block [555] [130] [2470] to [595] [140] [2480] [23]\n            add block [555] [100] [2470] to [565] [130] [2480] [24]\n            add block [585] [100] [2470] to [595] [130] [2480] [24]\n            add block [565] [140] [2465] to [585] [151] [2485] [24]\n            add block [565] [152] [2465] to [585] [155] [2485] [25]\n        else\n            if <(level) = [4]> then\n                add block [-100] [-100] [-100] to [100] [-80] [100] [20]\n                add block [-100] [-500] [-100] to [100] [-100] [100] [21]\n                add block [-25] [-120] [250] to [75] [-100] [450] [20]\n                add block [-25] [-500] [250] to [75] [-120] [450] [21]\n                add block [-75] [-140] [600] to [25] [-120] [800] [20]\n                add block [-75] [-500] [600] to [25] [-140] [800] [21]\n                add block [-25] [-160] [950] to [75] [-140] [1150] [20]\n                add block [-25] [-500] [950] to [75] [-160] [1150] [21]\n                add block [-75] [-180] [1300] to [25] [-160] [1500] [20]\n                add block [-75] [-500] [1300] to [25] [-180] [1500] [21]\n                add block [-100] [-200] [1650] to [100] [-180] [1850] [20]\n                add block [-100] [-500] [1650] to [100] [-200] [1850] [21]\n                add block [-30] [-180] [1720] to [30] [-160] [1780] [7]\n                add block [200] [-160] [1675] to [300] [-140] [1775] [20]\n                add block [200] [-500] [1675] to [300] [-160] [1775] [21]\n                add block [400] [-120] [1600] to [500] [-100] [1700] [20]\n                add block [400] [-500] [1600] to [500] [-120] [1700] [21]\n                add block [425] [-80] [1400] to [525] [-60] [1500] [20]\n                add block [425] [-500] [1400] to [525] [-80] [1500] [21]\n                add block [375] [-40] [1200] to [475] [-20] [1300] [20]\n                add block [375] [-500] [1200] to [475] [-40] [1300] [21]\n                add block [300] [0] [1025] to [400] [20] [1125] [20]\n                add block [300] [-500] [1025] to [400] [0] [1125] [21]\n                add block [250] [40] [850] to [350] [60] [950] [20]\n                add block [250] [-500] [850] to [350] [40] [950] [21]\n                add block [225] [80] [700] to [325] [100] [800] [20]\n                add block [225] [-500] [700] to [325] [80] [800] [21]\n                add block [75] [120] [675] to [175] [140] [775] [20]\n                add block [75] [-500] [675] to [175] [120] [775] [21]\n                add block [-175] [120] [675] to [-75] [140] [775] [20]\n                add block [-175] [-500] [675] to [-75] [120] [775] [21]\n                add block [-425] [160] [825] to [-225] [180] [1025] [20]\n                add block [-425] [-500] [825] to [-225] [160] [1025] [21]\n                add block [-355] [180] [895] to [-295] [200] [955] [7]\n                add block [-350] [160] [1125] to [-250] [180] [1225] [20]\n                add block [-350] [-500] [1125] to [-250] [160] [1225] [21]\n                add block [-500] [160] [1375] to [-400] [180] [1475] [20]\n                add block [-500] [-500] [1375] to [-400] [160] [1475] [21]\n                add block [-550] [160] [1725] to [-450] [180] [1825] [20]\n                add block [-550] [-500] [1725] to [-450] [160] [1825] [21]\n                add block [-675] [160] [1975] to [-475] [180] [2375] [20]\n                add block [-675] [-500] [1975] to [-475] [160] [2375] [21]\n                add block [-675] [120] [2375] to [-475] [140] [2775] [20]\n                add block [-675] [-500] [2375] to [-475] [120] [2775] [21]\n                add block [-675] [80] [2775] to [-475] [100] [3175] [20]\n                add block [-675] [-500] [2775] to [-475] [80] [3175] [21]\n                add block [-675] [40] [3175] to [-475] [60] [4000] [20]\n                add block [-675] [-500] [3175] to [-475] [40] [4000] [21]\n                add block [-625] [60] [3920] to [-525] [160] [4000] [10]\n                add block [-675] [60] [3900] to [-625] [160] [4000] [21]\n                add block [-525] [60] [3900] to [-475] [160] [4000] [21]\n                add block [-675] [160] [3900] to [-475] [210] [4000] [21]\n                add block [-675] [210] [3900] to [-475] [230] [4000] [20]\n                -- [gekke paul]\n                add block [-750] [-400] [2980] to [-750] [-350] [3020] [33]\n                add block [-750] [-440] [2980] to [-750] [-400] [2990] [33]\n                add block [-750] [-440] [3010] to [-750] [-400] [3020] [33]\n                add block [-750] [-360] [3020] to [-750] [-350] [3060] [33]\n                add block [-750] [-360] [2940] to [-750] [-350] [2980] [33]\n                add block [-750] [-360] [2920] to [-750] [-340] [2940] [33]\n                add block [-750] [-350] [2990] to [-750] [-330] [3010] [33]\n                add block [-800] [-460] [2950] to [-675] [-440] [3050] [20]\n                add block [-800] [-480] [2950] to [-675] [-460] [3050] [21]\n            else\n                if <(level) = [5]> then\n                    add block [-100] [-100] [-100] to [100] [-80] [100] [1]\n                    add block [-100] [-500] [-100] to [100] [-100] [100] [2]\n                    add block [-25] [-80] [200] to [75] [-60] [300] [1]\n                    add block [-25] [-500] [200] to [75] [-80] [300] [2]\n                    add block [-100] [-60] [400] to [0] [-40] [500] [1]\n                    add block [-100] [-500] [400] to [0] [-60] [500] [2]\n                    add block [25] [-40] [700] to [125] [-20] [800] [1]\n                    add block [25] [-500] [700] to [125] [-40] [800] [2]\n                    add block [300] [-20] [750] to [400] [0] [850] [1]\n                    add block [300] [-500] [750] to [400] [-20] [850] [2]\n                    add block [500] [60] [825] to [700] [80] [1025] [26]\n                    add block [500] [-500] [825] to [700] [60] [1025] [28]\n                    add block [570] [80] [895] to [630] [100] [955] [7]\n                    add block [600] [60] [1100] to [700] [80] [1200] [26]\n                    add block [600] [40] [1100] to [700] [60] [1200] [27]\n                    add block [600] [60] [1400] to [700] [80] [1500] [26]\n                    add block [600] [40] [1400] to [700] [60] [1500] [27]\n                    add block [600] [110] [1600] to [700] [130] [1700] [26]\n                    add block [600] [90] [1600] to [700] [110] [1700] [27]\n                    add block [600] [160] [1800] to [700] [180] [1900] [26]\n                    add block [600] [140] [1800] to [700] [160] [1900] [27]\n                    add block [600] [280] [1950] to [700] [300] [2050] [26]\n                    add block [600] [260] [1950] to [700] [280] [2050] [27]\n                    add block [700] [340] [700] to [900] [360] [2100] [26]\n                    add block [700] [-500] [700] to [900] [340] [2100] [28]\n                    add block [700] [500] [1850] to [900] [520] [1900] [26]\n                    add block [700] [360] [1850] to [900] [500] [1900] [28]\n                    add block [700] [450] [1550] to [900] [470] [1600] [26]\n                    add block [700] [360] [1550] to [900] [450] [1600] [28]\n                    add block [700] [580] [1400] to [900] [600] [1450] [26]\n                    add block [700] [360] [1400] to [900] [580] [1450] [28]\n                    add block [700] [410] [1150] to [900] [430] [1200] [26]\n                    add block [700] [360] [1150] to [900] [410] [1200] [28]\n                    add block [700] [410] [1000] to [900] [430] [1050] [26]\n                    add block [700] [360] [1000] to [2000] [410] [1050] [28]\n                    -- [heloo I am currently really bored ok bye]\n                    add block [900] [300] [1000] to [2000] [800] [2200] [28]\n                    add block [900] [-500] [1000] to [2000] [300] [2200] [28]\n                    add block [900] [360] [700] to [2000] [600] [750] [28]\n                    add block [900] [-500] [700] to [2000] [360] [750] [28]\n                    add block [700] [360] [700] to [900] [620] [750] [28]\n                    add block [700] [620] [700] to [900] [640] [750] [26]\n                    add block [800] [400] [625] to [900] [420] [700] [28]\n                    add block [800] [420] [625] to [900] [440] [700] [26]\n                    add block [1000] [-500] [625] to [1500] [460] [700] [28]\n                    add block [1000] [460] [625] to [1500] [480] [700] [26]\n                    add block [900] [600] [700] to [2000] [620] [1000] [27]\n                    add block [900] [620] [700] to [2000] [640] [1000] [26]\n                    add block [900] [340] [750] to [1450] [360] [1000] [26]\n                    add block [1000] [360] [750] to [1050] [600] [900] [28]\n                    add block [1200] [360] [850] to [1250] [600] [1000] [28]\n                    add block [1450] [320] [750] to [2000] [340] [1000] [29]\n                    add block [1550] [340] [775] to [1650] [360] [875] [26]\n                    add block [1725] [340] [900] to [1825] [360] [1000] [26]\n                    add block [1925] [360] [750] to [2000] [380] [850] [26]\n                    add block [1925] [340] [750] to [2000] [360] [850] [28]\n                    add block [2000] [360] [750] to [2150] [380] [1200] [26]\n                    add block [2000] [-500] [750] to [2150] [360] [1200] [28]\n                    add block [2000] [360] [1300] to [2150] [380] [1400] [26]\n                    add block [2000] [340] [1300] to [2150] [360] [1400] [27]\n                    add block [2000] [460] [1500] to [2150] [480] [1600] [26]\n                    add block [2000] [440] [1500] to [2150] [460] [1600] [27]\n                    add block [2000] [560] [1300] to [2150] [580] [1400] [26]\n                    add block [2000] [540] [1300] to [2150] [560] [1400] [27]\n                    add block [2000] [660] [1500] to [2150] [680] [1600] [26]\n                    add block [2000] [640] [1500] to [2150] [660] [1600] [27]\n                    add block [2000] [800] [1700] to [2150] [820] [1800] [26]\n                    add block [2000] [780] [1700] to [2150] [800] [1800] [27]\n                    add block [1100] [800] [1200] to [1800] [850] [2000] [29]\n                    add block [770] [360] [845] to [830] [380] [905] [7]\n                    add block [2045] [380] [845] to [2105] [400] [905] [7]\n                    add block [900] [800] [1000] to [1100] [950] [2200] [28]\n                    add block [1800] [800] [1000] to [2000] [950] [2200] [28]\n                    add block [1100] [800] [2000] to [1800] [950] [2200] [28]\n                    add block [1100] [800] [1000] to [1800] [950] [1200] [28]\n                    add block [900] [950] [1000] to [1100] [970] [2200] [26]\n                    add block [1800] [950] [1000] to [2000] [970] [2200] [26]\n                    add block [1100] [950] [2000] to [1800] [970] [2200] [26]\n                    add block [1100] [950] [1000] to [1800] [970] [1200] [26]\n                    add block [1870] [970] [1470] to [1930] [990] [1530] [7]\n                    add block [1600] [980] [1450] to [1700] [1000] [1550] [26]\n                    add block [1600] [850] [1450] to [1700] [980] [1550] [28]\n                    add block [1400] [1020] [1500] to [1500] [1040] [1600] [26]\n                    add block [1400] [850] [1500] to [1500] [1020] [1600] [28]\n                    add block [1250] [1060] [1575] to [1350] [1080] [1675] [26]\n                    add block [1250] [850] [1575] to [1350] [1060] [1675] [28]\n                    add block [1250] [1100] [1775] to [1350] [1120] [1875] [26]\n                    add block [1250] [850] [1775] to [1350] [1100] [1875] [28]\n                    add block [1250] [1230] [1900] to [1350] [1250] [2000] [30]\n                    add block [1300] [1330] [2100] to [1400] [1350] [2200] [30]\n                    add block [1200] [1430] [2300] to [1300] [1450] [2400] [30]\n                    add block [1250] [1530] [2500] to [1350] [1550] [2600] [30]\n                    add block [1150] [1530] [2750] to [1450] [1550] [3050] [30]\n                    add block [1250] [1550] [2970] to [1350] [1650] [3000] [10]\n                    add block [1250] [1650] [2950] to [1350] [1700] [3050] [30]\n                    add block [1150] [1550] [2950] to [1250] [1700] [3050] [30]\n                    add block [1350] [1550] [2950] to [1450] [1700] [3050] [30]\n                    add block [1250] [1550] [3000] to [1350] [1650] [3050] [30]\n                    add block [1600] [-370] [2200] to [1700] [-350] [2300] [26]\n                    add block [1600] [-390] [2200] to [1700] [-370] [2300] [27]\n                    add block [1645] [-350] [2245] to [1655] [-300] [2255] [34]\n                    add block [1640] [-300] [2240] to [1660] [-280] [2260] [34]\n                end\n            end\n        end\n    end\nend\n-- [player]\nadd triangle [10] [10] [10] to [10] [-10] [10] to [-10] [-10] [10] [1000] [80] [4]\nadd triangle [-10] [-10] [10] to [-10] [10] [10] to [10] [10] [10] [1000] [80] [4]\nadd triangle [10] [10] [-10] to [10] [-10] [-10] to [-10] [-10] [-10] [1000] [60] [3]\nadd triangle [-10] [-10] [-10] to [-10] [10] [-10] to [10] [10] [-10] [1000] [60] [3]\nadd triangle [10] [10] [10] to [10] [-10] [10] to [10] [-10] [-10] [1000] [80] [5]\nadd triangle [10] [-10] [-10] to [10] [10] [-10] to [10] [10] [10] [1000] [80] [5]\nadd triangle [-10] [10] [10] to [-10] [-10] [10] to [-10] [-10] [-10] [1000] [60] [6]\nadd triangle [-10] [-10] [-10] to [-10] [10] [-10] to [-10] [10] [10] [1000] [60] [6]\nadd triangle [10] [10] [10] to [10] [10] [-10] to [-10] [10] [-10] [1000] [90] [1]\nadd triangle [-10] [10] [-10] to [-10] [10] [10] to [10] [10] [10] [1000] [90] [1]\nreset\nerase all\nrender\nbroadcast (hide loading v) and wait\n\nadd block [200] [-100] [1100] to [250] [200] [1300] [5]\n\ndefine add block (x1) (y1) (z1) to (x2) (y2) (z2) (t)\nadd (x1) to [block x1 v]\nadd (x2) to [block x2 v]\nadd (y1) to [block y1 v]\nadd (y2) to [block y2 v]\nadd (z1) to [block z1 v]\nadd (z2) to [block z2 v]\nadd (t) to [blocks t v]\nif <(t) = [4]> then\n    add triangle (x1) (y1) (z1) to (x2) (y1) (z1) to (((x1) + (x2)) / (2)) (y2) (((z1) + (z2)) / (2)) [4] [60] [0]\n    add triangle (x2) (y1) (z1) to (x2) (y1) (z2) to (((x1) + (x2)) / (2)) (y2) (((z1) + (z2)) / (2)) [4] [80] [0]\n    add triangle (x1) (y1) (z2) to (x2) (y1) (z2) to (((x1) + (x2)) / (2)) (y2) (((z1) + (z2)) / (2)) [4] [80] [0]\n    add triangle (x1) (y1) (z1) to (x1) (y1) (z2) to (((x1) + (x2)) / (2)) (y2) (((z1) + (z2)) / (2)) [4] [60] [0]\nelse\n    if <(t) = [7]> then\n        add triangle (x1) ((y2) + (-5)) (z1) to (x2) ((y2) + (-5)) (z1) to (x1) ((y2) + (-5)) (z2) (t) [90] [1]\n        add triangle (x2) ((y2) + (-5)) (z2) to (x2) ((y2) + (-5)) (z1) to (x1) ((y2) + (-5)) (z2) (t) [90] [1]\n        add triangle (x1) (y1) (z1) to (x1) ((y2) + (-5)) (z1) to (x2) (y1) (z1) (t) [60] [3]\n        add triangle (x1) ((y2) + (-5)) (z1) to (x2) ((y2) + (-5)) (z1) to (x2) (y1) (z1) (t) [60] [3]\n        add triangle (x1) (y1) (z2) to (x1) ((y2) + (-5)) (z2) to (x2) ((y2) + (-5)) (z2) (t) [80] [4]\n        add triangle (x2) (y1) (z2) to (x2) ((y2) + (-5)) (z2) to (x1) (y1) (z2) (t) [80] [4]\n        add triangle (x1) (y1) (z2) to (x1) ((y2) + (-5)) (z1) to (x1) ((y2) + (-5)) (z2) (t) [60] [5]\n        add triangle (x1) ((y2) + (-5)) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [60] [5]\n        add triangle (x2) (y1) (z2) to (x2) ((y2) + (-5)) (z1) to (x2) ((y2) + (-5)) (z2) (t) [80] [6]\n        add triangle (x2) ((y2) + (-5)) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [80] [6]\n        add triangle ((x1) + (10)) (y2) ((z1) + (10)) to ((x2) + (-10)) (y2) ((z1) + (10)) to ((x1) + (10)) (y2) ((z2) + (-10)) [8] [90] [1]\n        add triangle ((x2) + (-10)) (y2) ((z2) + (-10)) to ((x2) + (-10)) (y2) ((z1) + (10)) to ((x1) + (10)) (y2) ((z2) + (-10)) [8] [90] [1]\n        add triangle ((x1) + (10)) ((y1) + (15)) ((z1) + (10)) to ((x1) + (10)) (y2) ((z1) + (10)) to ((x2) + (-10)) ((y1) + (15)) ((z1) + (10)) [8] [60] [3]\n        add triangle ((x1) + (10)) (y2) ((z1) + (10)) to ((x2) + (-10)) (y2) ((z1) + (10)) to ((x2) + (-10)) ((y1) + (15)) ((z1) + (10)) [8] [60] [3]\n        add triangle ((x1) + (10)) ((y1) + (15)) ((z2) + (-10)) to ((x1) + (10)) (y2) ((z2) + (-10)) to ((x2) + (-10)) (y2) ((z2) + (-10)) [8] [80] [4]\n        add triangle ((x2) + (-10)) ((y1) + (15)) ((z2) + (-10)) to ((x2) + (-10)) (y2) ((z2) + (-10)) to ((x1) + (10)) ((y1) + (15)) ((z2) + (-10)) [8] [80] [4]\n        add triangle ((x1) + (10)) ((y1) + (15)) ((z2) + (-10)) to ((x1) + (10)) (y2) ((z1) + (10)) to ((x1) + (10)) (y2) ((z2) + (-10)) [8] [60] [5]\n        add triangle ((x1) + (10)) (y2) ((z1) + (10)) to ((x1) + (10)) ((y1) + (15)) ((z1) + (10)) to ((x1) + (10)) ((y1) + (15)) ((z2) + (-10)) [8] [60] [5]\n        add triangle ((x2) + (-10)) ((y1) + (15)) ((z2) + (-10)) to ((x2) + (-10)) (y2) ((z1) + (10)) to ((x2) + (-10)) (y2) ((z2) + (-10)) [8] [80] [6]\n        add triangle ((x2) + (-10)) (y2) ((z1) + (10)) to ((x2) + (-10)) ((y1) + (15)) ((z1) + (10)) to ((x2) + (-10)) ((y1) + (15)) ((z2) + (-10)) [8] [80] [6]\n    else\n        if <(t) = [10]> then\n            add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [0] [3]\n            add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [0] [3]\n        else\n            if <(t) = [13]> then\n                add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [0] [1]\n                add triangle (x2) (y2) (z2) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [0] [1]\n                add triangle (x1) (y1) (z1) to (x2) (y1) (z1) to (x1) (y1) (z2) (t) [0] [2]\n                add triangle (x2) (y1) (z2) to (x2) (y1) (z1) to (x1) (y1) (z2) (t) [0] [2]\n                add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [0] [3]\n                add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [0] [3]\n                add triangle (x1) (y1) (z2) to (x1) (y2) (z2) to (x2) (y2) (z2) (t) [0] [4]\n                add triangle (x2) (y1) (z2) to (x2) (y2) (z2) to (x1) (y1) (z2) (t) [0] [4]\n                add triangle (x1) (y1) (z2) to (x1) (y2) (z1) to (x1) (y2) (z2) (t) [0] [5]\n                add triangle (x1) (y2) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [0] [5]\n                add triangle (x2) (y1) (z2) to (x2) (y2) (z1) to (x2) (y2) (z2) (t) [0] [6]\n                add triangle (x2) (y2) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [0] [6]\n            else\n                if <<<<(t) = [1]> or <(t) = [20]>> or <(t) = [26]>> or <(t) = [31]>> then\n                    add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                    add triangle (x2) (y2) (z2) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                    add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                    add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                    add triangle (x1) (y1) (z2) to (x1) (y2) (z2) to (x2) (y2) (z2) (t) [80] [4]\n                    add triangle (x2) (y1) (z2) to (x2) (y2) (z2) to (x1) (y1) (z2) (t) [80] [4]\n                    add triangle (x1) (y1) (z2) to (x1) (y2) (z1) to (x1) (y2) (z2) (t) [60] [5]\n                    add triangle (x1) (y2) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [60] [5]\n                    add triangle (x2) (y1) (z2) to (x2) (y2) (z1) to (x2) (y2) (z2) (t) [80] [6]\n                    add triangle (x2) (y2) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [80] [6]\n                else\n                    if <<<(t) = [2]> or <(t) = [21]>> or <(t) = [28]>> then\n                        add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                        add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                        add triangle (x1) (y1) (z2) to (x1) (y2) (z2) to (x2) (y2) (z2) (t) [80] [4]\n                        add triangle (x2) (y1) (z2) to (x2) (y2) (z2) to (x1) (y1) (z2) (t) [80] [4]\n                        add triangle (x1) (y1) (z2) to (x1) (y2) (z1) to (x1) (y2) (z2) (t) [60] [5]\n                        add triangle (x1) (y2) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [60] [5]\n                        add triangle (x2) (y1) (z2) to (x2) (y2) (z1) to (x2) (y2) (z2) (t) [80] [6]\n                        add triangle (x2) (y2) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [80] [6]\n                    else\n                        if <(t) = [3]> then\n                            add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                            add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                            add triangle (x1) (y1) (z2) to (x1) (y2) (z2) to (x2) (y2) (z2) (t) [80] [4]\n                            add triangle (x2) (y1) (z2) to (x2) (y2) (z2) to (x1) (y1) (z2) (t) [80] [4]\n                            add triangle (x1) (y1) (z2) to (x1) (y2) (z1) to (x1) (y2) (z2) (t) [60] [5]\n                            add triangle (x1) (y2) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [60] [5]\n                            add triangle (x2) (y1) (z2) to (x2) (y2) (z1) to (x2) (y2) (z2) (t) [80] [6]\n                            add triangle (x2) (y2) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [80] [6]\n                        else\n                            if <(t) = [11]> then\n                                add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                                add triangle (x2) (y2) (z2) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                                add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                add triangle (x1) (y1) (z2) to (x1) (y2) (z2) to (x2) (y2) (z2) (t) [80] [4]\n                                add triangle (x2) (y1) (z2) to (x2) (y2) (z2) to (x1) (y1) (z2) (t) [80] [4]\n                                add triangle (x1) (y1) (z2) to (x1) (y2) (z1) to (x1) (y2) (z2) (t) [60] [5]\n                                add triangle (x1) (y2) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [60] [5]\n                                add triangle (x2) (y1) (z2) to (x2) (y2) (z1) to (x2) (y2) (z2) (t) [80] [6]\n                                add triangle (x2) (y2) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [80] [6]\n                            else\n                                if <(t) = [16]> then\n                                    add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                                    add triangle (x2) (y2) (z2) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                                    add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                    add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                    add triangle (x1) (y1) (z2) to (x1) (y2) (z2) to (x2) (y2) (z2) (t) [80] [4]\n                                    add triangle (x2) (y1) (z2) to (x2) (y2) (z2) to (x1) (y1) (z2) (t) [80] [4]\n                                    add triangle (x1) (y1) (z2) to (x1) (y2) (z1) to (x1) (y2) (z2) (t) [60] [5]\n                                    add triangle (x1) (y2) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [60] [5]\n                                    add triangle (x2) (y1) (z2) to (x2) (y2) (z1) to (x2) (y2) (z2) (t) [80] [6]\n                                    add triangle (x2) (y2) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [80] [6]\n                                else\n                                    if <(t) = [17]> then\n                                        add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                        add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                        add triangle (x1) (y1) (z2) to (x1) (y2) (z2) to (x2) (y2) (z2) (t) [80] [4]\n                                        add triangle (x2) (y1) (z2) to (x2) (y2) (z2) to (x1) (y1) (z2) (t) [80] [4]\n                                        add triangle (x1) (y1) (z2) to (x1) (y2) (z1) to (x1) (y2) (z2) (t) [60] [5]\n                                        add triangle (x1) (y2) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [60] [5]\n                                        add triangle (x2) (y1) (z2) to (x2) (y2) (z1) to (x2) (y2) (z2) (t) [80] [6]\n                                        add triangle (x2) (y2) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [80] [6]\n                                    else\n                                        if <<<(t) = [19]> or <(t) = [27]>> or <(t) = [32]>> then\n                                            add triangle (x1) (y1) (z1) to (x2) (y1) (z1) to (x1) (y1) (z2) (t) [90] [2]\n                                            add triangle (x2) (y1) (z2) to (x2) (y1) (z1) to (x1) (y1) (z2) (t) [90] [2]\n                                            add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                            add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                            add triangle (x1) (y1) (z2) to (x1) (y2) (z2) to (x2) (y2) (z2) (t) [80] [4]\n                                            add triangle (x2) (y1) (z2) to (x2) (y2) (z2) to (x1) (y1) (z2) (t) [80] [4]\n                                            add triangle (x1) (y1) (z2) to (x1) (y2) (z1) to (x1) (y2) (z2) (t) [60] [5]\n                                            add triangle (x1) (y2) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [60] [5]\n                                            add triangle (x2) (y1) (z2) to (x2) (y2) (z1) to (x2) (y2) (z2) (t) [80] [6]\n                                            add triangle (x2) (y2) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [80] [6]\n                                        else\n                                            if <(t) = [29]> then\n                                                add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                                                add triangle (x2) (y2) (z2) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                                            else\n                                                add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                                                add triangle (x2) (y2) (z2) to (x2) (y2) (z1) to (x1) (y2) (z2) (t) [90] [1]\n                                                add triangle (x1) (y1) (z1) to (x2) (y1) (z1) to (x1) (y1) (z2) (t) [90] [2]\n                                                add triangle (x2) (y1) (z2) to (x2) (y1) (z1) to (x1) (y1) (z2) (t) [90] [2]\n                                                add triangle (x1) (y1) (z1) to (x1) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                                add triangle (x1) (y2) (z1) to (x2) (y2) (z1) to (x2) (y1) (z1) (t) [60] [3]\n                                                add triangle (x1) (y1) (z2) to (x1) (y2) (z2) to (x2) (y2) (z2) (t) [80] [4]\n                                                add triangle (x2) (y1) (z2) to (x2) (y2) (z2) to (x1) (y1) (z2) (t) [80] [4]\n                                                add triangle (x1) (y1) (z2) to (x1) (y2) (z1) to (x1) (y2) (z2) (t) [60] [5]\n                                                add triangle (x1) (y2) (z1) to (x1) (y1) (z1) to (x1) (y1) (z2) (t) [60] [5]\n                                                add triangle (x2) (y1) (z2) to (x2) (y2) (z1) to (x2) (y2) (z2) (t) [80] [6]\n                                                add triangle (x2) (y2) (z1) to (x2) (y1) (z1) to (x2) (y1) (z2) (t) [80] [6]\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine add triangle (x1) (y1) (z1) to (x2) (y2) (z2) to (x3) (y3) (z3) (t) (c) (dir)\nadd (x1) to [triangle x1 v]\nadd (x2) to [triangle x2 v]\nadd (x3) to [triangle x3 v]\nadd (y1) to [triangle y1 v]\nadd (y2) to [triangle y2 v]\nadd (y3) to [triangle y3 v]\nadd (z1) to [triangle z1 v]\nadd (z2) to [triangle z2 v]\nadd (z3) to [triangle z3 v]\nadd (t) to [triangle t v]\nadd (c) to [triangle c v]\nadd [0] to [triangle d v]\nadd (dir) to [triangle dir v]\n\ndefine set cam\nif <not <(b animation) = [13]>> then\n    set [camx v] to (round ((b player x) + ((sinY) * ((-200) - (([abs v] of (sinX) ) * ((-200) + ((cosX) * (200))))))))\n    if <not <(b animation) = [12]>> then\n        set [camy v] to (round (((b player y) + (20)) - ((sinX) * (200))))\n    end\n    set [camz v] to (round ((b player z) - ((cosY) * ((200) - (([abs v] of (sinX) ) * ((200) + ((cosX) * (-200))))))))\nend\n\ndefine change y by (y)\nchange [b player y v] by (y)\nset [c i v] to [0]\nset [f hit something y v] to [0]\nrepeat (length of [block x1 v])\n    change [c i v] by (1)\n    check collision\n    if <(c t) = [0]> then\nend\n\ndefine y sort\ndelete all of [tri dist v]\ndelete all of [tri sort v]\ndelete all of [triangle d v]\nset [s i v] to [0]\nrepeat (length of [triangle x1 v])\n    change [s i v] by (1)\n    distance ((((item (s i) of [triangle x1 v]) + (item (s i) of [triangle x2 v])) + (item (s i) of [triangle x3 v])) / (3)) ((((item (s i) of [triangle y1 v]) + (item (s i) of [triangle y2 v])) + (item (s i) of [triangle y3 v])) / (3)) ((((item (s i) of [triangle z1 v]) + (item (s i) of [triangle z2 v])) + (item (s i) of [triangle z3 v])) / (3)) to (camX) (camY) (camZ)\n    set [s highest v] to (length of [tri dist v])\n    repeat until <(a distance) > (item (s highest) of [tri dist v])>\n        change [s highest v] by (-1)\n    end\n    insert (a distance) at ((s highest) + (1)) of [tri dist v] \n    insert (s i) at ((s highest) + (1)) of [tri sort v] \n    add (a distance) to [triangle d v]\nend\n\nset [s i v] to [0]\nrepeat (length of [triangle x1 v])\n    change [s i v] by (1)\n    distance ((((item (s i) of [triangle x1 v]) + (item (s i) of [triangle x2 v])) + (item (s i) of [triangle x3 v])) / (3)) ((((item (s i) of [triangle y1 v]) + (item (s i) of [triangle y2 v])) + (item (s i) of [triangle y3 v])) / (3)) ((((item (s i) of [triangle z1 v]) + (item (s i) of [triangle z2 v])) + (item (s i) of [triangle z3 v])) / (3)) to (camX) (camY) (camZ)\n    replace item (s i) of [triangle d v] with (a distance)\nend\nset [s last v] to (length of [triangle x1 v])\nrepeat ((length of [triangle x1 v]) - (1))\n    set [s i v] to [0]\n    set [s highest v] to [1]\n    repeat (s last)\n        change [s i v] by (1)\n        if <(item (s highest) of [triangle d v]) > (item (s i) of [triangle d v])> then\n            set [s highest v] to (s i)\n        end\n    end\n    set [s other item v] to (item (s last) of [triangle x1 v])\n    replace item (s last) of [triangle x1 v] with (item (s highest) of [triangle x1 v])\n    replace item (s highest) of [triangle x1 v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle x2 v])\n    replace item (s last) of [triangle x2 v] with (item (s highest) of [triangle x2 v])\n    replace item (s highest) of [triangle x2 v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle x3 v])\n    replace item (s last) of [triangle x3 v] with (item (s highest) of [triangle x3 v])\n    replace item (s highest) of [triangle x3 v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle y1 v])\n    replace item (s last) of [triangle y1 v] with (item (s highest) of [triangle y1 v])\n    replace item (s highest) of [triangle y1 v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle y2 v])\n    replace item (s last) of [triangle y2 v] with (item (s highest) of [triangle y2 v])\n    replace item (s highest) of [triangle y2 v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle y3 v])\n    replace item (s last) of [triangle y3 v] with (item (s highest) of [triangle y3 v])\n    replace item (s highest) of [triangle y3 v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle z1 v])\n    replace item (s last) of [triangle z1 v] with (item (s highest) of [triangle z1 v])\n    replace item (s highest) of [triangle z1 v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle z2 v])\n    replace item (s last) of [triangle z2 v] with (item (s highest) of [triangle z2 v])\n    replace item (s highest) of [triangle z2 v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle z3 v])\n    replace item (s last) of [triangle z3 v] with (item (s highest) of [triangle z3 v])\n    replace item (s highest) of [triangle z3 v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle d v])\n    replace item (s last) of [triangle d v] with (item (s highest) of [triangle d v])\n    replace item (s highest) of [triangle d v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle t v])\n    replace item (s last) of [triangle t v] with (item (s highest) of [triangle t v])\n    replace item (s highest) of [triangle t v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle c v])\n    replace item (s last) of [triangle c v] with (item (s highest) of [triangle c v])\n    replace item (s highest) of [triangle c v] with (s other item)\n    set [s other item v] to (item (s last) of [triangle dir v])\n    replace item (s last) of [triangle dir v] with (item (s highest) of [triangle dir v])\n    replace item (s highest) of [triangle dir v] with (s other item)\n    change [s last v] by (-1)\nend\n\ndefine distance (x1) (y1) (z1) to (x2) (y2) (z2)\nset [a distance v] to ([sqrt v] of ((((x1) - (x2)) * ((x1) - (x2))) + ((((y1) - (y2)) * ((y1) - (y2))) + (((z1) - (z2)) * ((z1) - (z2))))) )\n\ndefine change x by (x)\nchange [b player x v] by (x)\nset [c i v] to [0]\nrepeat (length of [block x1 v])\n    change [c i v] by (1)\n    check collision\n    if <not <(c t) = [0]>> then\n        if <<<<(c t) = [4]> or <(c t) = [6]>> or <(c t) = [18]>> or <(c t) = [29]>> then\n            set [b animation v] to [2]\n            stop [this script v]\n        else\n            if <(c t) = [10]> then\n            else\n                change [b player x v] by (() - (x))\n                stop [this script v]\n            end\n        end\n    end\nend\n\ndefine change z by (z)\nchange [b player z v] by (z)\nset [c i v] to [0]\nrepeat (length of [block x1 v])\n    change [c i v] by (1)\n    check collision\n    if <not <(c t) = [0]>> then\n        if <(c t) = [10]> then\n            set [b animation frame v] to [0]\n            set [b animation v] to [3]\n            set [a change level v] to [1]\n        else\n            if <<<<(c t) = [4]> or <(c t) = [6]>> or <(c t) = [18]>> or <(c t) = [29]>> then\n                set [b animation v] to [2]\n                stop [this script v]\n            else\n                change [b player z v] by (() - (z))\n                stop [this script v]\n            end\n        end\n    end\nend\n\ndefine check if behind wall\nset [n x v] to (camX)\nset [n y v] to (camY)\nset [n z v] to (camZ)\nset [n in wall? v] to [0]\nset [n i 2 v] to [0]\nrepeat (200)\n    change [n i 2 v] by (1)\n    change [n x v] by ((cosX) * (sinY))\n    change [n y v] by (sinX)\n    change [n z v] by ((cosX) * (cosY))\n    set [n i v] to [0]\n    repeat (length of [block x1 v])\n        change [n i v] by (1)\n        if <<(n x) > (item (n i) of [block x1 v])> and <(item (n i) of [block x2 v]) > (n x)>> then\n            if <<(n z) > (item (n i) of [block z1 v])> and <(item (n i) of [block z2 v]) > (n z)>> then\n                if <<(n y) > (item (n i) of [block y1 v])> and <(item (n i) of [block y2 v]) > (n y)>> then\n                    set [n in wall? v] to [1]\n                    set [n render wall? v] to [0]\n                    if <(n i 2) < [5]> then\n                        set [n render wall? v] to (item (n i) of [blocks t v])\n                    end\n                    stop [this script v]\n                end\n            end\n        end\n    end\nend\n\ndefine -- (number or text)\n\nset [c t v] to (item (c i) of [blocks t v])\n\nset [c t v] to (item (c i) of [blocks t v])\n\nset [c t v] to (item (c i) of [blocks t v])\n\nset [c t v] to (item (c i) of [blocks t v])\n\nchange [b player x v] by (() - (x))\nstop [this script v]\n\nchange [b player x v] by (() - (x))\nstop [this script v]\n\nchange [b player x v] by (() - (x))\nstop [this script v]\n\nchange [b player x v] by (() - (x))\nstop [this script v]\n\nchange [b player z v] by (() - (z))\nstop [this script v]\n\nchange [b player z v] by (() - (z))\nstop [this script v]\n\nchange [b player z v] by (() - (z))\nstop [this script v]\n\nchange [b player z v] by (() - (z))\nstop [this script v]\n\nchange [b player z v] by (() - (z))\nstop [this script v]\n\ndefine check collision\nset [c t v] to [0]\nif <<((b player x) + (9)) > (item (c i) of [block x1 v])> and <(item (c i) of [block x2 v]) > ((b player x) + (9))>> then\n    if <<((b player z) + (9)) > (item (c i) of [block z1 v])> and <(item (c i) of [block z2 v]) > ((b player z) + (9))>> then\n        if <<((b player y) + (9)) > (item (c i) of [block y1 v])> and <(item (c i) of [block y2 v]) > ((b player y) + (9))>> then\n            set [c t v] to (item (c i) of [blocks t v])\n            stop [this script v]\n        end\n    end\nend\nif <<((b player x) + (-9)) > (item (c i) of [block x1 v])> and <(item (c i) of [block x2 v]) > ((b player x) + (-9))>> then\n    if <<((b player z) + (9)) > (item (c i) of [block z1 v])> and <(item (c i) of [block z2 v]) > ((b player z) + (9))>> then\n        if <<((b player y) + (9)) > (item (c i) of [block y1 v])> and <(item (c i) of [block y2 v]) > ((b player y) + (9))>> then\n            set [c t v] to (item (c i) of [blocks t v])\n            stop [this script v]\n        end\n    end\nend\nif <<((b player x) + (9)) > (item (c i) of [block x1 v])> and <(item (c i) of [block x2 v]) > ((b player x) + (9))>> then\n    if <<((b player z) + (-9)) > (item (c i) of [block z1 v])> and <(item (c i) of [block z2 v]) > ((b player z) + (-9))>> then\n        if <<((b player y) + (9)) > (item (c i) of [block y1 v])> and <(item (c i) of [block y2 v]) > ((b player y) + (9))>> then\n            set [c t v] to (item (c i) of [blocks t v])\n            stop [this script v]\n        end\n    end\nend\nif <<((b player x) + (-9)) > (item (c i) of [block x1 v])> and <(item (c i) of [block x2 v]) > ((b player x) + (-9))>> then\n    if <<((b player z) + (-9)) > (item (c i) of [block z1 v])> and <(item (c i) of [block z2 v]) > ((b player z) + (-9))>> then\n        if <<((b player y) + (9)) > (item (c i) of [block y1 v])> and <(item (c i) of [block y2 v]) > ((b player y) + (9))>> then\n            set [c t v] to (item (c i) of [blocks t v])\n            stop [this script v]\n        end\n    end\nend\nif <<((b player x) + (9)) > (item (c i) of [block x1 v])> and <(item (c i) of [block x2 v]) > ((b player x) + (9))>> then\n    if <<((b player z) + (9)) > (item (c i) of [block z1 v])> and <(item (c i) of [block z2 v]) > ((b player z) + (9))>> then\n        if <<((b player y) + (-9)) > (item (c i) of [block y1 v])> and <(item (c i) of [block y2 v]) > ((b player y) + (-9))>> then\n            set [c t v] to (item (c i) of [blocks t v])\n            stop [this script v]\n        end\n    end\nend\nif <<((b player x) + (-9)) > (item (c i) of [block x1 v])> and <(item (c i) of [block x2 v]) > ((b player x) + (-9))>> then\n    if <<((b player z) + (9)) > (item (c i) of [block z1 v])> and <(item (c i) of [block z2 v]) > ((b player z) + (9))>> then\n        if <<((b player y) + (-9)) > (item (c i) of [block y1 v])> and <(item (c i) of [block y2 v]) > ((b player y) + (-9))>> then\n            set [c t v] to (item (c i) of [blocks t v])\n            stop [this script v]\n        end\n    end\nend\nif <<((b player x) + (9)) > (item (c i) of [block x1 v])> and <(item (c i) of [block x2 v]) > ((b player x) + (9))>> then\n    if <<((b player z) + (-9)) > (item (c i) of [block z1 v])> and <(item (c i) of [block z2 v]) > ((b player z) + (-9))>> then\n        if <<((b player y) + (-9)) > (item (c i) of [block y1 v])> and <(item (c i) of [block y2 v]) > ((b player y) + (-9))>> then\n            set [c t v] to (item (c i) of [blocks t v])\n            stop [this script v]\n        end\n    end\nend\nif <<((b player x) + (-9)) > (item (c i) of [block x1 v])> and <(item (c i) of [block x2 v]) > ((b player x) + (-9))>> then\n    if <<((b player z) + (-9)) > (item (c i) of [block z1 v])> and <(item (c i) of [block z2 v]) > ((b player z) + (-9))>> then\n        if <<((b player y) + (-9)) > (item (c i) of [block y1 v])> and <(item (c i) of [block y2 v]) > ((b player y) + (-9))>> then\n            set [c t v] to (item (c i) of [blocks t v])\n            stop [this script v]\n        end\n    end\nend\n\ndefine reset\nset [a change level v] to [0]\nset [b player x v] to (b checkpoint x)\nset [b player y v] to (b checkpoint y)\nset [b double jump? v] to [2]\nset [b space pressed? v] to [0]\nset [b player yvel v] to [0]\nset [b falling? v] to [333]\nset [f on ground sound? v] to [1]\nset [b player z v] to (b checkpoint z)\nset [camrotx v] to [-35]\nset [camroty v] to [0]\nset [b animation v] to [0]\nset [r player transparency v] to [0]\n\ndefine calculate shadow (corner)\nset [d i v] to (item # of [2000] in [triangle t v])\ndelete (d i) of [triangle x1 v]\ndelete (d i) of [triangle x2 v]\ndelete (d i) of [triangle x3 v]\ndelete (d i) of [triangle y1 v]\ndelete (d i) of [triangle y2 v]\ndelete (d i) of [triangle y3 v]\ndelete (d i) of [triangle z1 v]\ndelete (d i) of [triangle z2 v]\ndelete (d i) of [triangle z3 v]\ndelete (d i) of [triangle t v]\ndelete (d i) of [triangle c v]\ndelete (d i) of [triangle d v]\ndelete (d i) of [triangle dir v]\nset [d i v] to (item # of [2000] in [triangle t v])\ndelete (d i) of [triangle x1 v]\ndelete (d i) of [triangle x2 v]\ndelete (d i) of [triangle x3 v]\ndelete (d i) of [triangle y1 v]\ndelete (d i) of [triangle y2 v]\ndelete (d i) of [triangle y3 v]\ndelete (d i) of [triangle z1 v]\ndelete (d i) of [triangle z2 v]\ndelete (d i) of [triangle z3 v]\ndelete (d i) of [triangle t v]\ndelete (d i) of [triangle c v]\ndelete (d i) of [triangle d v]\ndelete (d i) of [triangle dir v]\nset [d highest y v] to [-1000]\nset [d y v] to (b player y)\nset [d i v] to [0]\nrepeat (length of [block x1 v])\n    change [d i v] by (1)\n    if <<((b player x) + (-9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (-9))>> then\n        if <<((b player z) + (9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (9))>> then\n            if <(d y) > (item (d i) of [block y2 v])> then\n                if <(item (d i) of [block y2 v]) > (d highest y)> then\n                    set [d highest y v] to (item (d i) of [block y2 v])\n                end\n            end\n        end\n    end\nend\nset [d i v] to [0]\nrepeat (length of [block x1 v])\n    change [d i v] by (1)\n    if <<((b player x) + (9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (9))>> then\n        if <<((b player z) + (9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (9))>> then\n            if <(d y) > (item (d i) of [block y2 v])> then\n                if <(item (d i) of [block y2 v]) > (d highest y)> then\n                    set [d highest y v] to (item (d i) of [block y2 v])\n                end\n            end\n        end\n    end\nend\nset [d i v] to [0]\nrepeat (length of [block x1 v])\n    change [d i v] by (1)\n    if <<((b player x) + (-9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (-9))>> then\n        if <<((b player z) + (-9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (-9))>> then\n            if <(d y) > (item (d i) of [block y2 v])> then\n                if <(item (d i) of [block y2 v]) > (d highest y)> then\n                    set [d highest y v] to (item (d i) of [block y2 v])\n                end\n            end\n        end\n    end\nend\nset [d i v] to [0]\nrepeat (length of [block x1 v])\n    change [d i v] by (1)\n    if <<((b player x) + (9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (9))>> then\n        if <<((b player z) + (-9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (-9))>> then\n            if <(d y) > (item (d i) of [block y2 v])> then\n                if <(item (d i) of [block y2 v]) > (d highest y)> then\n                    set [d highest y v] to (item (d i) of [block y2 v])\n                end\n            end\n        end\n    end\nend\nset [d y v] to ((d highest y) - (1))\nif <not <(d highest y) = [-1000]>> then\n    add triangle ((b player x) + (9)) (d y) ((b player z) + (9)) to ((b player x) + (9)) (d y) ((b player z) + (-9)) to ((b player x) + (-9)) (d y) ((b player z) + (9)) [2000] [20] [1]\n    add triangle ((b player x) + (-9)) (d y) ((b player z) + (-9)) to ((b player x) + (-9)) (d y) ((b player z) + (9)) to ((b player x) + (9)) (d y) ((b player z) + (-9)) [2000] [20] [1]\nend\n\nwhen I receive [reset v]\nif <(a change level) = [1]> then\n    change [a level v] by (1)\n    if <(a level) = [6]> then\n        switch backdrop to (6 v)\n    end\n    level (a level)\nend\nreset\n\ndefine set render things I guess\nif <(item (y i) of [triangle t v]) = [1]> then\n    set pen color to (#0fed00)\nelse\n    if <(item (y i) of [triangle t v]) = [2]> then\n        set pen color to (#de4200)\n    else\n        if <(item (y i) of [triangle t v]) = [3]> then\n            set pen color to (#ff651a)\n        else\n            if <(item (y i) of [triangle t v]) = [4]> then\n                set pen color to (#ff9a7f)\n            else\n                if <(item (y i) of [triangle t v]) = [5]> then\n                    set pen color to (#dceeff)\n                else\n                    if <(item (y i) of [triangle t v]) = [6]> then\n                        set pen color to (#ff0000)\n                    else\n                        if <(item (y i) of [triangle t v]) = [7]> then\n                            set pen color to (#f9ff14)\n                        else\n                            if <(item (y i) of [triangle t v]) = [8]> then\n                                set pen color to (#ff591a)\n                                distance (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) to (b checkpoint x) (b checkpoint y) (b checkpoint z)\n                                if <(a distance) < [100]> then\n                                    replace item (y i) of [triangle t v] with [9]\n                                end\n                            else\n                                if <(item (y i) of [triangle t v]) = [9]> then\n                                    set pen color to (#00ff01)\n                                    distance (item (y i) of [triangle x1 v]) (item (y i) of [triangle y1 v]) (item (y i) of [triangle z1 v]) to (b checkpoint x) (b checkpoint y) (b checkpoint z)\n                                    if <[99] < (a distance)> then\n                                        replace item (y i) of [triangle t v] with [8]\n                                    end\n                                else\n                                    if <(item (y i) of [triangle t v]) = [10]> then\n                                        set pen color to (#ffffff)\n                                    else\n                                        if <(item (y i) of [triangle t v]) = [11]> then\n                                            set pen color to (#fff604)\n                                        else\n                                            if <(item (y i) of [triangle t v]) = [12]> then\n                                                set pen color to (#63ff2f)\n                                            else\n                                                if <(item (y i) of [triangle t v]) = [13]> then\n                                                    set pen color to (#000000)\n                                                else\n                                                    if <(item (y i) of [triangle t v]) = [14]> then\n                                                        set pen color to (#ffffff)\n                                                    else\n                                                        if <(item (y i) of [triangle t v]) = [15]> then\n                                                            set pen color to (#16ff54)\n                                                        else\n                                                            if <(item (y i) of [triangle t v]) = [16]> then\n                                                                set pen color to (#ffd000)\n                                                            else\n                                                                if <(item (y i) of [triangle t v]) = [17]> then\n                                                                    set pen color to (#ffe500)\n                                                                else\n                                                                    if <(item (y i) of [triangle t v]) = [18]> then\n                                                                        set pen color to (#66ff7a)\n                                                                    else\n                                                                        if <(item (y i) of [triangle t v]) = [19]> then\n                                                                            set pen color to (#ffe500)\n                                                                        else\n                                                                            if <(item (y i) of [triangle t v]) = [20]> then\n                                                                                set pen color to (#88d9ff)\n                                                                            else\n                                                                                if <(item (y i) of [triangle t v]) = [21]> then\n                                                                                    set pen color to (#b8edff)\n                                                                                else\n                                                                                    if <(item (y i) of [triangle t v]) = [22]> then\n                                                                                        set pen color to (#0021ff)\n                                                                                    else\n                                                                                        if <(item (y i) of [triangle t v]) = [23]> then\n                                                                                            set pen color to (#00a9ff)\n                                                                                        else\n                                                                                            if <(item (y i) of [triangle t v]) = [24]> then\n                                                                                                set pen color to (#ffb38f)\n                                                                                            else\n                                                                                                if <(item (y i) of [triangle t v]) = [25]> then\n                                                                                                    set pen color to (#ff3200)\n                                                                                                else\n                                                                                                    if <(item (y i) of [triangle t v]) = [26]> then\n                                                                                                        set pen color to (#cbcbcb)\n                                                                                                    else\n                                                                                                        if <(item (y i) of [triangle t v]) = [27]> then\n                                                                                                            set pen color to (#8e8e8e)\n                                                                                                        else\n                                                                                                            if <(item (y i) of [triangle t v]) = [28]> then\n                                                                                                                set pen color to (#8e8e8e)\n                                                                                                            else\n                                                                                                                if <(item (y i) of [triangle t v]) = [29]> then\n                                                                                                                    set pen color to (#ff4c00)\n                                                                                                                else\n                                                                                                                    if <(item (y i) of [triangle t v]) = [30]> then\n                                                                                                                        set pen color to (#ffffff)\n                                                                                                                    else\n                                                                                                                        if <(item (y i) of [triangle t v]) = [31]> then\n                                                                                                                            set pen color to (#de4200)\n                                                                                                                        else\n                                                                                                                            if <(item (y i) of [triangle t v]) = [32]> then\n                                                                                                                                set pen color to (#de4200)\n                                                                                                                            else\n                                                                                                                                if <(item (y i) of [triangle t v]) = [33]> then\n                                                                                                                                    set pen color to (#ffffff)\n                                                                                                                                else\n                                                                                                                                    if <(item (y i) of [triangle t v]) = [34]> then\n                                                                                                                                        set pen color to (#ff5a96)\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\n                    end\n                end\n            end\n        end\n    end\nend\nif <(item (y i) of [triangle t v]) = [26]> then\n    set pen (brightness v) to ((80) - ((100) - (item (y i) of [triangle c v])))\nelse\n    if <(item (y i) of [triangle t v]) = [27]> then\n        set pen (brightness v) to ((65) - ((100) - (item (y i) of [triangle c v])))\n    else\n        if <(item (y i) of [triangle t v]) = [28]> then\n            set pen (brightness v) to ((65) - ((100) - (item (y i) of [triangle c v])))\n        else\n            set pen (brightness v) to (item (y i) of [triangle c v])\n        end\n    end\nend\n\nwhen I receive [start game v]\nswitch costume to (costume1 v)\nset size to (10000) %\nswitch costume to (costume2 v)\nhide\nset [r circle size v] to [1000]\nset [a level v] to [1]\nset [a start timer? v] to [0]\ndelete all of [textbox v]\nrepeat (10)\n    add [0] to [textbox v]\nend\nset [a timer \(frames\) v] to [0]\nbroadcast (setup v) and wait\nlevel (a level)\nreset\ncalculate trig values\nforever\n    if <(?pause menu opened?) = [0]> then\n        if <(a start timer?) = [1]> then\n            change [a timer \(frames\) v] by (1)\n        end\n        tick\n    end\n    if <(t textbox) = [0]> then\n        broadcast (tick v) and wait\n    end\n    if <not <(t textbox) = [13]>> then\n        erase all\n        if <not <(a level) = [6]>> then\n            render\n        else\n            switch backdrop to (6 v)\n        end\n    end\n    if <not <(t textbox) = [0]>> then\n        broadcast (update textbox v) and wait\n    end\n    broadcast (pause menu v) and wait\n    change [z frame v] by (1)\n    if <(timer) > [1]> then\n        set [z fps v] to (z frame)\n        set [z frame v] to [0]\n        reset timer\n    end\nend\n\ndefine mobile controls\nset [j move camera? v] to [0]\ndistance (mouse x) (mouse y) [0] to [-140] [-80] [0]\nset [j joystick x v] to [-140]\nset [j joystick y v] to [-80]\nif <(a distance) < [100]> then\n    if <mouse down?> then\n        set [j move camera? v] to [1]\n        go to x: (mouse x) y: (mouse y)\n        set [j joystick x v] to (mouse x)\n        set [j joystick y v] to (mouse y)\n        go to (mouse-pointer v)\n        point towards x: (-140) y: (-80)\n        change [b player xvel v] by (([cos v] of (((direction) + (camRotY)) + (90)) ) * (5))\n        change [b player zvel v] by (([sin v] of (((direction) + (camRotY)) + (90)) ) * (-5))\n        set [a start timer? v] to [1]\n    end\nend\ndistance (mouse x) (mouse y) [0] to [140] [-80] [0]\nif <(a distance) < [37]> then\n    if <mouse down?> then\n        set [a start timer? v] to [1]\n        set [j move camera? v] to [1]\n        if <(b space pressed?) = [0]> then\n            if <<(b falling?) < [5]> and <(b double jump?) = [ 0]>> then\n                set [b space pressed? v] to [1]\n                set [b double jump? v] to [1]\n                set [b player yvel v] to [14]\n                set [b falling? v] to [55]\n                start sound [jump v]\n            else\n                if <<(b double jump?) = [ 0]> or <(b double jump?) = [1]>> then\n                    if <(b player yvel) < [7]> then\n                        set [b space pressed? v] to [1]\n                        set [b double jump? v] to [2]\n                        set [b player yvel v] to [14]\n                        start sound [jump v]\n                    end\n                end\n            end\n        end\n    end\nend\nchange x by (b player xvel)\nchange z by (b player zvel)\nif <(a level) = [4]> then\n    if <(b falling?) < [5]> then\n        set [b player xvel v] to ((b player xvel) * (0.6))\n        set [b player zvel v] to ((b player zvel) * (0.6))\n    else\n        set [b player xvel v] to ((b player xvel) * (0.4))\n        set [b player zvel v] to ((b player zvel) * (0.4))\n    end\nelse\n    set [b player xvel v] to [0]\n    set [b player zvel v] to [0]\nend\nif <not <mouse down?>> then\n    set [b space pressed? v] to [0]\nend\nif <<mouse down?> and <(j move camera?) = [0]>> then\n    change [camroty v] by (((j old x) - (mouse x)) / (-2))\n    change [camrotx v] by (((j old y) - (mouse y)) / (-2))\nend\nset [j old x v] to (mouse x)\nset [j old y v] to (mouse y)\nchange [b player yvel v] by (-1)\nchange [b falling? v] by (1)\nchange y by (b player yvel)\nif <(f hit something y) = [1]> then\n    if <(f on ground sound?) = [0]> then\n        start sound [ground v]\n        set [f on ground sound? v] to [1]\n    end\nelse\n    set [f on ground sound? v] to [0]\nend\nif <(camRotX) > [0]> then\n    set [camrotx v] to [0]\nend\nif <[-90] > (camRotX)> then\n    set [camrotx v] to [-90]\nend\nif <[-500] > (b player y)> then\n    set [b animation frame v] to [0]\n    set [b animation v] to [1]\nend\nset [a tri count v] to (length of [triangle x1 v])\n\nstop [this script v]\n\nstop [this script v]\n\nwhen I receive [credits v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\n\nwhen I receive [setup v]\n\nstart sound [fall v]\nstart sound [ground v]\nstart sound [win v]\nstart sound [lava v]\nstart sound [jump v]\nstart sound [ground2 v]\nstop all sounds\n\nset volume to (0) %\nplay sound [jump v] until done\nplay sound [fall v] until done\nplay sound [win v] until done\nplay sound [lava v] until done\nplay sound [ground v] until done\nset volume to (100) %\n\nset [d highest y v] to (d y)\n\nif <(corner) = [1]> then\n    set [d i v] to (item # of [2000] in [triangle t v])\n    delete (d i) of [triangle x1 v]\n    delete (d i) of [triangle x2 v]\n    delete (d i) of [triangle x3 v]\n    delete (d i) of [triangle y1 v]\n    delete (d i) of [triangle y2 v]\n    delete (d i) of [triangle y3 v]\n    delete (d i) of [triangle z1 v]\n    delete (d i) of [triangle z2 v]\n    delete (d i) of [triangle z3 v]\n    delete (d i) of [triangle t v]\n    delete (d i) of [triangle c v]\n    delete (d i) of [triangle d v]\n    delete (d i) of [triangle dir v]\n    set [d i v] to (item # of [2000] in [triangle t v])\n    delete (d i) of [triangle x1 v]\n    delete (d i) of [triangle x2 v]\n    delete (d i) of [triangle x3 v]\n    delete (d i) of [triangle y1 v]\n    delete (d i) of [triangle y2 v]\n    delete (d i) of [triangle y3 v]\n    delete (d i) of [triangle z1 v]\n    delete (d i) of [triangle z2 v]\n    delete (d i) of [triangle z3 v]\n    delete (d i) of [triangle t v]\n    delete (d i) of [triangle c v]\n    delete (d i) of [triangle d v]\n    delete (d i) of [triangle dir v]\n    set [d highest y v] to [-1000]\n    set [d y v] to (b player y)\n    set [d hit? v] to [0]\n    repeat (1500)\n        change [d y v] by (-1)\n        set [d i v] to [0]\n        repeat (length of [block x1 v])\n            change [d i v] by (1)\n            if <<((b player x) + (-9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (-9))>> then\n                if <<((b player z) + (9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (9))>> then\n                    if <<(d y) > (item (d i) of [block y1 v])> and <(item (d i) of [block y2 v]) > (d y)>> then\n                        set [d highest y v] to (d y)\n                        set [d hit? v] to [1]\n                        stop [this script v]\n                    end\n                end\n            end\n        end\n    end\nelse\n    if <(corner) = [2]> then\n        set [d y v] to (b player y)\n        set [d hit? v] to [0]\n        repeat ((((d y) - (d highest y)) * <not <(d highest y) = [-1000]>>) + ((1500) * <(d highest y) = [-1000]>))\n            change [d y v] by (-1)\n            set [d i v] to [0]\n            repeat (length of [block x1 v])\n                change [d i v] by (1)\n                if <<((b player x) + (9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (9))>> then\n                    if <<((b player z) + (9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (9))>> then\n                        if <<(d y) > (item (d i) of [block y1 v])> and <(item (d i) of [block y2 v]) > (d y)>> then\n                            if <(d y) > (d highest y)> then\n                                set [d highest y v] to (d y)\n                                set [d hit? v] to [1]\n                                stop [this script v]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    else\n        if <(corner) = [3]> then\n            set [d y v] to (b player y)\n            set [d hit? v] to [0]\n            repeat ((((d y) - (d highest y)) * <not <(d highest y) = [-1000]>>) + ((1500) * <(d highest y) = [-1000]>))\n                change [d y v] by (-1)\n                set [d i v] to [0]\n                repeat (length of [block x1 v])\n                    change [d i v] by (1)\n                    if <<((b player x) + (-9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (-9))>> then\n                        if <<((b player z) + (-9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (-9))>> then\n                            if <<(d y) > (item (d i) of [block y1 v])> and <(item (d i) of [block y2 v]) > (d y)>> then\n                                if <(d y) > (d highest y)> then\n                                    set [d highest y v] to (d y)\n                                    set [d hit? v] to [1]\n                                    stop [this script v]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            set [d y v] to (b player y)\n            set [d hit? v] to [0]\n            repeat ((((d y) - (d highest y)) * <not <(d highest y) = [-1000]>>) + ((1500) * <(d highest y) = [-1000]>))\n                change [d y v] by (-1)\n                set [d i v] to [0]\n                repeat (length of [block x1 v])\n                    change [d i v] by (1)\n                    if <<((b player x) + (9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (9))>> then\n                        if <<((b player z) + (-9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (-9))>> then\n                            if <<(d y) > (item (d i) of [block y1 v])> and <(item (d i) of [block y2 v]) > (d y)>> then\n                                if <(d y) > (d highest y)> then\n                                    set [d highest y v] to (d y)\n                                    set [d hit? v] to [1]\n                                    stop [this script v]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n            set [d y v] to (d highest y)\n            if <not <(d y) = [-1000]>> then\n                add triangle ((b player x) + (9)) (d y) ((b player z) + (9)) to ((b player x) + (9)) (d y) ((b player z) + (-9)) to ((b player x) + (-9)) (d y) ((b player z) + (9)) [2000] [20] [1]\n                add triangle ((b player x) + (-9)) (d y) ((b player z) + (-9)) to ((b player x) + (-9)) (d y) ((b player z) + (9)) to ((b player x) + (9)) (d y) ((b player z) + (-9)) [2000] [20] [1]\n            end\n        end\n    end\nend\n\nset [d i v] to (item # of [2000] in [triangle t v])\ndelete (d i) of [triangle x1 v]\ndelete (d i) of [triangle x2 v]\ndelete (d i) of [triangle x3 v]\ndelete (d i) of [triangle y1 v]\ndelete (d i) of [triangle y2 v]\ndelete (d i) of [triangle y3 v]\ndelete (d i) of [triangle z1 v]\ndelete (d i) of [triangle z2 v]\ndelete (d i) of [triangle z3 v]\ndelete (d i) of [triangle t v]\ndelete (d i) of [triangle c v]\ndelete (d i) of [triangle d v]\ndelete (d i) of [triangle dir v]\nset [d i v] to (item # of [2000] in [triangle t v])\ndelete (d i) of [triangle x1 v]\ndelete (d i) of [triangle x2 v]\ndelete (d i) of [triangle x3 v]\ndelete (d i) of [triangle y1 v]\ndelete (d i) of [triangle y2 v]\ndelete (d i) of [triangle y3 v]\ndelete (d i) of [triangle z1 v]\ndelete (d i) of [triangle z2 v]\ndelete (d i) of [triangle z3 v]\ndelete (d i) of [triangle t v]\ndelete (d i) of [triangle c v]\ndelete (d i) of [triangle d v]\ndelete (d i) of [triangle dir v]\nset [d hit 1 v] to [1]\nset [d hit 2 v] to [1]\nset [d hit 3 v] to [1]\nset [d hit 4 v] to [1]\nset [d hit? v] to [0]\nset [d y v] to (b player y)\nrepeat until <<<(d hit?) = [1]> or <<<(d hit 1) = [0]> and <(d hit 2) = [0]>> and <<(d hit 3) = [0]> and <(d hit 4) = [0]>>>> or <[-499] > (d y)>>\n    change [d y v] by (-1)\n    if <(d hit 1) = [1]> then\n        set [d hit 1 v] to [0]\n        set [d i v] to [0]\n        repeat (length of [block x1 v])\n            change [d i v] by (1)\n            if <<((b player x) + (-9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (-9))>> then\n                if <<((b player z) + (9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (9))>> then\n                    if <(d y) > (item (d i) of [block y1 v])> then\n                        set [d hit 1 v] to [1]\n                        if <(item (d i) of [block y2 v]) > (d y)> then\n                            set [d hit? v] to [1]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <(d hit 2) = [1]> then\n        set [d hit 2 v] to [0]\n        set [d i v] to [0]\n        repeat (length of [block x1 v])\n            change [d i v] by (1)\n            if <<((b player x) + (9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (9))>> then\n                if <<((b player z) + (9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (9))>> then\n                    if <(d y) > (item (d i) of [block y1 v])> then\n                        set [d hit 2 v] to [1]\n                        if <(item (d i) of [block y2 v]) > (d y)> then\n                            set [d hit? v] to [1]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <(d hit 3) = [1]> then\n        set [d hit 3 v] to [0]\n        set [d i v] to [0]\n        repeat (length of [block x1 v])\n            change [d i v] by (1)\n            if <<((b player x) + (-9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (-9))>> then\n                if <<((b player z) + (-9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (-9))>> then\n                    if <(d y) > (item (d i) of [block y1 v])> then\n                        set [d hit 3 v] to [1]\n                        if <(item (d i) of [block y2 v]) > (d y)> then\n                            set [d hit? v] to [1]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <(d hit 4) = [1]> then\n        set [d hit 4 v] to [0]\n        set [d i v] to [0]\n        repeat (length of [block x1 v])\n            change [d i v] by (1)\n            if <<((b player x) + (9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (9))>> then\n                if <<((b player z) + (-9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (-9))>> then\n                    if <(d y) > (item (d i) of [block y1 v])> then\n                        set [d hit 4 v] to [1]\n                        if <(item (d i) of [block y2 v]) > (d y)> then\n                            set [d hit? v] to [1]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <(d hit?) = [1]> then\n    add triangle ((b player x) + (9)) (d y) ((b player z) + (9)) to ((b player x) + (9)) (d y) ((b player z) + (-9)) to ((b player x) + (-9)) (d y) ((b player z) + (9)) [2000] [20] [1]\n    add triangle ((b player x) + (-9)) (d y) ((b player z) + (-9)) to ((b player x) + (-9)) (d y) ((b player z) + (9)) to ((b player x) + (9)) (d y) ((b player z) + (-9)) [2000] [20] [1]\nend\n\nset [d i v] to [0]\nrepeat (length of [block x1 v])\n    change [d i v] by (1)\n    if <<((b player x) + (-9)) > (item (d i) of [block x1 v])> and <(item (d i) of [block x2 v]) > ((b player x) + (-9))>> then\n        if <<((b player z) + (9)) > (item (d i) of [block z1 v])> and <(item (d i) of [block z2 v]) > ((b player z) + (9))>> then\n            if <<(d y) > (item (d i) of [block y1 v])> and <(item (d i) of [block y2 v]) > (d y)>> then\n                set [d highest y v] to (d y)\n                set [d hit? v] to [1]\n                stop [this script v]\n            end\n        end\n    end\nend\n\n@circle \n\nwhen I receive [tick v]\nif <(b animation) = [13]> then\n    go to (3d engine v)\n    change [r circle size v] by (-20)\n    if <(r circle size) > [100]> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume3 v)\n    end\n    set size to (r circle size) %\n    switch costume to (costume1 v)\n    show\n    if <(r circle size) = [20]> then\n        broadcast (reset v) and wait\n        set [b animation sound played? v] to [0]\n        set [b animation frame v] to [0]\n    end\nelse\n    if <not <(a level) = [6]>> then\n        go to x: (0) y: (0)\n        change [r circle size v] by (20)\n        if <(r circle size) > [100]> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume3 v)\n        end\n        set size to (r circle size) %\n        switch costume to (costume1 v)\n        show\n    end\nend\n\nset [r circle size v] to [500]\n\nwhen I receive [update textbox v]\ngo to x: (0) y: (0)\nchange [r circle size v] by (100)\nif <(r circle size) > [100]> then\n    switch costume to (costume2 v)\nelse\n    switch costume to (costume3 v)\nend\nset size to (r circle size) %\nswitch costume to (costume1 v)\nshow\n\n@textbox 2.0\n\nwhen I receive [update textbox v]\ngo to [front v] layer\nshow\nset volume to (?sound effects) %\nif <(e speedrun?) = [0]> then\n    set [b player xvel v] to [0]\n    set [b player yvel v] to [0]\n    set [b player zvel v] to [0]\n    if <(t textbox) = [5]> then\n        if <(e mobile controls?) = [0]> then\n            switch costume to (welcome v)\n        else\n            switch costume to (welcome mobile v)\n        end\n    else\n        if <(t textbox) = [6]> then\n            if <(e mobile controls?) = [0]> then\n                switch costume to (controls v)\n            else\n                switch costume to (controls mobile v)\n            end\n        else\n            if <(t textbox) = [7]> then\n                switch costume to (double jump v)\n            else\n                if <(t textbox) = [8]> then\n                    switch costume to (checkpoint v)\n                else\n                    if <(t textbox) = [9]> then\n                        switch costume to (finished tutorial v)\n                    else\n                        if <(t textbox) = [10]> then\n                            switch costume to (desert v)\n                        else\n                            if <(t textbox) = [11]> then\n                                switch costume to (ice v)\n                            else\n                                if <(t textbox) = [12]> then\n                                    switch costume to (last level v)\n                                else\n                                    if <(t textbox) = [13]> then\n                                        erase all\n                                        switch backdrop to (6 v)\n                                        switch costume to (you did it v)\n                                        broadcast (finished level at v) and wait\n                                        broadcast (first timer tick  v) and wait\n                                    else\n                                        if <(t textbox) = [14]> then\n                                            erase all\n                                            switch costume to (see you again v)\n                                            broadcast (finished level at v) and wait\n                                            broadcast (first timer tick  v) and wait\n                                        else\n                                            if <(t textbox) = [15]> then\n                                                erase all\n                                                switch costume to (credits v)\n                                                broadcast (finished level at v) and wait\n                                                broadcast (first timer tick  v) and wait\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    start sound [player move v]\n    repeat (15)\n        change [ghost v] effect by (-7.5)\n    end\n    wait until <not <mouse down?>>\n    wait until <mouse down?>\n    start sound [player move v]\n    repeat (15)\n        change [ghost v] effect by (7.5)\n    end\nend\nhide\nif <(t textbox) = [15]> then\n    broadcast (credits v) and wait\nelse\n    if <<(t textbox) = [13]> or <(t textbox) = [14]>> then\n        change [t textbox v] by (1)\n        broadcast (update buttons v) and wait\n    else\n        set [t textbox v] to [0]\n    end\nend\nif <(t textbox) = [13]> then\n    erase all\n    switch backdrop to (6 v)\nelse\n    if <(t textbox) = [14]> then\n        erase all\n    else\n        if <(t textbox) = [15]> then\n            erase all\n        end\n    end\nend\n\nwhen I receive [credits v]\nbroadcast (finished level at v) and wait\nbroadcast (first timer tick  v) and wait\n\nwhen I receive [credits v]\nswitch backdrop to (6 v)\n\nwhen I receive [intro textbox v]\ngo to x: (0) y: (100)\nset [ghost v] effect to (100)\nshow\nswitch backdrop to (6 v)\nset [t textbox v] to [0]\nbroadcast (update buttons v) and wait\nshow list [link v]\nerase all\nif <[1] = <[1] = [1]>> then\n    switch costume to (on scratch v)\n    set [t textbox v] to [1]\n    hide list [link v]\n    start sound [player move v]\n    repeat (15)\n        change [ghost v] effect by (-7.5)\n    end\n    broadcast (update buttons v) and wait\n    start sound [player move v]\n    repeat (15)\n        change [ghost v] effect by (7.5)\n    end\nend\nswitch costume to (mobile controls v)\nstart sound [player move v]\nrepeat (15)\n    change [ghost v] effect by (-7.5)\nend\nset [t textbox v] to [2]\nbroadcast (update buttons v) and wait\nstart sound [player move v]\nrepeat (15)\n    change [ghost v] effect by (7.5)\nend\nswitch costume to (speedrun v)\nstart sound [player move v]\nrepeat (15)\n    change [ghost v] effect by (-7.5)\nend\nset [t textbox v] to [3]\nbroadcast (update buttons v) and wait\nstart sound [player move v]\nrepeat (15)\n    change [ghost v] effect by (7.5)\nend\nif <[0] = (e speedrun?)> then\n    switch costume to (resolution v)\n    start sound [player move v]\n    repeat (15)\n        change [ghost v] effect by (-7.5)\n    end\n    set [t textbox v] to [4]\n    broadcast (update buttons v) and wait\n    wait until <not <mouse down?>>\n    wait until <mouse down?>\n    start sound [player move v]\n    repeat (15)\n        change [ghost v] effect by (7.5)\n    end\nend\nhide\nset [t textbox v] to [0]\nbroadcast (start game v)\n\n@button\n\nwhen I receive [update buttons v]\nif <(t textbox) = [1]> then\n    repeat until <not <(t textbox) = [1]>>\n        change [ghost v] effect by (-7.5)\n        switch costume to (ignore v)\n        go to x: (0) y: (-50)\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            wait until <not <mouse down?>>\n            if <touching (mouse-pointer v)?> then\n                set [t textbox v] to [0]\n                show list [link v]\n                start sound [Click v]\n            end\n        end\n    end\n    repeat (15)\n        change [ghost v] effect by (7.5)\n    end\nelse\n    if <(t textbox) = [2]> then\n        repeat until <not <(t textbox) = [2]>>\n            change [ghost v] effect by (-7.5)\n            switch costume to (yes v)\n            go to x: (-75) y: (-50)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                wait until <not <mouse down?>>\n                if <touching (mouse-pointer v)?> then\n                    set [e mobile controls? v] to [1]\n                    set [t textbox v] to [0]\n                    start sound [Click v]\n                end\n            end\n        end\n        repeat (15)\n            change [ghost v] effect by (7.5)\n        end\n    else\n        if <(t textbox) = [3]> then\n            repeat until <not <(t textbox) = [3]>>\n                change [ghost v] effect by (-7.5)\n                switch costume to (yes v)\n                go to x: (-75) y: (-50)\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    wait until <not <mouse down?>>\n                    if <touching (mouse-pointer v)?> then\n                        set [e speedrun? v] to [1]\n                        set [t textbox v] to [0]\n                        start sound [Click v]\n                    end\n                end\n            end\n            repeat (15)\n                change [ghost v] effect by (7.5)\n            end\n        else\n            set [ghost v] effect to (100)\n        end\n    end\nend\n\nwhen I receive [tick v]\nset [ghost v] effect to (100)\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@button 2\n\nwhen I receive [update buttons v]\nif <(t textbox) = [2]> then\n    repeat until <not <(t textbox) = [2]>>\n        change [ghost v] effect by (-7.5)\n        switch costume to (costume1 v)\n        go to x: (75) y: (-50)\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            wait until <not <mouse down?>>\n            if <touching (mouse-pointer v)?> then\n                set [e mobile controls? v] to [0]\n                set [t textbox v] to [0]\n                change [ghost v] effect by (-7.5)\n                start sound [Click v]\n            end\n        end\n    end\n    repeat (15)\n        change [ghost v] effect by (7.5)\n    end\nelse\n    if <(t textbox) = [3]> then\n        repeat until <not <(t textbox) = [3]>>\n            change [ghost v] effect by (-7.5)\n            switch costume to (costume1 v)\n            go to x: (75) y: (-50)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                wait until <not <mouse down?>>\n                if <touching (mouse-pointer v)?> then\n                    set [e speedrun? v] to [0]\n                    set [t textbox v] to [0]\n                    change [ghost v] effect by (-7.5)\n                    start sound [Click v]\n                end\n            end\n        end\n        repeat (15)\n            change [ghost v] effect by (7.5)\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I receive [tick v]\nset [ghost v] effect to (100)\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@mobile controls\n\nwhen flag clicked\nhide\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [0]\n\nwhen I receive [tick v]\nif <(?pause menu opened?) = [0]> then\n    if <(e mobile controls?) = [1]> then\n        show\n        if <(id) = [1]> then\n            switch costume to (costume1 v)\n            go to x: (-140) y: (-80)\n        else\n            if <(id) = [2]> then\n                switch costume to (costume3 v)\n                go to x: (140) y: (-80)\n            else\n                switch costume to (costume2 v)\n                change x by (((j joystick x) - (x position)) / (2))\n                change y by (((j joystick y) - (y position)) / (2))\n            end\n        end\n    else\n        hide\n    end\nelse\n    hide\nend\n\n@timer 2.0\n\nwhen I receive [setup v]\nif <(e speedrun?) = [1]> then\n    set [last level frame v] to [0]\n    setup\nelse\n    hide\nend\n\nwhen I receive [tick v]\ntick\n\ndefine setup\nshow\nset size to (100) %\nset [id v] to [0]\ngo to x: (105) y: (160)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (20)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (15)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (15)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (20)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (15)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (15)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (20)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\ngo to x: (122) y: (134)\nset size to (85) %\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (17)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (13)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (13)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (17)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (13)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (13)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nchange x by (17)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nbroadcast (first timer tick  v) and wait\n\ndefine tick\nif <(e speedrun?) = [1]> then\n    go to [front v] layer\n    if <(?pause menu opened?) = [0]> then\n        show\n        if <(id) < [9]> then\n            delete all of [time v]\n            set [time v] to (a timer \(frames\))\n            add ([floor v] of (((time) / (30)) / (60)) ) to [time v]\n            set [time v] to ((time) - ([floor v] of ((item (1) of [time v]) * (1800)) ))\n            add ([floor v] of ((time) / (30)) ) to [time v]\n            set [time v] to ((time) - ([floor v] of ((item (2) of [time v]) * (30)) ))\n            add (round ((time) * (3.333333))) to [time v]\n            if <(id) = [1]> then\n                if <(length of (item (1) of [time v])) = [2]> then\n                    switch costume to (letter (1) of (item (1) of [time v]))\n                else\n                    switch costume to (0 v)\n                end\n            else\n                if <(id) = [2]> then\n                    if <(length of (item (1) of [time v])) = [1]> then\n                        switch costume to (letter (1) of (item (1) of [time v]))\n                    else\n                        switch costume to (letter (2) of (item (1) of [time v]))\n                    end\n                else\n                    if <(id) = [3]> then\n                        switch costume to (: v)\n                    else\n                        if <(id) = [4]> then\n                            if <(length of (item (2) of [time v])) = [2]> then\n                                switch costume to (letter (1) of (item (2) of [time v]))\n                            else\n                                switch costume to (0 v)\n                            end\n                        else\n                            if <(id) = [5]> then\n                                if <(length of (item (2) of [time v])) = [1]> then\n                                    switch costume to (letter (1) of (item (2) of [time v]))\n                                else\n                                    switch costume to (letter (2) of (item (2) of [time v]))\n                                end\n                            else\n                                if <(id) = [6]> then\n                                    switch costume to (. v)\n                                else\n                                    if <(id) = [7]> then\n                                        if <(length of (item (3) of [time v])) = [2]> then\n                                            switch costume to (letter (1) of (item (3) of [time v]))\n                                        else\n                                            switch costume to (0 v)\n                                        end\n                                    else\n                                        if <(id) = [8]> then\n                                            if <(length of (item (3) of [time v])) = [1]> then\n                                                switch costume to (letter (1) of (item (3) of [time v]))\n                                            else\n                                                switch costume to (letter (2) of (item (3) of [time v]))\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            delete all of [time v]\n            set [time v] to (last level frame)\n            add ([floor v] of (((time) / (30)) / (60)) ) to [time v]\n            set [time v] to ((time) - ([floor v] of ((item (1) of [time v]) * (1800)) ))\n            add ([floor v] of ((time) / (30)) ) to [time v]\n            set [time v] to ((time) - ([floor v] of ((item (2) of [time v]) * (30)) ))\n            add (round ((time) * (3.333333))) to [time v]\n            if <(id) = [9]> then\n                if <(length of (item (1) of [time v])) = [2]> then\n                    switch costume to (letter (1) of (item (1) of [time v]))\n                else\n                    switch costume to (0 v)\n                end\n            else\n                if <(id) = [10]> then\n                    if <(length of (item (1) of [time v])) = [1]> then\n                        switch costume to (letter (1) of (item (1) of [time v]))\n                    else\n                        switch costume to (letter (2) of (item (1) of [time v]))\n                    end\n                else\n                    if <(id) = [11]> then\n                        switch costume to (: v)\n                    else\n                        if <(id) = [12]> then\n                            if <(length of (item (2) of [time v])) = [2]> then\n                                switch costume to (letter (1) of (item (2) of [time v]))\n                            else\n                                switch costume to (0 v)\n                            end\n                        else\n                            if <(id) = [13]> then\n                                if <(length of (item (2) of [time v])) = [1]> then\n                                    switch costume to (letter (1) of (item (2) of [time v]))\n                                else\n                                    switch costume to (letter (2) of (item (2) of [time v]))\n                                end\n                            else\n                                if <(id) = [14]> then\n                                    switch costume to (. v)\n                                else\n                                    if <(id) = [15]> then\n                                        if <(length of (item (3) of [time v])) = [2]> then\n                                            switch costume to (letter (1) of (item (3) of [time v]))\n                                        else\n                                            switch costume to (0 v)\n                                        end\n                                    else\n                                        if <(id) = [16]> then\n                                            if <(length of (item (3) of [time v])) = [1]> then\n                                                switch costume to (letter (1) of (item (3) of [time v]))\n                                            else\n                                                switch costume to (letter (2) of (item (3) of [time v]))\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [finished level at v]\nset [last level frame v] to (a timer \(frames\))\n\nwhen I receive [first timer tick  v]\ntick\n\n@pause\n\nwhen flag clicked\nhide\n\nwhen I receive [tick v]\nset volume to (?sound effects) %\nif <<<(mouse x) > [-225]> and <(mouse y) > [115]>> and <<[-175] > (mouse x)> and <[165] > (mouse y)>>> then\n    if <<mouse down?> and <(pause mouse down?) = [0]>> then\n        set [pause mouse down? v] to [1]\n    else\n        if <<not <mouse down?>> and <(pause mouse down?) = [1]>> then\n            if <(?pause menu opened?) = [1]> then\n                set [?pause menu opened? v] to [0]\n            else\n                set [?pause menu opened? v] to [1]\n            end\n            set [pause mouse down? v] to [0]\n            start sound [Click v]\n        end\n    end\nelse\n    if <not <mouse down?>> then\n        set [pause mouse down? v] to [0]\n    end\nend\n\nwhen I receive [setup v]\nset [?pause menu opened? v] to [0]\nset [pause mouse down? v] to [0]\nshow\ngo to [front v] layer\n\nwhen I receive [credits v]\nhide\n\nwhen I receive [update textbox v]\nif <(t textbox) = [13]> then\n    hide\nend\n\n@loading...\n\nwhen I receive [show loading v]\nshow\ngo to [front v] layer\nif <[1] = <[1] = [1]>> then\n    switch costume to (scratch v)\nelse\n    switch costume to (fork v)\nend\nbroadcast (first timer tick  v) and wait\n\nwhen I receive [hide loading v]\nhide\n\nwhen flag clicked\nbroadcast (hide loading v)\n\n@pause menu\n\nwhen I receive [pause menu v]\nif <(?pause menu opened?) = [1]> then\n    set volume to (?sound effects) %\n    tick\nelse\n    hide\n    if <(tab selected) = [1]> then\n        change [tab x v] by (((-145) - (tab x)) / (1))\n        change [tab x 2 v] by (((-96) - (tab x 2)) / (1))\n    else\n        if <(tab selected) = [2]> then\n            change [tab x v] by (((-38) - (tab x)) / (1))\n            change [tab x 2 v] by (((33) - (tab x 2)) / (1))\n        else\n            change [tab x v] by (((92) - (tab x)) / (1))\n            change [tab x 2 v] by (((158) - (tab x 2)) / (1))\n        end\n    end\nend\n\ndefine tick\ninput\nrender\nif <not <mouse down?>> then\n    set [?render in pause? v] to [0]\nend\nif <(tab selected) = [1]> then\n    if <<not <(round (tab x)) = [-145]>> and <not <(round (tab x 2)) = [-96]>>> then\n        set [?render in pause? v] to [1]\n    end\nelse\n    if <(tab selected) = [2]> then\n        if <<not <(round (tab x)) = [-38]>> and <not <(round (tab x 2)) = [33]>>> then\n            set [?render in pause? v] to [1]\n        end\n    else\n        if <<not <(round (tab x)) = [92]>> and <not <(round (tab x 2)) = [158]>>> then\n            set [?render in pause? v] to [1]\n        end\n    end\nend\n\ndefine input\nif <not <mouse down?>> then\n    set [thing selected v] to [0]\nend\nif <<<(mouse x) > [-165]> and <(mouse y) > [115]>> and <<[-67] > (mouse x)> and <[160] > (mouse y)>>> then\n    if <(thing selected) = [0]> then\n        if <mouse down?> then\n            set [tab selected v] to [1]\n            set [thing selected v] to [1]\n            set [?render in pause? v] to [1]\n        end\n    end\nend\nif <<<(mouse x) > [-67]> and <(mouse y) > [115]>> and <<[60] > (mouse x)> and <[160] > (mouse y)>>> then\n    if <(thing selected) = [0]> then\n        if <mouse down?> then\n            set [tab selected v] to [2]\n            set [thing selected v] to [2]\n            set [?render in pause? v] to [1]\n        end\n    end\nend\nif <<<(mouse x) > [60]> and <(mouse y) > [115]>> and <<[180] > (mouse x)> and <[160] > (mouse y)>>> then\n    if <(thing selected) = [0]> then\n        if <mouse down?> then\n            set [tab selected v] to [3]\n            set [thing selected v] to [3]\n            set [?render in pause? v] to [1]\n        end\n    end\nend\nif <<<(mouse x) > [60]> and <(mouse y) > [115]>> and <<[180] > (mouse x)> and <[160] > (mouse y)>>> then\n    if <(thing selected) = [0]> then\n        if <mouse down?> then\n            set [tab selected v] to [3]\n            set [thing selected v] to [3]\n            set [?render in pause? v] to [1]\n        end\n    end\nend\nif <(tab selected) = [1]> then\n    if <<<(mouse x) > [-55]> and <(mouse y) > [5]>> and <<[55] > (mouse x)> and <[35] > (mouse y)>>> then\n        if <(thing selected) = [0]> then\n            if <mouse down?> then\n                set [thing selected v] to [4]\n            end\n        end\n    end\n    if <<<(mouse x) > [-55]> and <(mouse y) > [-85]>> and <<[55] > (mouse x)> and <[-55] > (mouse y)>>> then\n        if <(thing selected) = [0]> then\n            if <mouse down?> then\n                set [thing selected v] to [5]\n            end\n        end\n    end\n    if <(thing selected) = [4]> then\n        set [?music v] to ((mouse x) + (50))\n        set [?render in pause? v] to [1]\n    end\n    if <(thing selected) = [5]> then\n        set [?sound effects v] to ((mouse x) + (50))\n        set [?render in pause? v] to [1]\n    end\nelse\n    if <(tab selected) = [2]> then\n        if <<<(mouse x) > [-20]> and <(mouse y) > [45]>> and <<[20] > (mouse x)> and <[72] > (mouse y)>>> then\n            if <(thing selected) = [0]> then\n                if <mouse down?> then\n                    set [thing selected v] to [6]\n                    if <(?wireframe) = [0]> then\n                        set [?wireframe v] to [1]\n                    else\n                        set [?wireframe v] to [0]\n                    end\n                    start sound [Click v]\n                    set [?render in pause? v] to [1]\n                end\n            end\n        end\n        if <<<(mouse x) > [-55]> and <(mouse y) > [-35]>> and <<[55] > (mouse x)> and <[-5] > (mouse y)>>> then\n            if <(thing selected) = [0]> then\n                if <mouse down?> then\n                    set [thing selected v] to [7]\n                end\n            end\n        end\n        if <<<(mouse x) > [-55]> and <(mouse y) > [-115]>> and <<[55] > (mouse x)> and <[-85] > (mouse y)>>> then\n            if <(thing selected) = [0]> then\n                if <mouse down?> then\n                    set [thing selected v] to [8]\n                end\n            end\n        end\n        if <(thing selected) = [7]> then\n            set [?render distance v] to ((((mouse x) + (50)) * (25)) + (500))\n            set [?render in pause? v] to [1]\n        end\n        if <(thing selected) = [8]> then\n            set [?triangle resolution v] to ((11) - (((mouse x) + (60)) / (11)))\n            set [?render in pause? v] to [1]\n        end\n    end\nend\nif <(?music) > [100]> then\n    set [?music v] to [100]\nend\nif <[0] > (?music)> then\n    set [?music v] to [0]\nend\nif <(?sound effects) > [100]> then\n    set [?sound effects v] to [100]\nend\nif <[0] > (?sound effects)> then\n    set [?sound effects v] to [0]\nend\nif <(?render distance) > [3000]> then\n    set [?render distance v] to [3000]\nend\nif <[500] > (?render distance)> then\n    set [?render distance v] to [500]\nend\nif <(?triangle resolution) > [10]> then\n    set [?triangle resolution v] to [10]\nend\nif <[1] > (?triangle resolution)> then\n    set [?triangle resolution v] to [1]\nend\n\ndefine render\nswitch costume to (background v)\nstamp\nswitch costume to (empty v)\nset pen color to (#ffffff)\nset pen size to (5)\nif <(tab selected) = [1]> then\n    change [tab x v] by (((-145) - (tab x)) / (2))\n    change [tab x 2 v] by (((-96) - (tab x 2)) / (2))\nelse\n    if <(tab selected) = [2]> then\n        change [tab x v] by (((-38) - (tab x)) / (2))\n        change [tab x 2 v] by (((33) - (tab x 2)) / (2))\n    else\n        change [tab x v] by (((92) - (tab x)) / (2))\n        change [tab x 2 v] by (((158) - (tab x 2)) / (2))\n    end\nend\ngo to x: (tab x) y: (117)\npen down\ngo to x: (tab x 2) y: (117)\npen up\nif <(tab selected) = [1]> then\n    set pen size to (3)\n    go to x: (-50) y: (20)\n    pen down\n    go to x: (50) y: (20)\n    pen up\n    set pen size to (4)\n    go to x: ((?music) - (50)) y: (30)\n    pen down\n    go to x: ((?music) - (50)) y: (10)\n    pen up\n    set pen size to (3)\n    go to x: (-50) y: (-70)\n    pen down\n    go to x: (50) y: (-70)\n    pen up\n    set pen size to (4)\n    go to x: ((?sound effects) - (50)) y: (-60)\n    pen down\n    go to x: ((?sound effects) - (50)) y: (-80)\n    pen up\nelse\n    if <(tab selected) = [2]> then\n        set pen size to (3)\n        go to x: (-50) y: (-20)\n        pen down\n        go to x: (50) y: (-20)\n        pen up\n        set pen size to (4)\n        go to x: ((((?render distance) - (500)) / (25)) - (50)) y: (-10)\n        pen down\n        go to x: ((((?render distance) - (500)) / (25)) - (50)) y: (-30)\n        pen up\n        set pen size to (3)\n        go to x: (-50) y: (-100)\n        pen down\n        go to x: (50) y: (-100)\n        pen up\n        set pen size to (4)\n        go to x: (((11) - ((?triangle resolution) * (11))) + (50)) y: (-90)\n        pen down\n        go to x: (((11) - ((?triangle resolution) * (11))) + (50)) y: (-110)\n        pen up\n    end\nend\ngo to x: (0) y: (0)\nif <(tab selected) = [2]> then\n    switch costume to (join (join [text ] (tab selected)) (join [ ] (?wireframe)))\nelse\n    switch costume to (join [text ] (tab selected))\nend\nshow\n\nwhen I receive [setup v]\nset [tab selected v] to [1]\nset [tab x v] to [-145]\nset [tab x 2 v] to [-96]\nset [thing selected v] to [867]\nset [?pause menu opened? v] to [0]\nset [?render in pause? v] to [0]\nset [?music v] to [100]\nset [?sound effects v] to [100]\nset [?wireframe v] to [0]\nset [?render distance v] to [3000]\nset [?triangle resolution v] to [1]\nhide\n\nwhen flag clicked\nhide\n\n@credits\n\nwhen I receive [credits v]\nbroadcast (check if new world record v) and wait\nbroadcast (show world record v) and wait\nerase all\nclear graphic effects\nhide\npoint in direction (90)\nset [credits scroll y v] to [0]\nwait (0.5) seconds\nadd [-450] [1]\nadd [-775] [2]\nset [credits y v] to [-10000]\nrepeat until <[-1200] > (credits scroll y)>\n    broadcast (credits tick v) and wait\n    change [credits scroll y v] by (-0.5)\nend\nset size to (100) %\nset [ghost v] effect to (100)\nswitch costume to (costume7 v)\ngo to x: (0) y: (0)\nwait (0.5) seconds\nshow\nrepeat (80)\n    change [ghost v] effect by (-1.75)\nend\nwait (20) seconds\nrepeat (80)\n    change [ghost v] effect by (1.75)\nend\nhide\nwait (0) seconds\nclear graphic effects\nswitch costume to (costume8 v)\npoint in direction (90)\ngo to x: (0) y: (180)\nset size to (1) %\nshow\nrepeat (35)\n    change size by (((100) - (size)) / (6))\n    change y by (((0) - (y position)) / (6))\nend\nreset timer\nforever\n    turn right ((((([cos v] of (((timer) * (80)) - (80)) ) * (10)) + (90)) - (direction)) / (5)) degrees\nend\n\ndefine add (y) (costume)\nset [credits y v] to (y)\nset [credits costume v] to (costume)\ncreate clone of (_myself_ v)\n\nwhen I receive [credits tick v]\nshow\nswitch costume to (credits1 v)\nset size to (10000) %\nswitch costume to (join [credits] (credits costume))\ngo to x: (0) y: ((credits y) - (credits scroll y))\nset size to (100) %\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\n\n@cloud\n\ndefine encode (input)\nset [en - decode output v] to []\nset [en - decode i v] to [0]\nrepeat (length of (input))\n    change [en - decode i v] by (1)\n    switch costume to (letter (en - decode i) of (input))\n    if <[1] = (length of (costume [number v]))> then\n        set [en - decode output v] to (join (join (en - decode output) [0]) (costume [number v]))\n    else\n        set [en - decode output v] to (join (en - decode output) (costume [number v]))\n    end\nend\n\nencode [CrystalKeeper7]\n\ndefine decode (input)\nset [en - decode output v] to []\nset [en - decode i v] to [1]\nrepeat ((length of (input)) * (0.5))\n    set [en - decode output v] to (join (en - decode output) (item (join (letter (en - decode i) of (input)) (letter ((en - decode i) + (1)) of (input))) of [characters v]))\n    change [en - decode i v] by (2)\nend\n\ndecode (en - decode output)\n\nwhen I receive [show world record v]\ndecode (☁ world record name 2.0)\ndelete all of [time calculation v]\nset [world record time v] to (☁ world record time 2.0)\nadd ([floor v] of (((world record time) / (30)) / (60)) ) to [time calculation v]\nset [world record time v] to ((world record time) - (((item (1) of [time calculation v]) * (30)) * (60)))\nadd ([floor v] of ((world record time) / (30)) ) to [time calculation v]\nset [world record time v] to ((world record time) - ((item (2) of [time calculation v]) * (30)))\nadd (round ((world record time) * (3.3333333))) to [time calculation v]\nif <[1] = (length of (item (1) of [time calculation v]))> then\n    set [world record display v] to (join [world record: ] (join (join [0] (item (1) of [time calculation v])) [:]))\nelse\n    set [world record display v] to (join [world record: ] (join (item (1) of [time calculation v]) [:]))\nend\nif <[1] = (length of (item (2) of [time calculation v]))> then\n    set [world record display v] to (join (world record display) (join (join [0] (item (2) of [time calculation v])) [.]))\nelse\n    set [world record display v] to (join (world record display) (join (item (2) of [time calculation v]) [.]))\nend\nif <[1] = (length of (item (3) of [time calculation v]))> then\n    set [world record display v] to (join (world record display) (join [0] (item (3) of [time calculation v])))\nelse\n    set [world record display v] to (join (world record display) (item (3) of [time calculation v]))\nend\nset [world record display v] to (join (world record display) (join [ by ] (en - decode output)))\nshow variable [world record display v]\n\nwhen flag clicked\nhide variable [world record display v]\nhide variable [world record display 2 v]\n\ndefine set new world record (username) (time)\nencode (username)\nset [☁ world record name 2.0 v] to (en - decode output)\nset [☁ world record time 2.0 v] to (time)\n\nset new world record [rens2] [108000]\n\nbroadcast (show world record v) and wait\n\nwhen I receive [tick v]\nif <(?pause menu opened?) = [1]> then\n    broadcast (show world record v) and wait\nelse\n    hide variable [world record display v]\nend\n\nwhen I receive [check if new world record v]\nif <(e speedrun?) = [1]> then\n    set [☁ last v] to (a timer \(frames\))\n    if <[1] = <[1] = [1]>> then\n        if <(☁ world record time 2.0) > (a timer \(frames\))> then\n            set new world record (username) (a timer \(frames\))\n        end\n    else\n        if <(☁ world record time 2.0) > (a timer \(frames\))> then\n            set [world record display 2 v] to [You got the world record! Please comment a link to a video of the run. If the run isn't recorded your time won't be saved :\(]\n            show variable [world record display 2 v]\n        end\n    end\nend\n\nset new world record [kociaczek327] [3435]\n\n@thumbnail\n\nwhen flag clicked\nshow list [link v]\nshow\ngo to [front v] layer\nwait (1) seconds\nbroadcast (intro textbox v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n
\n                Tile ✎  Scrolling Platformer Creator\n\n                    Share your save codes here:\n       https://scratch.mit.edu/discuss/topic/478905/\n\nHello and welcome to Tile! I'm a little-bit lazy, so this time, I decided to let you make the scrolling platformer. If \nyou enjoy, please leave a love and fave!\n\nPlay here without lag:\nhttps://turbowarp.org/479656234\n\nBig thanks to @StratfordJames for a lot of graphic inspiration, and some code inspiration!\n\nInstructions\n✏ Use arrow keys, or WASD to scroll in the editor!\n✏ Click to place a block!\n✏ Change blocks by going into the menu or by pressing \n    keys 0-9!\n✏ Press space to select the eraser!\n✏ There's more tools in the more menu! Here you can \n     find walljump!\n✏ Click on the export button when you're done, and \n     copy the code!\n✏ Paste it where you want!\n\nCredits\n✏ Big thanks to @TimMcCool and @StratfordJames!\n✏ Thanks to @TimMcCool for collision script, \n     checkpoint art and some UI inspiration!\n✏ Thanks to @StratfordJames for a lot of UI inpiration!\n✏ Also, a big thanks to @-zerx- for hosting the contest!\n✏ Thanks to @fireball2009 for help with one bug.\n\n\n\n\n\n#games #game #art #platformer #maker #Ufhire #all