90%PEN Platformer #All #Games
@Stage\n\nwhen flag clicked\nforever\n    play sound [Volume Beta 17 v] until done\nend\n\n@-\n\n@Controller\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nbroadcast (Init v) and wait\nbroadcast (Load v) and wait\nhide\nswitch costume to (icon2 v)\nreset timer\nforever\n    erase all\n    set [#oldtime v] to (days since 2000)\n    broadcast (Tick v) and wait\n    set [#deltatime v] to (((days since 2000) - (#oldTime)) * (86400))\n    set [fps v] to (round ((1) / (#Deltatime)))\n    if <[0.082] < (#Deltatime)> then\n        set [#deltatime v] to [0.082]\n    end\nend\n\n@Render\n\ndefine Quicksort mesh (lo) to (hi)\nset [~mtr v] to (length of [~meshlayerid v])\nset [_sort0 v] to ((lo) - (1))\nrepeat until <((hi) - (_sort0)) < [17]>\n    set [_sort1 v] to ((((hi) - (_sort0)) mod (3)) + (1))\n    change [_sort0 v] by (1)\n    set [_sort2 v] to (item ((round (((_sort0) + (hi)) / (2))) + ((_sort1) - (2))) of [~meshlayervalue v])\n    set [_sort3 v] to (item ((hi) - (_sort1)) of [~meshlayervalue v])\n    set [_sort1 v] to (item ((_sort0) + (_sort1)) of [~meshlayervalue v])\n    if <not <<(_sort1) > (_sort2)> or <(_sort2) > (_sort3)>>> then\n        set [_sort4 v] to (_sort0)\n        set [_sort5 v] to ((hi) - (1))\n        repeat until <(_sort4) > (_sort5)>\n            if <(item (_sort4) of [~meshlayervalue v]) > (item ((_sort4) + (1)) of [~meshlayervalue v])> then\n                if <<(_sort1) = (_sort2)> and <(_sort2) = (_sort3)>> then\n                    if <(item ((_sort4) + (1)) of [~meshlayervalue v]) = (_sort1)> then\n                        set [_sort1 v] to (item (_sort4) of [~meshlayervalue v])\n                    else\n                        set [_sort1 v] to (item ((_sort4) + (1)) of [~meshlayervalue v])\n                    end\n                end\n                set [_sort4 v] to [0]\n                set [_sort5 v] to [-1]\n            else\n                if <(item (_sort5) of [~meshlayervalue v]) > (item ((_sort5) + (1)) of [~meshlayervalue v])> then\n                    if <<(_sort1) = (_sort2)> and <(_sort2) = (_sort3)>> then\n                        if <(item ((_sort5) + (1)) of [~meshlayervalue v]) = (_sort1)> then\n                            set [_sort1 v] to (item (_sort5) of [~meshlayervalue v])\n                        else\n                            set [_sort1 v] to (item ((_sort5) + (1)) of [~meshlayervalue v])\n                        end\n                    end\n                    set [_sort4 v] to [0]\n                    set [_sort5 v] to [-1]\n                end\n            end\n            change [_sort4 v] by (1)\n            change [_sort5 v] by (-1)\n        end\n        if <(_sort5) > [0]> then\n            set [_sort0 v] to (hi)\n            stop [this script v]\n        end\n    end\n    if <(_sort1) < (_sort2)> then\n        if <(_sort3) < (_sort2)> then\n            if <(_sort3) < (_sort1)> then\n                set [_sort1 v] to (_sort1)\n            else\n                if <(_sort1) < (_sort3)> then\n                    set [_sort1 v] to (_sort3)\n                else\n                    set [_sort1 v] to (_sort2)\n                end\n            end\n        else\n            set [_sort1 v] to (_sort2)\n        end\n    else\n        if <(_sort2) < (_sort1)> then\n            if <(_sort3) < (_sort1)> then\n                if <(_sort3) < (_sort2)> then\n                    set [_sort1 v] to (_sort2)\n                else\n                    if <(_sort2) < (_sort3)> then\n                        set [_sort1 v] to (_sort3)\n                    else\n                        set [_sort1 v] to (_sort1)\n                    end\n                end\n            else\n                set [_sort1 v] to (_sort1)\n            end\n        else\n            if <(_sort3) < (_sort1)> then\n                set [_sort1 v] to (_sort1)\n            else\n                set [_sort1 v] to (_sort3)\n            end\n        end\n    end\n    set [_sort2 v] to (_sort0)\n    repeat until <not <(item (_sort2) of [~meshlayervalue v]) < (_sort1)>>\n        change [_sort2 v] by (1)\n    end\n    set [_sort3 v] to (hi)\n    repeat until <(item (_sort3) of [~meshlayervalue v]) < (_sort1)>\n        change [_sort3 v] by (-1)\n    end\n    repeat until <not <(_sort2) < (_sort3)>>\n        go to x: (item (_sort2) of [~meshlayervalue v]) y: (item (_sort2) of [~meshlayerid v])\n        replace item (_sort2) of [~meshlayervalue v] with (item (_sort3) of [~meshlayervalue v])\n        replace item (_sort3) of [~meshlayervalue v] with (x position)\n        replace item (_sort2) of [~meshlayerid v] with (item (_sort3) of [~meshlayerid v])\n        replace item (_sort3) of [~meshlayerid v] with (y position)\n        change [_sort2 v] by (1)\n        repeat until <not <(item (_sort2) of [~meshlayervalue v]) < (_sort1)>>\n            change [_sort2 v] by (1)\n        end\n        change [_sort3 v] by (-1)\n        repeat until <(item (_sort3) of [~meshlayervalue v]) < (_sort1)>\n            change [_sort3 v] by (-1)\n        end\n    end\n    Quicksort mesh (_sort0) to (_sort3)\nend\nchange [_sort0 v] by (1)\nset [_sort3 v] to (_sort0)\nrepeat ((hi) - (_sort0))\n    go to x: (item ((_sort0) + (1)) of [~meshlayervalue v]) y: (item ((_sort0) + (1)) of [~meshlayerid v])\n    set [_sort1 v] to []\n    set [_sort2 v] to (_sort0)\n    repeat until <<not <(x position) < (item (_sort2) of [~meshlayervalue v])>> or <(_sort2) < (_sort3)>>\n        replace item ((_sort2) + (1)) of [~meshlayerid v] with (item (_sort2) of [~meshlayerid v])\n        replace item ((_sort2) + (1)) of [~meshlayervalue v] with (item (_sort2) of [~meshlayervalue v])\n        change [_sort2 v] by (-1)\n    end\n    replace item ((_sort2) + (1)) of [~meshlayervalue v] with (x position)\n    replace item ((_sort2) + (1)) of [~meshlayerid v] with (y position)\n    change [_sort0 v] by (1)\nend\n\ndefine Render Triangle at: (x1) (y1) (x2) (y2) (x3) (y3) resolution: (res) style color: (color) brightness style: (brightness)\nset [△tri1 v] to ([sqrt v] of ((((x3) - (x2)) * ((x3) - (x2))) + (((y3) - (y2)) * ((y3) - (y2)))) )\nset [△tri2 v] to ([sqrt v] of ((((x3) - (x1)) * ((x3) - (x1))) + (((y3) - (y1)) * ((y3) - (y1)))) )\nset [△tri3 v] to ([sqrt v] of ((((x1) - (x2)) * ((x1) - (x2))) + (((y1) - (y2)) * ((y1) - (y2)))) )\nset [△tri4 v] to ((△Tri1) + ((△Tri2) + (△Tri3)))\nset [△tri5 v] to ((△Tri4) / (2))\nset [△tri5 v] to (((2) * ([sqrt v] of (((△Tri5) * ((△Tri5) - (△Tri1))) * (((△Tri5) - (△Tri2)) * ((△Tri5) - (△Tri3)))) )) / (△Tri5))\nset [△tri6 v] to ((((△Tri1) * (x1)) + (((△Tri2) * (x2)) + ((△Tri3) * (x3)))) / (△Tri4))\nset [△tri7 v] to ((((△Tri1) * (y1)) + (((△Tri2) * (y2)) + ((△Tri3) * (y3)))) / (△Tri4))\nset [△tri1 v] to ((x1) - (△Tri6))\nset [△tri2 v] to ((y1) - (△Tri7))\nset [△tri3 v] to ((x2) - (△Tri6))\nset [△tri4 v] to ((y2) - (△Tri7))\nset [△tri8 v] to ((x3) - (△Tri6))\nset [△tri9 v] to ((y3) - (△Tri7))\nset [i v] to [.5]\nrepeat until <((I) * (△Tri5)) < (((res) / (2)) + (.5))>\n    set pen size to (((I) * (△Tri5)) + (1))\n    go to x: ((x1) - ((I) * (△Tri1))) y: ((y1) - ((I) * (△Tri2)))\n    pen down\n    go to x: ((x2) - ((I) * (△Tri3))) y: ((y2) - ((I) * (△Tri4)))\n    go to x: ((x3) - ((I) * (△Tri8))) y: ((y3) - ((I) * (△Tri9)))\n    go to x: ((x1) - ((I) * (△Tri1))) y: ((y1) - ((I) * (△Tri2)))\n    change pen (color v) by (color)\n    change pen (brightness v) by (brightness)\n    set [i v] to ((I) / ((2.7) - (I)))\nend\nset pen size to ((res) + (1))\ngo to x: (x1) y: (y1)\npen down\ngo to x: (x2) y: (y2)\ngo to x: (x3) y: (y3)\ngo to x: (x1) y: (y1)\npen up\n\nwhen I receive [tick v]\nRender\n\ndefine Render\nSort Objects\nrepeat (length of [~layerid v])\n    set [i v] to (item (m#) of [~layerid v])\n    if <(item (i) of [~layertype v]) = [1]> then\n        Draw Mesh\n    else\n        if <(item (i) of [~layertype v]) = [2]> then\n            Draw 2.5D Sprite\n        else\n            if <(item (i) of [~layertype v]) = [3]> then\n                Draw 2.5D Text\n            else\n                if <(item (i) of [~layertype v]) = [4]> then\n                    Draw 3D Sprite\n                else\n                    if <(item (i) of [~layertype v]) = [5]> then\n                        Draw Dot\n                    else\n                        if <(item (i) of [~layertype v]) = [6]> then\n                            Draw Line\n                        else\n                            Draw Triangle Unit\n                        end\n                    end\n                end\n            end\n        end\n    end\n    switch costume to (render v)\n    set size to ((1) / (0)) %\n    switch costume to (icon v)\n    set pen size to (1)\n    change [m# v] by (-1)\nend\n\ndefine Quicksort Objects (lo) (hi)\nset [_sort0 v] to ((lo) - (1))\nrepeat until <((hi) - (_sort0)) < [17]>\n    set [_sort1 v] to ((((hi) - (_sort0)) mod (3)) + (1))\n    change [_sort0 v] by (1)\n    set [_sort2 v] to (item ((round (((_sort0) + (hi)) / (2))) + ((_sort1) - (2))) of [~layervalue v])\n    set [_sort3 v] to (item ((hi) - (_sort1)) of [~layervalue v])\n    set [_sort1 v] to (item ((_sort0) + (_sort1)) of [~layervalue v])\n    if <not <<(_sort1) > (_sort2)> or <(_sort2) > (_sort3)>>> then\n        set [_sort4 v] to (_sort0)\n        set [_sort5 v] to ((hi) - (1))\n        repeat until <(_sort4) > (_sort5)>\n            if <(item (_sort4) of [~layervalue v]) > (item ((_sort4) + (1)) of [~layervalue v])> then\n                if <<(_sort1) = (_sort2)> and <(_sort2) = (_sort3)>> then\n                    if <(item ((_sort4) + (1)) of [~layervalue v]) = (_sort1)> then\n                        set [_sort1 v] to (item (_sort4) of [~layervalue v])\n                    else\n                        set [_sort1 v] to (item ((_sort4) + (1)) of [~layervalue v])\n                    end\n                end\n                set [_sort4 v] to [0]\n                set [_sort5 v] to [-1]\n            else\n                if <(item (_sort5) of [~layervalue v]) > (item ((_sort5) + (1)) of [~layervalue v])> then\n                    if <<(_sort1) = (_sort2)> and <(_sort2) = (_sort3)>> then\n                        if <(item ((_sort5) + (1)) of [~layervalue v]) = (_sort1)> then\n                            set [_sort1 v] to (item (_sort5) of [~layervalue v])\n                        else\n                            set [_sort1 v] to (item ((_sort5) + (1)) of [~layervalue v])\n                        end\n                    end\n                    set [_sort4 v] to [0]\n                    set [_sort5 v] to [-1]\n                end\n            end\n            change [_sort4 v] by (1)\n            change [_sort5 v] by (-1)\n        end\n        if <(_sort5) > [0]> then\n            set [_sort0 v] to (hi)\n            stop [this script v]\n        end\n    end\n    if <(_sort1) < (_sort2)> then\n        if <(_sort3) < (_sort2)> then\n            if <(_sort3) < (_sort1)> then\n                set [_sort1 v] to (_sort1)\n            else\n                if <(_sort1) < (_sort3)> then\n                    set [_sort1 v] to (_sort3)\n                else\n                    set [_sort1 v] to (_sort2)\n                end\n            end\n        else\n            set [_sort1 v] to (_sort2)\n        end\n    else\n        if <(_sort2) < (_sort1)> then\n            if <(_sort3) < (_sort1)> then\n                if <(_sort3) < (_sort2)> then\n                    set [_sort1 v] to (_sort2)\n                else\n                    if <(_sort2) < (_sort3)> then\n                        set [_sort1 v] to (_sort3)\n                    else\n                        set [_sort1 v] to (_sort1)\n                    end\n                end\n            else\n                set [_sort1 v] to (_sort1)\n            end\n        else\n            if <(_sort3) < (_sort1)> then\n                set [_sort1 v] to (_sort1)\n            else\n                set [_sort1 v] to (_sort3)\n            end\n        end\n    end\n    set [_sort2 v] to (_sort0)\n    repeat until <not <(item (_sort2) of [~layervalue v]) < (_sort1)>>\n        change [_sort2 v] by (1)\n    end\n    set [_sort3 v] to (hi)\n    repeat until <(item (_sort3) of [~layervalue v]) < (_sort1)>\n        change [_sort3 v] by (-1)\n    end\n    repeat until <not <(_sort2) < (_sort3)>>\n        go to x: (item (_sort2) of [~layervalue v]) y: (item (_sort2) of [~layerid v])\n        replace item (_sort2) of [~layervalue v] with (item (_sort3) of [~layervalue v])\n        replace item (_sort3) of [~layervalue v] with (x position)\n        replace item (_sort2) of [~layerid v] with (item (_sort3) of [~layerid v])\n        replace item (_sort3) of [~layerid v] with (y position)\n        change [_sort2 v] by (1)\n        repeat until <not <(item (_sort2) of [~layervalue v]) < (_sort1)>>\n            change [_sort2 v] by (1)\n        end\n        change [_sort3 v] by (-1)\n        repeat until <(item (_sort3) of [~layervalue v]) < (_sort1)>\n            change [_sort3 v] by (-1)\n        end\n    end\n    Quicksort Objects (_sort0) (_sort3)\nend\nchange [_sort0 v] by (1)\nset [_sort3 v] to (_sort0)\nrepeat ((hi) - (_sort0))\n    go to x: (item ((_sort0) + (1)) of [~layervalue v]) y: (item ((_sort0) + (1)) of [~layerid v])\n    set [_sort1 v] to []\n    set [_sort2 v] to (_sort0)\n    repeat until <<not <(x position) < (item (_sort2) of [~layervalue v])>> or <(_sort2) < (_sort3)>>\n        replace item ((_sort2) + (1)) of [~layerid v] with (item (_sort2) of [~layerid v])\n        replace item ((_sort2) + (1)) of [~layervalue v] with (item (_sort2) of [~layervalue v])\n        change [_sort2 v] by (-1)\n    end\n    replace item ((_sort2) + (1)) of [~layervalue v] with (x position)\n    replace item ((_sort2) + (1)) of [~layerid v] with (y position)\n    change [_sort0 v] by (1)\nend\n\ndefine Draw Mesh\ndelete all of [~meshvertexstate v]\ndelete all of [~meshlayervalue v]\ndelete all of [~meshlayerid v]\ndelete all of [~meshprojectedx v]\ndelete all of [~meshprojectedy v]\ndelete all of [~meshvertx v]\ndelete all of [~meshverty v]\ndelete all of [~meshvertz v]\nset [v v] to ((item ((item (item (m#) of [~layerid v]) of [@objectid v]) - (1)) of [~vertcount v]) * (3))\nset [~mtr v] to (item ((item (item (m#) of [~layerid v]) of [@objectid v]) - (1)) of [~facecount v])\nset [~normaladd v] to (item ((item (item (m#) of [~layerid v]) of [@objectid v]) - (1)) of [~normalcount v])\nset [tw1 v] to ([sin v] of (item (((i) * (10)) - (2)) of [~objectdata v]) )\nset [tw2 v] to ([cos v] of (item (((i) * (10)) - (2)) of [~objectdata v]) )\nset [tw3 v] to ([sin v] of (item (((i) * (10)) - (1)) of [~objectdata v]) )\nset [tw4 v] to ([cos v] of ((item (((i) * (10)) - (1)) of [~objectdata v]) + (180)) )\nset [tw5 v] to ([sin v] of (item ((i) * (10)) of [~objectdata v]) )\nset [tw6 v] to ([cos v] of (item ((i) * (10)) of [~objectdata v]) )\nset [wm1 v] to (((tw4) * (tw6)) - ((tw1) * ((tw3) * (tw5))))\nset [wm2 v] to ((0) - ((tw5) * (tw2)))\nset [wm3 v] to (((tw3) * (tw6)) + ((tw1) * ((tw4) * (tw5))))\nset [wm4 v] to (((tw4) * (tw5)) + ((tw1) * ((tw3) * (tw6))))\nset [wm5 v] to ((tw2) * (tw6))\nset [wm6 v] to (((tw3) * (tw5)) - ((tw1) * ((tw4) * (tw6))))\nset [wm7 v] to ((0) - ((tw2) * (tw3)))\nset [wm9 v] to ((tw2) * (tw4))\nrepeat (item (item (i) of [@objectid v]) of [~vertcount2 v])\n    set [~getx v] to ((item (((i) * (10)) - (5)) of [~objectdata v]) * (item ((v) + (1)) of [~verts v]))\n    set [~gety v] to ((item (((i) * (10)) - (4)) of [~objectdata v]) * (item ((v) + (2)) of [~verts v]))\n    set [~getz v] to ((item (((i) * (10)) - (3)) of [~objectdata v]) * (item ((v) + (3)) of [~verts v]))\n    set [~get3 v] to ((((~GetX) * (wm1)) + (((~GetY) * (wm2)) + ((~GetZ) * (wm3)))) + ((item (((i) * (10)) - (8)) of [~objectdata v]) - (@CameraX)))\n    set [~get2 v] to ((((~GetX) * (wm4)) + (((~GetY) * (wm5)) + ((~GetZ) * (wm6)))) + ((item (((i) * (10)) - (7)) of [~objectdata v]) - (@CameraY)))\n    set [~get v] to ((((~GetX) * (wm7)) + (((~GetY) * (tw1)) + ((~GetZ) * (wm9)))) + ((item (((i) * (10)) - (6)) of [~objectdata v]) - (@CameraZ)))\n    add (((~Get3) * (vm1)) + (((~Get2) * (vm2)) + ((~Get) * (vm3)))) to [~meshvertx v]\n    add (((~Get3) * (vm4)) + (((~Get2) * (vm5)) + ((~Get) * (vm6)))) to [~meshverty v]\n    add (((~Get3) * (vm7)) + (((~Get2) * (#CamSinX)) + ((~Get) * (vm9)))) to [~meshvertz v]\n    add (((item (length of [~meshvertx v]) of [~meshvertx v]) / (item (length of [~meshvertx v]) of [~meshvertz v])) * (fov)) to [~meshprojectedx v]\n    add (((item (length of [~meshvertx v]) of [~meshverty v]) / (item (length of [~meshvertx v]) of [~meshvertz v])) * (fov)) to [~meshprojectedy v]\n    add <(item (length of [~meshvertx v]) of [~meshvertz v]) > [0]> to [~meshvertexstate v]\n    change [v v] by (3)\nend\ndelete all of [~cullvalue v]\nrepeat (item (item (i) of [@objectid v]) of [~facecount2 v])\n    set [~get3 v] to (item (((~mTr) * (3)) + (2)) of [~face v])\n    set [~get2 v] to (item (((~mTr) * (3)) + (1)) of [~face v])\n    set [~get v] to (item (((~mTr) * (3)) + (3)) of [~face v])\n    if <<not <(((item (~Get) of [~meshprojectedx v]) - (item (~Get2) of [~meshprojectedx v])) * ((item (~Get3) of [~meshprojectedy v]) - (item (~Get2) of [~meshprojectedy v]))) < (((item (~Get3) of [~meshprojectedx v]) - (item (~Get2) of [~meshprojectedx v])) * ((item (~Get) of [~meshprojectedy v]) - (item (~Get2) of [~meshprojectedy v])))>> and <[2] < (((item (~Get2) of [~meshvertexstate v]) + (item (~Get) of [~meshvertexstate v])) + (item (~Get3) of [~meshvertexstate v]))>> then\n        if <not <<<(item (~Get) of [~meshprojectedx v]) > [240]> and <<(item (~Get2) of [~meshprojectedx v]) > [240]> and <(item (~Get3) of [~meshprojectedx v]) > [240]>>> or <<(item (~Get) of [~meshprojectedx v]) < [-240]> and <<(item (~Get2) of [~meshprojectedx v]) < [-240]> and <(item (~Get3) of [~meshprojectedx v]) < [-240]>>>>> then\n            if <not <<<(item (~Get) of [~meshprojectedy v]) > [180]> and <<(item (~Get2) of [~meshprojectedy v]) > [180]> and <(item (~Get3) of [~meshprojectedy v]) > [180]>>> or <<(item (~Get) of [~meshprojectedy v]) < [-180]> and <<(item (~Get2) of [~meshprojectedy v]) < [-180]> and <(item (~Get3) of [~meshprojectedy v]) < [-180]>>>>> then\n                set [~getx v] to ((((item (~Get2) of [~meshvertx v]) + (item (~Get3) of [~meshvertx v])) + (item (~Get) of [~meshvertx v])) / (3))\n                set [~gety v] to ((((item (~Get2) of [~meshverty v]) + (item (~Get3) of [~meshverty v])) + (item (~Get) of [~meshverty v])) / (3))\n                set [~getz v] to ((((item (~Get2) of [~meshvertz v]) + (item (~Get3) of [~meshvertz v])) + (item (~Get) of [~meshvertz v])) / (3))\n                add (~mTr) to [~meshlayerid v]\n                add (((item (~Get2) of [~meshvertexstate v]) + (item (~Get) of [~meshvertexstate v])) + (item (~Get3) of [~meshvertexstate v])) to [~cullvalue v]\n                add ([sqrt v] of ((((~GetX) * (~GetX)) + ((~GetY) * (~GetY))) + ((~GetZ) * (~GetZ))) ) to [~meshlayervalue v]\n            end\n        end\n    end\n    change [~mtr v] by (1)\nend\nQuicksort mesh [1] to (length of [~meshlayervalue v])\nset [~templightx v] to ((((#LightX) * (wm1)) + ((#LightY) * (wm4))) + ((#LightZ) * (wm7)))\nset [~templighty v] to ((((#LightX) * (wm2)) + ((#LightY) * (wm5))) + ((#LightZ) * (tw1)))\nset [~templightz v] to ((((#LightX) * (wm3)) + ((#LightY) * (wm6))) + ((#LightZ) * (wm9)))\nrepeat (length of [~meshlayerid v])\n    set [~get3 v] to (item (((item (~mTr) of [~meshlayerid v]) * (3)) + (1)) of [~face v])\n    set [~get2 v] to (item (((item (~mTr) of [~meshlayerid v]) * (3)) + (2)) of [~face v])\n    set [~get v] to (item (((item (~mTr) of [~meshlayerid v]) * (3)) + (3)) of [~face v])\n    if <[@custommaterialid v] contains (item (m#) of [~layerid v])?> then\n        set pen color to (item (item # of (item (item # of (item (m#) of [~layerid v]) in [@custommaterialid v]) of [@custommaterial v]) in [~materials v]) of [~materialcolor v])\n    else\n        set pen color to (item (item # of (item ((item (~mTr) of [~meshlayerid v]) + (1)) of [~trimaterial v]) in [~materials v]) of [~materialcolor v])\n    end\n    change pen (brightness v) by ((@AmbientBrightness) + ((@LightingToggle) * (((@LightStrength) * ((((item ((((item (((item (~mTr) of [~meshlayerid v]) * (3)) + (1)) of [~meshnormalpointer v]) * (3)) - (2)) + (~normalAdd)) of [~normal v]) * (~tempLightX)) + ((item ((((item (((item (~mTr) of [~meshlayerid v]) * (3)) + (2)) of [~meshnormalpointer v]) * (3)) - (1)) + (~normalAdd)) of [~normal v]) * (~tempLightY))) + ((item (((item (((item (~mTr) of [~meshlayerid v]) * (3)) + (3)) of [~meshnormalpointer v]) * (3)) + (~normalAdd)) of [~normal v]) * (~tempLightZ)))) - (@LightStrength))))\n    if <(item (~mTr) of [~cullvalue v]) = [3]> then\n        Render Triangle at: (item (~Get3) of [~meshprojectedx v]) (item (~Get3) of [~meshprojectedy v]) (item (~Get2) of [~meshprojectedx v]) (item (~Get2) of [~meshprojectedy v]) (item (~Get) of [~meshprojectedx v]) (item (~Get) of [~meshprojectedy v]) resolution: [1] style color: [0] brightness style: [0]\n    else\n        Z-Clip Triangle (item (~Get3) of [~meshvertx v]) (item (~Get3) of [~meshverty v]) (item (~Get3) of [~meshvertz v]) . (item (1) of [~meshvertx v]) (item (1) of [~meshverty v]) (item (1) of [~meshvertz v]) . (item (1) of [~meshvertx v]) (item (1) of [~meshverty v]) (item (1) of [~meshvertz v])\n        replace item (1) of [~zcliptemp v] with (((Z_output x1) / (Z_output z1)) * (fov))\n        replace item (2) of [~zcliptemp v] with (((Z_output y1) / (Z_output z1)) * (fov))\n        replace item (3) of [~zcliptemp v] with (((Z_output x2) / (Z_output z2)) * (fov))\n        replace item (4) of [~zcliptemp v] with (((Z_output y2) / (Z_output z2)) * (fov))\n        replace item (5) of [~zcliptemp v] with (((Z_output x3) / (Z_output z3)) * (fov))\n        replace item (6) of [~zcliptemp v] with (((Z_output y3) / (Z_output z3)) * (fov))\n        if <(Z_isquad?) = [1]> then\n            Render Triangle at: (item (1) of [~zcliptemp v]) (item (2) of [~zcliptemp v]) (item (3) of [~zcliptemp v]) (item (4) of [~zcliptemp v]) (item (5) of [~zcliptemp v]) (item (6) of [~zcliptemp v]) resolution: [1] style color: [] brightness style: []\n            Render Triangle at: (item (1) of [~zcliptemp v]) (item (2) of [~zcliptemp v]) (((Z_output x4) / (Z_output z4)) * (fov)) (((Z_output y4) / (Z_output z4)) * (fov)) (item (5) of [~zcliptemp v]) (item (6) of [~zcliptemp v]) resolution: [1] style color: [] brightness style: []\n        else\n            Render Triangle at: (item (1) of [~zcliptemp v]) (item (2) of [~zcliptemp v]) (item (3) of [~zcliptemp v]) (item (4) of [~zcliptemp v]) (item (5) of [~zcliptemp v]) (item (6) of [~zcliptemp v]) resolution: [1] style color: [] brightness style: []\n        end\n    end\n    change [~mtr v] by (-1)\nend\n\ndefine Draw 2.5D Sprite\nset [~getx v] to ((item (((i) * (10)) - (8)) of [~objectdata v]) - (@CameraX))\nset [~gety v] to ((item (((i) * (10)) - (7)) of [~objectdata v]) - (@CameraY))\nset [~getz v] to ((item (((i) * (10)) - (6)) of [~objectdata v]) - (@CameraZ))\nset [~vertz v] to (((~GetX) * (vm7)) + (((~GetY) * (#CamSinX)) + ((~GetZ) * (vm9))))\nif <[0] < (~vertZ)> then\n    go to x: (((((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3)))) / (~vertZ)) * (fov)) y: (((((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6)))) / (~vertZ)) * (fov))\n    switch costume to (error v)\n    switch costume to (item (i) of [@objectid v])\n    set size to (((item (((i) * (10)) - (5)) of [~objectdata v]) * ((fov) / (4))) / (~vertZ)) %\n    stamp\nend\n\ndefine Draw 2.5D Text\nset [~getx v] to ((item (((i) * (10)) - (8)) of [~objectdata v]) - (@CameraX))\nset [~gety v] to ((item (((i) * (10)) - (7)) of [~objectdata v]) - (@CameraY))\nset [~getz v] to ((item (((i) * (10)) - (6)) of [~objectdata v]) - (@CameraZ))\nset [~vertz v] to (((~GetX) * (vm7)) + (((~GetY) * (#CamSinX)) + ((~GetZ) * (vm9))))\nif <[0] < (~vertZ)> then\n    Write: (item (i) of [@objectid v]) x: (((((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3)))) / (~vertZ)) * (fov)) y: (((((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6)))) / (~vertZ)) * (fov)) size: (((item (((i) * (10)) - (5)) of [~objectdata v]) * ((fov) / (4))) / (~vertZ)) wrap? []\nend\n\ndefine Write: (string) x: (x) y: (y) size: (size) wrap? (wrap)\nswitch costume to (large v)\ngo to x: ((x) - (((size) * (length of (string))) / (3.97))) y: (y)\nfor each [i v] in (length of (string))\n    switch costume to (icon v)\n    set size to (size) %\n    switch costume to (error v)\n    switch costume to (letter (i) of (string))\n    stamp\n    switch costume to (large v)\n    change x by ((.55) * (size))\nend\n\ndefine Sort Objects\ndelete all of [~layerid v]\ndelete all of [~layervalue v]\nset [~mtr v] to [0]\nrepeat (length of [@activeobjects v])\n    change [~mtr v] by (1)\n    if <(item (~mTr) of [@renderstate v]) = [1]> then\n        if <(item (~mTr) of [~layertype v]) = [7]> then\n            set [~getx v] to ((@CameraX) - ((((item (((~mTr) * (10)) - (8)) of [~objectdata v]) + (item (((~mTr) * (10)) - (5)) of [~objectdata v])) + (item (((~mTr) * (10)) - (2)) of [~objectdata v])) / (3)))\n            set [~gety v] to ((@CameraY) - ((((item (((~mTr) * (10)) - (7)) of [~objectdata v]) + (item (((~mTr) * (10)) - (4)) of [~objectdata v])) + (item (((~mTr) * (10)) - (2)) of [~objectdata v])) / (3)))\n            set [~getz v] to ((@CameraZ) - ((((item (((~mTr) * (10)) - (6)) of [~objectdata v]) + (item (((~mTr) * (10)) - (3)) of [~objectdata v])) + (item ((~mTr) * (10)) of [~objectdata v])) / (3)))\n        else\n            if <(item (~mTr) of [~layertype v]) = [6]> then\n                set [~getx v] to ((@CameraX) - (((item (((~mTr) * (10)) - (8)) of [~objectdata v]) + (item (((~mTr) * (10)) - (5)) of [~objectdata v])) / (2)))\n                set [~gety v] to ((@CameraY) - (((item (((~mTr) * (10)) - (7)) of [~objectdata v]) + (item (((~mTr) * (10)) - (4)) of [~objectdata v])) / (2)))\n                set [~getz v] to ((@CameraZ) - (((item (((~mTr) * (10)) - (6)) of [~objectdata v]) + (item (((~mTr) * (10)) - (3)) of [~objectdata v])) / (2)))\n            else\n                set [~getx v] to ((@CameraX) - (item (((~mTr) * (10)) - (8)) of [~objectdata v]))\n                set [~gety v] to ((@CameraY) - (item (((~mTr) * (10)) - (7)) of [~objectdata v]))\n                set [~getz v] to ((@CameraZ) - (item (((~mTr) * (10)) - (6)) of [~objectdata v]))\n            end\n        end\n        set [~mag v] to ([sqrt v] of (((~GetX) * (~GetX)) + (((~GetY) * (~GetY)) + ((~GetZ) * (~GetZ)))) )\n        add ((~Mag) + ((item (~mTr) of [@renderpriority v]) * (9999999999999))) to [~layervalue v]\n        add (~mTr) to [~layerid v]\n    end\nend\nQuicksort Objects [1] (length of [~layervalue v])\nset [m# v] to (length of [~layerid v])\n\ndefine Draw 3D Sprite\nset [~getx v] to ((item (((i) * (10)) - (8)) of [~objectdata v]) - (@CameraX))\nset [~gety v] to ((item (((i) * (10)) - (7)) of [~objectdata v]) - (@CameraY))\nset [~getz v] to ((item (((i) * (10)) - (6)) of [~objectdata v]) - (@CameraZ))\nset [~vertz v] to (((~GetX) * (vm7)) + (((~GetY) * (#CamSinX)) + ((~GetZ) * (vm9))))\nif <[0] < (~vertZ)> then\n    set rotation style [left-right v]\n    set [~3dspritesize v] to (((item (((i) * (10)) - (5)) of [~objectdata v]) * ((fov) / (800))) / (~vertZ))\n    Go to (((((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3)))) / (~vertZ)) * (fov)) (((((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6)))) / (~vertZ)) * (fov)) width and height ([abs v] of ((~3dSpriteSize) * ([cos v] of ((@CameraRotateY) - (item (((i) * (10)) - (4)) of [~objectdata v])) )) ) ([abs v] of ((~3dSpriteSize) * (#CamCosX)) ) original width and height (item (((i) * (10)) - (3)) of [~objectdata v]) (item (((i) * (10)) - (2)) of [~objectdata v]) centered? <>\n    switch costume to (error v)\n    switch costume to (item (i) of [@objectid v])\n    stamp\n    clear graphic effects\n    point in direction (90)\nend\n\ndefine Go to (x) (y) width and height (w) (h) original width and height (ow) (oh) centered? <centered>\nif <centered> then\n    set [~tempc v] to (costume [number v])\n    if <((w) * (100)) < [100]> then\n        switch costume to (icon v)\n    else\n        switch costume to (render v)\n    end\n    set size to ((w) * (100)) %\n    switch costume to (~tempC)\n    go to x: ((x) + (((ow) * (w)) / (2))) y: ((y) + (((oh) * (w)) / (2)))\n    point in direction (165)\n    set [fisheye v] effect to (((100) * ([abs v] of (([log v] of (0.95) ) / ([log v] of ((1) - (((h) / (w)) / (20))) )) )) - (100))\nelse\n    set [~scalex v] to ((w) * (2))\n    set [~tempc v] to (costume [number v])\n    if <((~scaleX) * (100)) < [100]> then\n        switch costume to (icon v)\n    else\n        switch costume to (render v)\n    end\n    set size to ((~scaleX) * (100)) %\n    switch costume to (~tempC)\n    go to x: (((x) + ((w) * (() - (ow)))) + (((ow) * (~scaleX)) / (2))) y: (((y) + ((h) * (() - (oh)))) + (((oh) * (~scaleX)) / (2)))\n    point in direction (165)\n    set [fisheye v] effect to (((100) * ([abs v] of (([log v] of (0.95) ) / ([log v] of ((1) - ((((h) * (2)) / (~scaleX)) / (20))) )) )) - (100))\nend\n\nwhen I receive [init v]\nswitch costume to (render v)\nset size to ((1) / (0)) %\nswitch costume to (icon v)\n\ndefine Draw Dot\nset [~getx v] to ((item (((i) * (10)) - (8)) of [~objectdata v]) - (@CameraX))\nset [~gety v] to ((item (((i) * (10)) - (7)) of [~objectdata v]) - (@CameraY))\nset [~getz v] to ((item (((i) * (10)) - (6)) of [~objectdata v]) - (@CameraZ))\nset [~vertz v] to (((~GetX) * (vm7)) + (((~GetY) * (#CamSinX)) + ((~GetZ) * (vm9))))\nif <[0] < (~vertZ)> then\n    go to x: (((((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3)))) / (~vertZ)) * (fov)) y: (((((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6)))) / (~vertZ)) * (fov))\n    set pen color to (item (item # of (item (((i) * (10)) - (5)) of [~objectdata v]) in [~materials v]) of [~materialcolor v])\n    set pen size to (((item (((i) * (10)) - (4)) of [~objectdata v]) * ((fov) / (4))) / (~vertZ))\n    pen down\n    pen up\n    set pen size to (1)\nend\n\ndefine Draw Line\nset [~getx v] to ((item (((i) * (10)) - (8)) of [~objectdata v]) - (@CameraX))\nset [~gety v] to ((item (((i) * (10)) - (7)) of [~objectdata v]) - (@CameraY))\nset [~getz v] to ((item (((i) * (10)) - (6)) of [~objectdata v]) - (@CameraZ))\nreplace item (1) of [~linetemp v] with (((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3))))\nreplace item (2) of [~linetemp v] with (((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6))))\nreplace item (3) of [~linetemp v] with (((~GetX) * (vm7)) + (((~GetY) * (#CamSinX)) + ((~GetZ) * (vm9))))\nset [~getx v] to ((item (((i) * (10)) - (5)) of [~objectdata v]) - (@CameraX))\nset [~gety v] to ((item (((i) * (10)) - (4)) of [~objectdata v]) - (@CameraY))\nset [~getz v] to ((item (((i) * (10)) - (3)) of [~objectdata v]) - (@CameraZ))\nset [~vertz v] to (((~GetX) * (vm7)) + (((~GetY) * (#CamSinX)) + ((~GetZ) * (vm9))))\nif <not <<(~vertZ) < [0]> or <(item (3) of [~linetemp v]) < [0]>>> then\n    set pen color to (item (item # of (item (((i) * (10)) - (2)) of [~objectdata v]) in [~materials v]) of [~materialcolor v])\n    draw line from x (((((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3)))) / (~vertZ)) * (fov)) y (((((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6)))) / (~vertZ)) * (fov)) to x (((item (1) of [~linetemp v]) / (item (3) of [~linetemp v])) * (fov)) y (((item (2) of [~linetemp v]) / (item (3) of [~linetemp v])) * (fov)) start width (((item ((i) * (10)) of [~objectdata v]) * ((fov) / (4))) / (~vertZ)) end width (((item (((i) * (10)) - (1)) of [~objectdata v]) * ((fov) / (4))) / (item (3) of [~linetemp v]))\nelse\n    if <(<(~vertZ) < (@Z Clipping Distance)> + <(item (3) of [~linetemp v]) < (@Z Clipping Distance)>) = [1]> then\n        replace item (4) of [~linetemp v] with (((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3))))\n        replace item (5) of [~linetemp v] with (((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6))))\n        set [z_percent v] to (((@Z Clipping Distance) - (item (3) of [~linetemp v])) / ((~vertZ) - (item (3) of [~linetemp v])))\n        if <(~vertZ) < (@Z Clipping Distance)> then\n            replace item (4) of [~linetemp v] with ((item (1) of [~linetemp v]) + (((item (4) of [~linetemp v]) - (item (1) of [~linetemp v])) * (Z_percent)))\n            replace item (5) of [~linetemp v] with ((item (2) of [~linetemp v]) + (((item (5) of [~linetemp v]) - (item (2) of [~linetemp v])) * (Z_percent)))\n            set [~vertz v] to (@Z Clipping Distance)\n        else\n            replace item (1) of [~linetemp v] with ((item (1) of [~linetemp v]) + (((item (4) of [~linetemp v]) - (item (1) of [~linetemp v])) * (Z_percent)))\n            replace item (2) of [~linetemp v] with ((item (2) of [~linetemp v]) + (((item (5) of [~linetemp v]) - (item (2) of [~linetemp v])) * (Z_percent)))\n            replace item (3) of [~linetemp v] with (@Z Clipping Distance)\n        end\n        set pen color to (item (item # of (item (((i) * (10)) - (2)) of [~objectdata v]) in [~materials v]) of [~materialcolor v])\n        draw line from x (((item (4) of [~linetemp v]) / (~vertZ)) * (fov)) y (((item (5) of [~linetemp v]) / (~vertZ)) * (fov)) to x (((item (1) of [~linetemp v]) / (item (3) of [~linetemp v])) * (fov)) y (((item (2) of [~linetemp v]) / (item (3) of [~linetemp v])) * (fov)) start width (((item ((i) * (10)) of [~objectdata v]) * ((fov) / (4))) / (~vertZ)) end width (((item (((i) * (10)) - (1)) of [~objectdata v]) * ((fov) / (4))) / (item (3) of [~linetemp v]))\n    end\nend\n\ndefine draw line from x (x1) y (y1) to x (x2) y (y2) start width (start size) end width (end size)\nif <(start size) = (end size)> then\n    go to x: (x1) y: (y1)\n    set pen size to (1)\n    pen down\n    set pen size to (start size)\n    go to x: (x2) y: (y2)\n    pen up\nelse\n    set [~mag v] to (([sqrt v] of ((((x2) - (x1)) * ((x2) - (x1))) + (((y2) - (y1)) * ((y2) - (y1)))) ) * (2))\n    if <(end size) > (start size)> then\n        int draw line (x1) (y1) (x2) (y2) (start size) (end size) (((y2) - (y1)) / (~Mag)) (((x1) - (x2)) / (~Mag)) ((end size) - (start size)) ((x2) - (x1)) ((y2) - (y1))\n    else\n        int draw line (x2) (y2) (x1) (y1) (end size) (start size) (((y1) - (y2)) / (~Mag)) (((x2) - (x1)) / (~Mag)) ((start size) - (end size)) ((x1) - (x2)) ((y1) - (y2))\n    end\nend\n\ndefine int draw line (x1) (y1) (x2) (y2) (start size) (end size) (x normal) (y normal) (size diff) (x diff) (y diff)\nset [~tempx1 v] to (x1)\nset [~tempy1 v] to (y1)\nif <(start size) > [1]> then\n    set [~temp v] to (start size)\nelse\n    set [~temp v] to [1]\nend\nif <(~temp) < (end size)> then\n    repeat until <((~temp) * (2)) > (end size)>\n        set [~temp2 v] to ((((2) * (~temp)) - (start size)) / (size diff))\n        set [~tempx2 v] to ((x1) + ((x diff) * (~temp2)))\n        set [~tempy2 v] to ((y1) + ((y diff) * (~temp2)))\n        set pen size to (1)\n        go to x: ((~tempX2) - ((~temp) * (x normal))) y: ((~tempY2) - ((~temp) * (y normal)))\n        pen down\n        set pen size to (~temp)\n        go to x: (~tempX1) y: (~tempY1)\n        go to x: ((~tempX2) + ((~temp) * (x normal))) y: ((~tempY2) + ((~temp) * (y normal)))\n        pen up\n        set [~tempx1 v] to (~tempX2)\n        set [~tempy1 v] to (~tempY2)\n        set [~temp v] to ((~temp) * (2))\n    end\n    go to x: ((x2) - (((end size) - (~temp)) * (x normal))) y: ((y2) - (((end size) - (~temp)) * (y normal)))\n    set pen size to (1)\n    pen down\n    set pen size to (~temp)\n    go to x: (~tempX1) y: (~tempY1)\n    go to x: ((x2) + (((end size) - (~temp)) * (x normal))) y: ((y2) + (((end size) - (~temp)) * (y normal)))\n    pen up\n    go to x: (x2) y: (y2)\n    set pen size to (end size)\n    pen down\n    pen up\nend\n\ndefine Draw Triangle Unit\nset [~getx v] to ((item (((i) * (10)) - (8)) of [~objectdata v]) - (@CameraX))\nset [~gety v] to ((item (((i) * (10)) - (7)) of [~objectdata v]) - (@CameraY))\nset [~getz v] to ((item (((i) * (10)) - (6)) of [~objectdata v]) - (@CameraZ))\nreplace item (1) of [~triangletemp v] with (((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3))))\nreplace item (2) of [~triangletemp v] with (((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6))))\nreplace item (3) of [~triangletemp v] with (((~GetX) * (vm7)) + (((~GetY) * (#CamSinX)) + ((~GetZ) * (vm9))))\nset [~getx v] to ((item (((i) * (10)) - (5)) of [~objectdata v]) - (@CameraX))\nset [~gety v] to ((item (((i) * (10)) - (4)) of [~objectdata v]) - (@CameraY))\nset [~getz v] to ((item (((i) * (10)) - (3)) of [~objectdata v]) - (@CameraZ))\nreplace item (4) of [~triangletemp v] with (((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3))))\nreplace item (5) of [~triangletemp v] with (((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6))))\nreplace item (6) of [~triangletemp v] with (((~GetX) * (vm7)) + (((~GetY) * (#CamSinX)) + ((~GetZ) * (vm9))))\nset [~getx v] to ((item (((i) * (10)) - (2)) of [~objectdata v]) - (@CameraX))\nset [~gety v] to ((item (((i) * (10)) - (1)) of [~objectdata v]) - (@CameraY))\nset [~getz v] to ((item ((i) * (10)) of [~objectdata v]) - (@CameraZ))\nreplace item (7) of [~triangletemp v] with (((~GetX) * (vm1)) + (((~GetY) * (vm2)) + ((~GetZ) * (vm3))))\nreplace item (8) of [~triangletemp v] with (((~GetX) * (vm4)) + (((~GetY) * (vm5)) + ((~GetZ) * (vm6))))\nreplace item (9) of [~triangletemp v] with (((~GetX) * (vm7)) + (((~GetY) * (#CamSinX)) + ((~GetZ) * (vm9))))\nif <<<(item (3) of [~triangletemp v]) > (@Z Clipping Distance)> and <(item (6) of [~triangletemp v]) > (@Z Clipping Distance)>> and <(item (9) of [~triangletemp v]) > (@Z Clipping Distance)>> then\n    set pen color to (item (item # of (item (i) of [@objectid v]) in [~materials v]) of [~materialcolor v])\n    Render Triangle at: (((item (1) of [~triangletemp v]) / (item (3) of [~triangletemp v])) * (fov)) (((item (2) of [~triangletemp v]) / (item (3) of [~triangletemp v])) * (fov)) (((item (4) of [~triangletemp v]) / (item (6) of [~triangletemp v])) * (fov)) (((item (5) of [~triangletemp v]) / (item (6) of [~triangletemp v])) * (fov)) (((item (7) of [~triangletemp v]) / (item (9) of [~triangletemp v])) * (fov)) (((item (8) of [~triangletemp v]) / (item (9) of [~triangletemp v])) * (fov)) resolution: [1] style color: [] brightness style: []\nelse\n    if <<(item (3) of [~triangletemp v]) > (@Z Clipping Distance)> or <<(item (6) of [~triangletemp v]) > (@Z Clipping Distance)> or <(item (9) of [~triangletemp v]) > (@Z Clipping Distance)>>> then\n        Z-Clip Triangle (item (1) of [~triangletemp v]) (item (2) of [~triangletemp v]) (item (3) of [~triangletemp v]) . (item (4) of [~triangletemp v]) (item (5) of [~triangletemp v]) (item (6) of [~triangletemp v]) . (item (7) of [~triangletemp v]) (item (8) of [~triangletemp v]) (item (9) of [~triangletemp v])\n        replace item (1) of [~zcliptemp v] with (((Z_output x1) / (Z_output z1)) * (fov))\n        replace item (2) of [~zcliptemp v] with (((Z_output y1) / (Z_output z1)) * (fov))\n        replace item (3) of [~zcliptemp v] with (((Z_output x2) / (Z_output z2)) * (fov))\n        replace item (4) of [~zcliptemp v] with (((Z_output y2) / (Z_output z2)) * (fov))\n        replace item (5) of [~zcliptemp v] with (((Z_output x3) / (Z_output z3)) * (fov))\n        replace item (6) of [~zcliptemp v] with (((Z_output y3) / (Z_output z3)) * (fov))\n        set pen color to (item (item # of (item (i) of [@objectid v]) in [~materials v]) of [~materialcolor v])\n        if <(Z_isquad?) = [1]> then\n            Render Triangle at: (item (1) of [~zcliptemp v]) (item (2) of [~zcliptemp v]) (item (3) of [~zcliptemp v]) (item (4) of [~zcliptemp v]) (item (5) of [~zcliptemp v]) (item (6) of [~zcliptemp v]) resolution: [1] style color: [] brightness style: []\n            Render Triangle at: (item (1) of [~zcliptemp v]) (item (2) of [~zcliptemp v]) (((Z_output x4) / (Z_output z4)) * (fov)) (((Z_output y4) / (Z_output z4)) * (fov)) (item (5) of [~zcliptemp v]) (item (6) of [~zcliptemp v]) resolution: [1] style color: [] brightness style: []\n        else\n            Render Triangle at: (item (1) of [~zcliptemp v]) (item (2) of [~zcliptemp v]) (item (3) of [~zcliptemp v]) (item (4) of [~zcliptemp v]) (item (5) of [~zcliptemp v]) (item (6) of [~zcliptemp v]) resolution: [1] style color: [] brightness style: []\n        end\n    end\nend\n\ndefine Z-Clip Triangle (x1) (y1) (z1) . (x2) (y2) (z2) . (x3) (y3) (z3)\nset [z_output x1 v] to (x1)\nset [z_output y1 v] to (y1)\nset [z_output z1 v] to (z1)\nset [z_output x2 v] to (x2)\nset [z_output y2 v] to (y2)\nset [z_output z2 v] to (z2)\nset [z_output x3 v] to (x3)\nset [z_output y3 v] to (y3)\nset [z_output z3 v] to (z3)\nset [z_num v] to (<(z1) < (@Z Clipping Distance)> + (<(z2) < (@Z Clipping Distance)> + <(z3) < (@Z Clipping Distance)>))\nset [z_isquad? v] to [0]\nif <(Z_num) = [3]> then\n    set [z_behind camera? v] to [1]\nelse\n    set [z_behind camera? v] to [0]\n    if <not <(Z_num) = [0]>> then\n        if <(Z_num) = [1]> then\n            set [z_isquad? v] to [1]\n            if <(@Z Clipping Distance) > (z1)> then\n                line clip (x1) (y1) (z1) . (x3) (y3) (z3)\n                set [z_output x4 v] to (Z_clipx)\n                set [z_output y4 v] to (Z_clipy)\n                set [z_output z4 v] to (@Z Clipping Distance)\n                line clip (x1) (y1) (z1) . (x2) (y2) (z2)\n                set [z_output x1 v] to (Z_clipx)\n                set [z_output y1 v] to (Z_clipy)\n                set [z_output z1 v] to (@Z Clipping Distance)\n            end\n            if <(@Z Clipping Distance) > (z2)> then\n                line clip (x2) (y2) (z2) . (x3) (y3) (z3)\n                set [z_output x4 v] to (x3)\n                set [z_output y4 v] to (y3)\n                set [z_output z4 v] to (z3)\n                set [z_output x3 v] to (Z_clipx)\n                set [z_output y3 v] to (Z_clipy)\n                set [z_output z3 v] to (@Z Clipping Distance)\n                line clip (x2) (y2) (z2) . (x1) (y1) (z1)\n                set [z_output x2 v] to (Z_clipx)\n                set [z_output y2 v] to (Z_clipy)\n                set [z_output z2 v] to (@Z Clipping Distance)\n            end\n            if <(@Z Clipping Distance) > (z3)> then\n                line clip (x3) (y3) (z3) . (x2) (y2) (z2)\n                set [z_output x3 v] to (Z_clipx)\n                set [z_output y3 v] to (Z_clipy)\n                set [z_output z3 v] to (@Z Clipping Distance)\n                line clip (x3) (y3) (z3) . (x1) (y1) (z1)\n                set [z_output x4 v] to (Z_clipx)\n                set [z_output y4 v] to (Z_clipy)\n                set [z_output z4 v] to (@Z Clipping Distance)\n            end\n        else\n            if <(z1) > (@Z Clipping Distance)> then\n                line clip (x1) (y1) (z1) . (x2) (y2) (z2)\n                set [z_output x2 v] to (Z_clipx)\n                set [z_output y2 v] to (Z_clipy)\n                set [z_output z2 v] to (@Z Clipping Distance)\n                line clip (x1) (y1) (z1) . (x3) (y3) (z3)\n                set [z_output x3 v] to (Z_clipx)\n                set [z_output y3 v] to (Z_clipy)\n                set [z_output z3 v] to (@Z Clipping Distance)\n            end\n            if <(z2) > (@Z Clipping Distance)> then\n                line clip (x2) (y2) (z2) . (x1) (y1) (z1)\n                set [z_output x1 v] to (Z_clipx)\n                set [z_output y1 v] to (Z_clipy)\n                set [z_output z1 v] to (@Z Clipping Distance)\n                line clip (x2) (y2) (z2) . (x3) (y3) (z3)\n                set [z_output x3 v] to (Z_clipx)\n                set [z_output y3 v] to (Z_clipy)\n                set [z_output z3 v] to (@Z Clipping Distance)\n            end\n            if <(z3) > (@Z Clipping Distance)> then\n                line clip (x3) (y3) (z3) . (x2) (y2) (z2)\n                set [z_output x2 v] to (Z_clipx)\n                set [z_output y2 v] to (Z_clipy)\n                set [z_output z2 v] to (@Z Clipping Distance)\n                line clip (x3) (y3) (z3) . (x1) (y1) (z1)\n                set [z_output x1 v] to (Z_clipx)\n                set [z_output y1 v] to (Z_clipy)\n                set [z_output z1 v] to (@Z Clipping Distance)\n            end\n        end\n    end\nend\n\ndefine line clip (x1) (y1) (z1) . (x2) (y2) (z2)\nset [z_percent v] to (((@Z Clipping Distance) - (z1)) / ((z2) - (z1)))\nset [z_clipx v] to ((x1) + (((x2) - (x1)) * (Z_percent)))\nset [z_clipy v] to ((y1) + (((y2) - (y1)) * (Z_percent)))\n\n@Update\n\ndefine 📦 Create Hitbox (x) (y) (z) (x2) (y2) (z2)\nadd (x) to [📦 hitboxes v]\nadd (y) to [📦 hitboxes v]\nadd (z) to [📦 hitboxes v]\nadd (x2) to [📦 hitboxes v]\nadd (y2) to [📦 hitboxes v]\nadd (z2) to [📦 hitboxes v]\n\ndefine 📦 Player Colliding?\n📦 Move hitbox [1] to: ((🕹️PlayerX) + (-50)) ((🕹️PlayerY) + (-50)) ((🕹️PlayerZ) + (-50)) ((🕹️PlayerX) + (50)) ((🕹️PlayerY) + (50)) ((🕹️PlayerZ) + (50))\nset [📦 collision v] to [0]\nfor each [i v] in (((length of [📦 hitboxes v]) / (6)) - (1))\n    📦 Colliding? [1] ((i) + (1))\nend\n\ndefine 📦 Move hitbox (id) to: (x) (y) (z) (x2) (y2) (z2)\nreplace item (((id) * (6)) - (5)) of [📦 hitboxes v] with (x)\nreplace item (((id) * (6)) - (4)) of [📦 hitboxes v] with (y)\nreplace item (((id) * (6)) - (3)) of [📦 hitboxes v] with (z)\nreplace item (((id) * (6)) - (2)) of [📦 hitboxes v] with (x2)\nreplace item (((id) * (6)) - (1)) of [📦 hitboxes v] with (y2)\nreplace item ((id) * (6)) of [📦 hitboxes v] with (z2)\n\ndefine 📦 Colliding? (hitbox1) (hitbox2)\nif <<<(item (((hitbox1) * (6)) - (2)) of [📦 hitboxes v]) > (item (((hitbox2) * (6)) - (5)) of [📦 hitboxes v])> and <(item (((hitbox2) * (6)) - (2)) of [📦 hitboxes v]) > (item (((hitbox1) * (6)) - (5)) of [📦 hitboxes v])>> and <<<(item (((hitbox1) * (6)) - (1)) of [📦 hitboxes v]) > (item (((hitbox2) * (6)) - (4)) of [📦 hitboxes v])> and <(item (((hitbox2) * (6)) - (1)) of [📦 hitboxes v]) > (item (((hitbox1) * (6)) - (4)) of [📦 hitboxes v])>> and <<(item ((hitbox1) * (6)) of [📦 hitboxes v]) > (item (((hitbox2) * (6)) - (3)) of [📦 hitboxes v])> and <(item ((hitbox2) * (6)) of [📦 hitboxes v]) > (item (((hitbox1) * (6)) - (3)) of [📦 hitboxes v])>>>> then\n    set [📦 collision v] to [1]\n    if <[~lavahitboxes v] contains ((i) + (1))?> then\n        broadcast (Death v)\n    end\nend\n\ndefine Camera <arrow keys?> <gravity?>\nset [~collidingx v] to [0]\nset [~collidingy v] to [0]\nset [~collidingz v] to [0]\nif <arrow keys?> then\n    set [@camerarotatey v] to ((((~cameraOffsetX) - (mouse x)) / (2)) + (~previousY))\n    set [@camerarotatex v] to ((((mouse y) - (~cameraOffsetY)) / (2)) + (~previousX))\n    change [~cameraoffsetx v] by (((<(mouse x) = [-240]> - <[240] = (mouse x)>) * (#Deltatime)) * (350))\nelse\n    set [~cameraoffsetx v] to (mouse x)\n    set [~cameraoffsety v] to (mouse y)\n    set [~previousx v] to (@CameraRotateX)\n    set [~previousy v] to (@CameraRotateY)\n    change [@camerarotatex v] by (((<key (up arrow v) pressed?> - <key (down arrow v) pressed?>) * (#Deltatime)) * (100))\n    change [@camerarotatey v] by (((<key (left arrow v) pressed?> - <key (right arrow v) pressed?>) * (#Deltatime)) * (100))\nend\nset [~tempx v] to (<key (d v) pressed?> - <key (a v) pressed?>)\nset [~tempz v] to (<key (w v) pressed?> - <key (s v) pressed?>)\nset [~movementratio v] to ((1) / ([sqrt v] of (([abs v] of (~tempX) ) + ([abs v] of (~tempZ) )) ))\nset [~xacc v] to ((~xacc) * ([10 ^ v] of (([log v] of (.75) ) * ((#Deltatime) * (30))) ))\nset [~zacc v] to ((~zacc) * ([10 ^ v] of (([log v] of (.75) ) * ((#Deltatime) * (30))) ))\nchange [~xacc v] by ((((#Deltatime) * (#Deltatime)) * (((~tempX) * (#CamCosY)) + (() - ((~tempZ) * (#CamSinY))))) * ((~movementRatio) * (@MovementSpeed)))\nchange [~zacc v] by ((((#Deltatime) * (#Deltatime)) * (((~tempZ) * (#CamCosY)) + ((~tempX) * (#CamSinY)))) * ((~movementRatio) * (@MovementSpeed)))\nChange Position [X] Speed (~xacc)\nChange Position [Z] Speed (~zacc)\nif <gravity?> then\n    set [~tempy v] to (<key (e v) pressed?> - <key (q v) pressed?>)\n    set [~yacc v] to ((~yacc) * ([10 ^ v] of (([log v] of (.75) ) * ((#Deltatime) * (30))) ))\n    change [~yacc v] by ((((#Deltatime) * (#Deltatime)) * (~tempY)) * (@MovementSpeed))\n    Change Position [Y] Speed (~yacc)\nelse\n    change [~yacc v] by ((#Deltatime) * (-35))\n    Change Position [Y] Speed ((~yacc) * ((#Deltatime) * (35)))\nend\nif <<<(~collidingY) = [1]> and <[.3] < ((timer) - (item (1) of [~cool v]))>> and <<not <(~tempX) = [0]>> or <not <(~tempZ) = [0]>>>> then\n    replace item (1) of [~cool v] with (timer)\n    start sound (join [step_] (pick random (1) to (4)))\nend\nif <(@CameraRotateX) < [-90]> then\n    set [@camerarotatex v] to [-90]\nend\nif <[90] < (@CameraRotateX)> then\n    set [@camerarotatex v] to [90]\nend\n\ndefine Set render priority (0-5) to: (priority) for object: (name)\nreplace item (item # of (name) in [@activeobjects v]) of [@renderpriority v] with ((priority) / (5))\n\ndefine Set mesh to: (mesh) for object: (name)\nreplace item (item # of (name) in [@activeobjects v]) of [@objectid v] with (item # of (mesh) in [~meshes v])\n\ndefine Light\nset [#lightx v] to (([cos v] of (@LightAngle) ) * (.75))\nset [#lighty v] to [.5]\nset [#lightz v] to (([sin v] of (@LightAngle) ) * (.75))\n\ndefine Update\nMove object: [Player] to x: (🕹️PlayerX) y: (🕹️PlayerY) z: (🕹️PlayerZ)\nif <(🕹️PlayerY) < [-3000]> then\n    broadcast (Death v)\nend\nRotate object: [Flag] rot x: [] rot y: (([sin v] of ((timer) * (100)) ) * (10)) rot z: []\nset [~distancex v] to ((🕹️PlayerX) - (item ((item # of [Flag] in [~objectdata v]) + (1)) of [~objectdata v]))\nset [~distancey v] to ((🕹️PlayerY) - ((item ((item # of [Flag] in [~objectdata v]) + (2)) of [~objectdata v]) + (50)))\nset [~distancez v] to ((🕹️PlayerZ) - (item ((item # of [Flag] in [~objectdata v]) + (3)) of [~objectdata v]))\nif <<([sqrt v] of ((((~distanceX) * (~distanceX)) + ((~distanceY) * (~distanceY))) + ((~distanceZ) * (~distanceZ))) ) < [150]> and <(~flagPlaced?) = [1]>> then\n    broadcast (Victory! v)\nend\n\ndefine Move object: (name) to x: (x) y: (y) z: (z)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    replace item ((item # of (name) in [~objectdata v]) + (1)) of [~objectdata v] with (x)\n    replace item ((item # of (name) in [~objectdata v]) + (2)) of [~objectdata v] with (y)\n    replace item ((item # of (name) in [~objectdata v]) + (3)) of [~objectdata v] with (z)\nend\n\ndefine Rotate object: (name) rot x: (rotx) rot y: (roty) rot z: (rotz)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    replace item ((item # of (name) in [~objectdata v]) + (7)) of [~objectdata v] with (rotx)\n    replace item ((item # of (name) in [~objectdata v]) + (8)) of [~objectdata v] with (roty)\n    replace item ((item # of (name) in [~objectdata v]) + (9)) of [~objectdata v] with (rotz)\nend\n\ndefine Scale mesh: (name) x scale: (xs) y scale: (ys) z scale: (zs)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    replace item ((item # of (name) in [~objectdata v]) + (4)) of [~objectdata v] with (xs)\n    replace item ((item # of (name) in [~objectdata v]) + (5)) of [~objectdata v] with (ys)\n    replace item ((item # of (name) in [~objectdata v]) + (6)) of [~objectdata v] with (zs)\nend\n\ndefine Add Objects\nAdd mesh: [Cube] name: [Player] x: [] y: [] z: [] x rotation: [] y rotation: [] z rotation: [] x scale: [50] y scale: [50] z scale: [50]\nSet custom material to: [Player] for mesh: [Player]\n📦 Create Hitbox [Player] [Player] [Player] [Player] [Player] [Player]\nAdd mesh: [Cube] name: [Platform] x: [] y: [0] z: [] x rotation: [] y rotation: [] z rotation: [] x scale: [100] y scale: [50] z scale: [100]\n📦 Create Hitbox [-100] [-50] [-100] [100] [50] [100]\n\ndefine Add mesh: (mesh) name: (name) x: (x) y: (y) z: (z) x rotation: (rotx) y rotation: (roty) z rotation: (rotz) x scale: (xs) y scale: (ys) z scale: (zs)\nadd (name) to [~objectdata v]\nadd (x) to [~objectdata v]\nadd (y) to [~objectdata v]\nadd (z) to [~objectdata v]\nadd (xs) to [~objectdata v]\nadd (ys) to [~objectdata v]\nadd (zs) to [~objectdata v]\nadd (rotx) to [~objectdata v]\nadd (roty) to [~objectdata v]\nadd (rotz) to [~objectdata v]\nadd (name) to [@activeobjects v]\nadd (item # of (mesh) in [~meshes v]) to [@objectid v]\nadd [1] to [~layertype v]\nadd [1] to [@renderstate v]\nadd [1] to [@renderpriority v]\n\ndefine Set render visibility to: (state) for object: (object)\nreplace item (item # of (object) in [@activeobjects v]) of [@renderstate v] with (state)\n\ndefine Add 2.5D text: (text) x: (x) y: (y) z: (z) size: (size) text ID: (id)\nadd (id) to [~objectdata v]\nadd (x) to [~objectdata v]\nadd (y) to [~objectdata v]\nadd (z) to [~objectdata v]\nadd (size) to [~objectdata v]\nrepeat (5)\n    add [0] to [~objectdata v]\nend\nadd (text) to [@objectid v]\nadd (id) to [@activeobjects v]\nadd [3] to [~layertype v]\nadd [1] to [@renderstate v]\nadd [1] to [@renderpriority v]\n\ndefine Reset Camera\nset [🕹️playerx v] to [0]\nset [🕹️playery v] to [100]\nset [🕹️playerz v] to [0]\nset [@camerarotatex v] to [-15]\nset [@camerarotatey v] to [180]\nset [@camerarotatez v] to [0]\nset [~xacc v] to [0]\nset [~yacc v] to [0]\nset [~zacc v] to [0]\n\ndefine Add 2.5D sprite costume: (custome) x: (x) y: (y) z: (z) size: (size) name: (name)\nadd (name) to [~objectdata v]\nadd (x) to [~objectdata v]\nadd (y) to [~objectdata v]\nadd (z) to [~objectdata v]\nadd (size) to [~objectdata v]\nrepeat (5)\n    add [] to [~objectdata v]\nend\nadd (name) to [@activeobjects v]\nadd (custome) to [@objectid v]\nadd [2] to [~layertype v]\nadd [1] to [@renderstate v]\nadd [1] to [@renderpriority v]\n\ndefine Add 3D sprite costume: (custome) x: (x) y: (y) z: (z) size: (size) rotation: (rot) original height: (height) original width: (width) name: (name)\nadd (name) to [~objectdata v]\nadd (x) to [~objectdata v]\nadd (y) to [~objectdata v]\nadd (z) to [~objectdata v]\nadd (size) to [~objectdata v]\nadd (rot) to [~objectdata v]\nadd (height) to [~objectdata v]\nadd (width) to [~objectdata v]\nrepeat (2)\n    add [] to [~objectdata v]\nend\nadd (name) to [@activeobjects v]\nadd (custome) to [@objectid v]\nadd [4] to [~layertype v]\nadd [1] to [@renderstate v]\nadd [1] to [@renderpriority v]\n\ndefine Trigonometry\nset [#camsinx v] to ([sin v] of (@CameraRotateX) )\nset [#camsiny v] to ([sin v] of (@CameraRotateY) )\nset [#camcosx v] to ([cos v] of (@CameraRotateX) )\nset [#camcosy v] to ([cos v] of (@CameraRotateY) )\nset [#camcosz v] to ([cos v] of (@CameraRotateZ) )\nset [#camsinz v] to ([sin v] of (@CameraRotateZ) )\nset [@camerax v] to ((🕹️PlayerX) + (((#CamSinY) * (#CamCosX)) * (1000)))\nset [@cameray v] to ((🕹️PlayerY) + ((#CamSinX) * (-1000)))\nset [@cameraz v] to ((🕹️PlayerZ) + (((#CamCosY) * (#CamCosX)) * (-1000)))\n\nwhen I receive [tick v]\nCamera <mouse down?> <>\nTrigonometry\nView Matrix\nLight\nUpdate\n\ndefine Unload: (name)\nif <[@activeobjects v] contains (name)?> then\n    set [i v] to (item # of (name) in [@activeobjects v])\n    delete (item # of (item # of (name) in [@activeobjects v]) in [@custommaterialid v]) of [@custommaterial v]\n    delete (item # of (item # of (name) in [@activeobjects v]) in [@custommaterialid v]) of [@custommaterialid v]\n    delete (i) of [@objectid v]\n    delete (i) of [@activeobjects v]\n    delete (i) of [~layertype v]\n    delete (i) of [@renderstate v]\n    delete (i) of [@renderpriority v]\n    set [i v] to (item # of (name) in [~objectdata v])\n    repeat (10)\n        delete (i) of [~objectdata v]\n    end\nend\n\ndefine Add dot name: (name) x: (x) y: (y) z: (z) material: (mat) size: (size)\nadd (name) to [~objectdata v]\nadd (x) to [~objectdata v]\nadd (y) to [~objectdata v]\nadd (z) to [~objectdata v]\nadd (mat) to [~objectdata v]\nadd (size) to [~objectdata v]\nrepeat (4)\n    add [] to [~objectdata v]\nend\nadd (name) to [@activeobjects v]\nadd (name) to [@objectid v]\nadd [5] to [~layertype v]\nadd [1] to [@renderstate v]\nadd [1] to [@renderpriority v]\n\ndefine Add line name: (name) x1: (x1) y1: (y1) z1: (z1) x2: (x2) y2: (y2) z2: (z2) material: (mat) size 1: (s1) size 2: (s2)\nadd (name) to [~objectdata v]\nadd (x1) to [~objectdata v]\nadd (y1) to [~objectdata v]\nadd (z1) to [~objectdata v]\nadd (x2) to [~objectdata v]\nadd (y2) to [~objectdata v]\nadd (z2) to [~objectdata v]\nadd (mat) to [~objectdata v]\nadd (s1) to [~objectdata v]\nadd (s2) to [~objectdata v]\nadd (name) to [@activeobjects v]\nadd (name) to [@objectid v]\nadd [6] to [~layertype v]\nadd [1] to [@renderstate v]\nadd [1] to [@renderpriority v]\n\ndefine Move line name: (name) x1: (x1) y1: (y1) z1: (z1) x2: (x2) y2: (y2) z2: (z2)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    replace item ((item # of (name) in [~objectdata v]) + (1)) of [~objectdata v] with (x1)\n    replace item ((item # of (name) in [~objectdata v]) + (2)) of [~objectdata v] with (y1)\n    replace item ((item # of (name) in [~objectdata v]) + (3)) of [~objectdata v] with (z1)\n    replace item ((item # of (name) in [~objectdata v]) + (4)) of [~objectdata v] with (x2)\n    replace item ((item # of (name) in [~objectdata v]) + (5)) of [~objectdata v] with (y2)\n    replace item ((item # of (name) in [~objectdata v]) + (6)) of [~objectdata v] with (z2)\nend\n\ndefine Scale line name: (name) size 1: (s1) size 2: (s2)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    replace item ((item # of (name) in [~objectdata v]) + (8)) of [~objectdata v] with (s1)\n    replace item ((item # of (name) in [~objectdata v]) + (9)) of [~objectdata v] with (s2)\nend\n\ndefine Change line/dot material name: (name) material: (material)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    if <(item ([ceiling v] of ((item # of (name) in [~objectdata v]) / (10)) ) of [~layertype v]) = [6]> then\n        replace item ((item # of (name) in [~objectdata v]) + (7)) of [~objectdata v] with (material)\n    else\n        replace item ((item # of (name) in [~objectdata v]) + (4)) of [~objectdata v] with (material)\n    end\nend\n\ndefine Rotate 3D sprite name: (name) rotation: (rotation)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    replace item ((item # of (name) in [~objectdata v]) + (5)) of [~objectdata v] with (rotation)\nend\n\ndefine Scale dot name: (name) size: (size)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    replace item ((item # of (name) in [~objectdata v]) + (5)) of [~objectdata v] with (size)\nend\n\ndefine Set costume to: (costume) for sprite: (name)\nreplace item (item # of (name) in [@activeobjects v]) of [@objectid v] with (costume)\n\ndefine Set text to: (text) for text ID: (id)\nreplace item (item # of (id) in [@activeobjects v]) of [@objectid v] with (text)\n\ndefine View Matrix\nset [vm1 v] to (((#CamCosY) * (#CamCosZ)) + (() - ((#CamSinX) * ((#CamSinY) * (#CamSinZ)))))\nset [vm2 v] to ((() - (#CamSinZ)) * (#CamCosX))\nset [vm3 v] to (((#CamSinX) * ((#CamCosY) * (#CamSinZ))) - ((() - (#CamSinY)) * (#CamCosZ)))\nset [vm4 v] to (((#CamSinX) * ((#CamSinY) * (#CamCosZ))) - ((#CamCosY) * (() - (#CamSinZ))))\nset [vm5 v] to ((#CamCosX) * (#CamCosZ))\nset [vm6 v] to (((#CamSinY) * (#CamSinZ)) + ((() - (#CamSinX)) * ((#CamCosY) * (#CamCosZ))))\nset [vm7 v] to ((#CamCosX) * (() - (#CamSinY)))\nset [vm9 v] to ((#CamCosX) * (#CamCosY))\n\ndefine Scale sprite: (name) size: (size)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    replace item ((item # of (name) in [~objectdata v]) + (4)) of [~objectdata v] with (size)\nend\n\ndefine Add Triangle Unit x1: (x1) y1: (y1) z1: (z1) x2: (x2) y2: (y2) z2: (z2) x3: (x3) y3: (y3) z3: (z3) material: (mat) name: (name)\nadd (name) to [~objectdata v]\nadd (x1) to [~objectdata v]\nadd (y1) to [~objectdata v]\nadd (z1) to [~objectdata v]\nadd (x2) to [~objectdata v]\nadd (y2) to [~objectdata v]\nadd (z2) to [~objectdata v]\nadd (x3) to [~objectdata v]\nadd (y3) to [~objectdata v]\nadd (z3) to [~objectdata v]\nadd (name) to [@activeobjects v]\nadd (mat) to [@objectid v]\nadd [7] to [~layertype v]\nadd [1] to [@renderstate v]\nadd [1] to [@renderpriority v]\n\ndefine Move Triangle Unit (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3) name: (name)\nif <((item # of (name) in [~objectdata v]) mod (10)) = [1]> then\n    replace item ((item # of (name) in [~objectdata v]) + (1)) of [~objectdata v] with (x1)\n    replace item ((item # of (name) in [~objectdata v]) + (2)) of [~objectdata v] with (y1)\n    replace item ((item # of (name) in [~objectdata v]) + (3)) of [~objectdata v] with (z1)\n    replace item ((item # of (name) in [~objectdata v]) + (4)) of [~objectdata v] with (x2)\n    replace item ((item # of (name) in [~objectdata v]) + (5)) of [~objectdata v] with (y2)\n    replace item ((item # of (name) in [~objectdata v]) + (6)) of [~objectdata v] with (z2)\n    replace item ((item # of (name) in [~objectdata v]) + (7)) of [~objectdata v] with (x3)\n    replace item ((item # of (name) in [~objectdata v]) + (8)) of [~objectdata v] with (y3)\n    replace item ((item # of (name) in [~objectdata v]) + (9)) of [~objectdata v] with (z3)\nend\n\ndefine Change Position (xyz) Speed (speed)\nif <(xyz) = [x]> then\n    change [🕹️playerx v] by (speed)\nelse\n    if <(xyz) = [y]> then\n        change [🕹️playery v] by (speed)\n    else\n        change [🕹️playerz v] by (speed)\n    end\nend\n📦 Player Colliding?\nrepeat until <(📦 Collision) = [0]>\n    if <(xyz) = [x]> then\n        set [~collidingx v] to [1]\n        change [🕹️playerx v] by ((<(speed) < [0]> * (2)) - (1))\n        set [~xacc v] to [0]\n    else\n        if <(xyz) = [y]> then\n            set [~collidingy v] to [1]\n            change [🕹️playery v] by ((<(speed) < [0]> * (2)) - (1))\n            set [~yacc v] to [0]\n            if <<key (space v) pressed?> and <(speed) < [0]>> then\n                start sound [action_jump v]\n                set [~yacc v] to [16]\n            end\n        else\n            set [~collidingz v] to [1]\n            change [🕹️playerz v] by ((<(speed) < [0]> * (2)) - (1))\n            set [~zacc v] to [0]\n        end\n    end\n    📦 Player Colliding?\nend\n\nwhen I receive [add cube v]\nAdd mesh: [Cube] name: [Test] x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10)) x rotation: [] y rotation: [] z rotation: [] x scale: (X Scale) y scale: (Y Scale) z scale: (Z Scale)\nSet custom material to: [Transparent] for mesh: [Test]\nAdd line name: [Line1] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line2] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line3] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line4] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line5] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line6] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line7] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line8] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line9] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line10] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line11] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nAdd line name: [Line12] x1: [] y1: [] z1: [] x2: [] y2: [] z2: [] material: [BLACK] size 1: [40] size 2: [40]\nrepeat until <(Active) = [0]>\n    Move object: [Test] to x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10))\n    Scale mesh: [Test] x scale: (X Scale) y scale: (Y Scale) z scale: (Z Scale)\n    Move line name: [Line1] x1: (((X) * (10)) + (X Scale)) y1: (((Y) * (10)) + (Y Scale)) z1: (((Z) * (10)) + (Z Scale)) x2: (((X) * (10)) + (X Scale)) y2: (((Y) * (10)) + (Y Scale)) z2: (((Z) * (10)) - (Z Scale))\n    Move line name: [Line2] x1: (((X) * (10)) - (X Scale)) y1: (((Y) * (10)) + (Y Scale)) z1: (((Z) * (10)) + (Z Scale)) x2: (((X) * (10)) - (X Scale)) y2: (((Y) * (10)) + (Y Scale)) z2: (((Z) * (10)) - (Z Scale))\n    Move line name: [Line3] x1: (((X) * (10)) + (X Scale)) y1: (((Y) * (10)) - (Y Scale)) z1: (((Z) * (10)) + (Z Scale)) x2: (((X) * (10)) + (X Scale)) y2: (((Y) * (10)) - (Y Scale)) z2: (((Z) * (10)) - (Z Scale))\n    Move line name: [Line4] x1: (((X) * (10)) - (X Scale)) y1: (((Y) * (10)) - (Y Scale)) z1: (((Z) * (10)) + (Z Scale)) x2: (((X) * (10)) - (X Scale)) y2: (((Y) * (10)) - (Y Scale)) z2: (((Z) * (10)) - (Z Scale))\n    Move line name: [Line5] x1: (((X) * (10)) + (X Scale)) y1: (((Y) * (10)) + (Y Scale)) z1: (((Z) * (10)) + (Z Scale)) x2: (((X) * (10)) - (X Scale)) y2: (((Y) * (10)) + (Y Scale)) z2: (((Z) * (10)) + (Z Scale))\n    Move line name: [Line6] x1: (((X) * (10)) - (X Scale)) y1: (((Y) * (10)) + (Y Scale)) z1: (((Z) * (10)) - (Z Scale)) x2: (((X) * (10)) + (X Scale)) y2: (((Y) * (10)) + (Y Scale)) z2: (((Z) * (10)) - (Z Scale))\n    Move line name: [Line7] x1: (((X) * (10)) + (X Scale)) y1: (((Y) * (10)) - (Y Scale)) z1: (((Z) * (10)) - (Z Scale)) x2: (((X) * (10)) - (X Scale)) y2: (((Y) * (10)) - (Y Scale)) z2: (((Z) * (10)) - (Z Scale))\n    Move line name: [Line8] x1: (((X) * (10)) - (X Scale)) y1: (((Y) * (10)) - (Y Scale)) z1: (((Z) * (10)) + (Z Scale)) x2: (((X) * (10)) + (X Scale)) y2: (((Y) * (10)) - (Y Scale)) z2: (((Z) * (10)) + (Z Scale))\n    Move line name: [Line9] x1: (((X) * (10)) - (X Scale)) y1: (((Y) * (10)) - (Y Scale)) z1: (((Z) * (10)) - (Z Scale)) x2: (((X) * (10)) - (X Scale)) y2: (((Y) * (10)) + (Y Scale)) z2: (((Z) * (10)) - (Z Scale))\n    Move line name: [Line10] x1: (((X) * (10)) - (X Scale)) y1: (((Y) * (10)) - (Y Scale)) z1: (((Z) * (10)) + (Z Scale)) x2: (((X) * (10)) - (X Scale)) y2: (((Y) * (10)) + (Y Scale)) z2: (((Z) * (10)) + (Z Scale))\n    Move line name: [Line11] x1: (((X) * (10)) + (X Scale)) y1: (((Y) * (10)) - (Y Scale)) z1: (((Z) * (10)) - (Z Scale)) x2: (((X) * (10)) + (X Scale)) y2: (((Y) * (10)) + (Y Scale)) z2: (((Z) * (10)) - (Z Scale))\n    Move line name: [Line12] x1: (((X) * (10)) + (X Scale)) y1: (((Y) * (10)) - (Y Scale)) z1: (((Z) * (10)) + (Z Scale)) x2: (((X) * (10)) + (X Scale)) y2: (((Y) * (10)) + (Y Scale)) z2: (((Z) * (10)) + (Z Scale))\nend\nUnload: [Line1]\nUnload: [Line2]\nUnload: [Line3]\nUnload: [Line4]\nUnload: [Line5]\nUnload: [Line6]\nUnload: [Line7]\nUnload: [Line8]\nUnload: [Line9]\nUnload: [Line10]\nUnload: [Line11]\nUnload: [Line12]\nUnload: [Test]\nif <(cancel) = [0]> then\n    📦 Create Hitbox (((X) * (10)) + (() - (X Scale))) (((Y) * (10)) + (() - (Y Scale))) (((Z) * (10)) + (() - (Z Scale))) (((X) * (10)) + (X Scale)) (((Y) * (10)) + (Y Scale)) (((Z) * (10)) + (Z Scale))\n    set [id v] to (pick random (1) to (1000))\n    Add mesh: [Cube] name: (join [Platform] (id)) x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10)) x rotation: [] y rotation: [] z rotation: [] x scale: (X Scale) y scale: (Y Scale) z scale: (Z Scale)\n    Set custom material to: (item (Material #) of [materials v]) for mesh: (join [Platform] (id))\nend\nif <(item (Material #) of [materials v]) = [Lava]> then\n    add ((length of [📦 hitboxes v]) / (6)) to [~lavahitboxes v]\nend\n\ndefine Set custom material to: (material) for mesh: (name)\nif <[@custommaterialid v] contains (item # of (name) in [@activeobjects v])?> then\n    replace item (item # of (item # of (name) in [@activeobjects v]) in [@custommaterialid v]) of [@custommaterial v] with (material)\nelse\n    add (material) to [@custommaterial v]\n    add (item # of (name) in [@activeobjects v]) to [@custommaterialid v]\nend\n\nwhen I receive [add sphere v]\nAdd mesh: [Sphere] name: [Test] x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10)) x rotation: [] y rotation: [] z rotation: [] x scale: (X Scale) y scale: (Y Scale) z scale: (Z Scale)\nAdd mesh: [Sphere] name: [Transparent Sphere] x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10)) x rotation: [] y rotation: [] z rotation: [] x scale: (X Scale) y scale: (Y Scale) z scale: (Z Scale)\nSet custom material to: [Black] for mesh: [Transparent Sphere]\nSet custom material to: [Transparent] for mesh: [Test]\nrepeat until <(Active) = [0]>\n    Move object: [Test] to x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10))\n    Scale mesh: [Test] x scale: (X Scale) y scale: (Y Scale) z scale: (Z Scale)\n    Move object: [Transparent Sphere] to x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10))\n    Scale mesh: [Transparent Sphere] x scale: ((X Scale) + (10)) y scale: ((Y Scale) + (10)) z scale: ((Z Scale) + (10))\nend\nUnload: [Test]\nUnload: [Transparent Sphere]\nif <(cancel) = [0]> then\n    📦 Create Hitbox (((X) * (10)) + (() - (X Scale))) (((Y) * (10)) + (() - (Y Scale))) (((Z) * (10)) + (() - (Z Scale))) (((X) * (10)) + (X Scale)) (((Y) * (10)) + (Y Scale)) (((Z) * (10)) + (Z Scale))\n    set [id v] to (pick random (1) to (1000))\n    Add mesh: [Sphere] name: (join [Sphere] (id)) x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10)) x rotation: [] y rotation: [] z rotation: [] x scale: (X Scale) y scale: (Y Scale) z scale: (Z Scale)\n    Set custom material to: (item (Material #) of [materials v]) for mesh: (join [Sphere] (id))\nend\nif <(item (Material #) of [materials v]) = [Lava]> then\n    add ((length of [📦 hitboxes v]) / (6)) to [~lavahitboxes v]\nend\n\nwhen I receive [add end flag v]\nAdd mesh: [flag] name: [fakeFlag] x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10)) x rotation: [] y rotation: [] z rotation: [] x scale: [] y scale: [] z scale: []\nSet custom material to: [Transparent] for mesh: [fakeFlag]\nrepeat until <(Active) = [0]>\n    Move object: [fakeFlag] to x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10))\n    Scale mesh: [fakeFlag] x scale: ((X Scale) / (1.6)) y scale: ((Y Scale) / (1.6)) z scale: ((Z Scale) / (1.6))\nend\nUnload: [fakeFlag]\nif <(cancel) = [0]> then\n    if <(~flagPlaced?) = [0]> then\n        Add mesh: [flag] name: [flag] x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10)) x rotation: [] y rotation: [] z rotation: [] x scale: ((X Scale) / (1.6)) y scale: ((Y Scale) / (1.6)) z scale: ((Z Scale) / (1.6))\n        set [~flagplaced? v] to [1]\n    else\n        Move object: [flag] to x: ((X) * (10)) y: ((Y) * (10)) z: ((Z) * (10))\n        Scale mesh: [Flag] x scale: ((X Scale) / (1.6)) y scale: ((Y Scale) / (1.6)) z scale: ((Z Scale) / (1.6))\n    end\nend\n\nwhen I receive [death v]\nstart sound [roblox-death-sound_1 v]\nReset Camera\n\nwhen I receive [clear2 v]\ndelete all of [📦 hitboxes v]\ndelete all of [~lavahitboxes v]\nset [~flagplaced? v] to [0]\ndelete all of [@activeobjects v]\nReset Camera\nAdd Objects\n\nwhen flag clicked\nreplace item (1) of [~cool v] with [0]\n\nwhen I receive [hide v]\nstop all sounds\n\nwhen I receive [play mode v]\nReset Camera\n\nwhen I receive [init v]\nif <(Mode) = [0]> then\n    Reset Camera\nend\n\nrepeat (3)\nend\n\n@Objects\n\ndefine Load mesh: (name) data: (data)\nchange [~numberofmeshes v] by (1)\nLoad (data)\nadd ((Verts) + (item ((~numberOfMeshes) - (1)) of [~vertcount v])) to [~vertcount v]\nadd ((Faces) + (item ((~numberOfMeshes) - (1)) of [~facecount v])) to [~facecount v]\nadd ((Normals) + (item ((~numberOfMeshes) - (1)) of [~normalcount v])) to [~normalcount v]\nadd (Faces) to [~facecount2 v]\nadd (Verts) to [~vertcount2 v]\nadd (name) to [~meshes v]\n\ndefine Load (data)\nset [normals v] to [0]\nset [faces v] to [0]\nset [verts v] to [0]\nset [text v] to []\nreplace item (1) of [~cool v] with [0]\nreplace item (2) of [~cool v] with [0]\nreplace item (3) of [~cool v] with [0]\nreplace item (4) of [~cool v] with [0]\nfor each [i v] in ((length of (data)) + (1))\n    if <<<(letter (i) of (data)) = [ ]> or <(letter (i) of (data)) = [/]>> or <(letter (i) of (data)) = []>> then\n        if <(Text) = [v]> then\n            replace item (1) of [~cool v] with [4]\n            change [verts v] by (1)\n        else\n            if <[0] < (item (1) of [~cool v])> then\n                add (Text) to [~verts v]\n            else\n                if <(Text) = [f]> then\n                    replace item (2) of [~cool v] with [10]\n                    add (Material) to [~trimaterial v]\n                    change [faces v] by (1)\n                else\n                    if <<<(item (2) of [~cool v]) = [9]> or <(item (2) of [~cool v]) = [6]>> or <(item (2) of [~cool v]) = [3]>> then\n                        add (Text) to [~face v]\n                    else\n                        if <<<(item (2) of [~cool v]) = [7]> or <(item (2) of [~cool v]) = [4]>> or <(item (2) of [~cool v]) = [1]>> then\n                            add (Text) to [~meshnormalpointer v]\n                        else\n                            if <(Text) = [vn]> then\n                                replace item (3) of [~cool v] with [4]\n                            else\n                                if <[0] < (item (3) of [~cool v])> then\n                                    change [normals v] by (1)\n                                    add (Text) to [~normal v]\n                                else\n                                    if <(Text) = [usemtl]> then\n                                        replace item (4) of [~cool v] with [2]\n                                    else\n                                        if <[0] < (item (4) of [~cool v])> then\n                                            set [material v] to (Text)\n                                            add (Text) to [~materials v]\n                                            add ((((255) * (16777216)) + ((pick random (1) to (255)) * (65536))) + (((pick random (1) to (255)) * (256)) + (pick random (1) to (255)))) to [~materialcolor v]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        set [text v] to []\n        replace item (1) of [~cool v] with ((item (1) of [~cool v]) - (1))\n        replace item (2) of [~cool v] with ((item (2) of [~cool v]) - (1))\n        replace item (3) of [~cool v] with ((item (3) of [~cool v]) - (1))\n        replace item (4) of [~cool v] with ((item (4) of [~cool v]) - (1))\n    else\n        set [text v] to (join (Text) (letter (i) of (data)))\n    end\nend\n\ndefine Clear\nset [~numberofmeshes v] to [0]\ndelete all of [~meshnormalpointer v]\ndelete all of [@custommaterialid v]\ndelete all of [@custommaterial v]\ndelete all of [@renderpriority v]\ndelete all of [~normalcount v]\ndelete all of [@renderstate v]\ndelete all of [~facecount2 v]\ndelete all of [~vertcount2 v]\ndelete all of [~objectdata v]\ndelete all of [~facecount v]\ndelete all of [~trimaterial v]\ndelete all of [~layertype v]\ndelete all of [~vertcount v]\ndelete all of [~materials v]\ndelete all of [@objectid v]\ndelete all of [~meshes v]\ndelete all of [~spriteid v]\ndelete all of [~materialcolor v]\ndelete all of [~normal v]\ndelete all of [~verts v]\ndelete all of [~face v]\n\nwhen I receive [clear v]\nClear\nLoad Objects\nMy Materials\nbroadcast (Clear2 v) and wait\n\ndefine Load Objects\nLoad mesh: [Sphere] data: (item (1) of [#obj. v])\nLoad mesh: [Cube] data: (item (2) of [#obj. v])\nLoad mesh: [Flag] data: [# Blender v2.93.3 OBJ File: '' # www.blender.org mtllib Flag.mtl o Cylinder v 0.000000 -0.098269 -0.100000 v 0.000000 7.901731 -0.100000 v 0.086603 -0.098269 0.050000 v 0.086603 7.901731 0.050000 v -0.086603 -0.098269 0.050000 v -0.086603 7.901731 0.050000 vn 0.8660 0.0000 -0.5000 vn -0.0000 0.0000 1.0000 vn 0.0000 1.0000 0.0000 vn -0.8660 0.0000 -0.5000 vn 0.0000 -1.0000 0.0000 usemtl Gray s off f 2//1 3//1 1//1 f 4//2 5//2 3//2 f 4//3 2//3 6//3 f 6//4 1//4 5//4 f 1//5 3//5 5//5 f 2//1 4//1 3//1 f 4//2 6//2 5//2 f 6//4 2//4 1//4 o Cube_Cube.001 v 0.023164 5.698937 0.000000 v 0.023164 7.698937 0.000000 v 0.023164 5.698937 0.000000 v 0.023164 7.698937 0.000000 v 2.023164 6.698937 0.000000 vn 0.0000 0.0000 1.0000 vn 0.0000 0.0000 -1.0000 usemtl Red s off f 8//6 9//6 7//6 f 9//7 10//7 11//7 f 11//6 8//6 7//6 f 9//6 11//6 7//6 f 11//6 10//6 8//6 f 8//6 10//6 9//6]\n\ndefine My Materials\nSet material R: [150] G: [50] B: [50] A: [] name: [Player]\nSet material R: [50] G: [50] B: [150] A: [] name: [Cube]\nSet material R: [150] G: [150] B: [150] A: [150] name: [Transparent]\nSet material R: [50] G: [50] B: [150] A: [0] name: [Blue]\nSet material R: [150] G: [50] B: [50] A: [0] name: [Red]\nSet material R: [50] G: [150] B: [50] A: [0] name: [Green]\nSet material R: [0] G: [0] B: [0] A: [0] name: [Black]\nSet material R: [255] G: [255] B: [255] A: [0] name: [White]\nSet material R: [100] G: [100] B: [200] A: [] name: [Player]\nSet material R: [150] G: [150] B: [150] A: [] name: [Gray]\nSet material R: [160] G: [0] B: [255] A: [] name: [Purple]\nSet material R: [255] G: [130] B: [0] A: [] name: [Orange]\nSet material R: [255] G: [0] B: [144] A: [] name: [Pink]\nSet material R: [255] G: [255] B: [0] A: [] name: [Yellow]\nSet material R: [200] G: [200] B: [255] A: [210] name: [Glass]\nSet material R: [255] G: [0] B: [0] A: [] name: [Lava]\n\ndefine Set material R: (r) G: (g) B: (b) A: (a) name: (name)\nif <[~materials v] contains (name)?> then\n    replace item (item # of (name) in [~materials v]) of [~materialcolor v] with (((((256) - (a)) * (16777216)) + ((r) * (65536))) + (((g) * (256)) + (b)))\nelse\n    add (name) to [~materials v]\n    add (((((256) - (a)) * (16777216)) + ((r) * (65536))) + (((g) * (256)) + (b))) to [~materialcolor v]\nend\n\n@Audio\n\ndefine Play 3D Audio at x: (x) y: (y) z: (z) audio: (audio)\nset [~va v] to (audio)\nset [~vx v] to (x)\nset [~vy v] to (y)\nset [~vz v] to (z)\nset [~object v] to [null]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [~va v] to (~vA)\nset [~vx v] to (~vX)\nset [~vy v] to (~vY)\nset [~vz v] to (~vZ)\nset [~object v] to (~object)\nset volume to ((100) * ((100) / ([sqrt v] of (((((~vX) - (@CameraX)) * ((~vX) - (@CameraX))) + (((~vY) - (@CameraY)) * ((~vY) - (@CameraY)))) + (((~vZ) - (@CameraZ)) * ((~vZ) - (@CameraZ)))) ))) %\nset [pan left/right v] effect to (((((~vX) - (@CameraX)) * (vm1)) + ((((~vY) - (@CameraY)) * (vm2)) + (((~vZ) - (@CameraZ)) * (vm3)))) * ((volume) / (100)))\nplay sound (~vA) until done\ndelete this clone\n\nwhen I start as a clone\nif <[~objectdata v] contains (~object)?> then\n    forever\n        set [~vx v] to (item ((item # of (~object) in [~objectdata v]) + (1)) of [~objectdata v])\n        set [~vy v] to (item ((item # of (~object) in [~objectdata v]) + (2)) of [~objectdata v])\n        set [~vz v] to (item ((item # of (~object) in [~objectdata v]) + (3)) of [~objectdata v])\n        set volume to ((100) * ((100) / ([sqrt v] of (((((~vX) - (@CameraX)) * ((~vX) - (@CameraX))) + (((~vY) - (@CameraY)) * ((~vY) - (@CameraY)))) + (((~vZ) - (@CameraZ)) * ((~vZ) - (@CameraZ)))) ))) %\n        set [pan left/right v] effect to (((((~vX) - (@CameraX)) * (vm1)) + ((((~vY) - (@CameraY)) * (vm2)) + (((~vZ) - (@CameraZ)) * (vm3)))) * ((volume) / (100)))\n    end\nelse\n    forever\n        set volume to ((100) * ((100) / ([sqrt v] of (((((~vX) - (@CameraX)) * ((~vX) - (@CameraX))) + (((~vY) - (@CameraY)) * ((~vY) - (@CameraY)))) + (((~vZ) - (@CameraZ)) * ((~vZ) - (@CameraZ)))) ))) %\n        set [pan left/right v] effect to (((((~vX) - (@CameraX)) * (vm1)) + ((((~vY) - (@CameraY)) * (vm2)) + (((~vZ) - (@CameraZ)) * (vm3)))) * ((volume) / (100)))\n    end\nend\n\ndefine Play 3D Audio at object name: (name) audio: (audio)\nset [~va v] to (audio)\nset [~object v] to (name)\ncreate clone of (_myself_ v)\nset [~object v] to [null]\n\n@Skybox\n\nwhen I receive [tick v]\nset [~height v] to ((((vm6) + (.000001)) / ((vm9) + (.000001))) * (fov))\nset [~skyboxwidth v] to [480]\nSkybox ((((@CameraRotateY) * ((fov) * (.018611))) mod ((~skyboxWidth) * (1.675))) - ((~skyboxWidth) * (1.675))) (~height)\nSkybox (((@CameraRotateY) * ((fov) * (.018611))) mod ((~skyboxWidth) * (1.675))) (~height)\nif <[0] < (@CameraRotateX)> then\n    switch backdrop to (backdrop4 v)\nelse\n    switch backdrop to (backdrop3 v)\nend\nswitch costume to (icon v)\n\ndefine Skybox (x) (y)\nswitch costume to (blank v)\nset size to ((1) / ()) %\ngo to x: (x) y: (y)\nswitch costume to (blank v)\nset size to (168) %\nswitch costume to (skybox v)\nstamp\n\n@Add Cube\n\nwhen this sprite clicked\nif <(mode) = [2]> then\n    if <(Active) = [0]> then\n        set [mode v] to [1]\n        broadcast (Add Cube v)\n        switch costume to (finish v)\n        show variable [x v]\n        show variable [y v]\n        show variable [z v]\n        show variable [x scale v]\n        show variable [y scale v]\n        show variable [z scale v]\n        show variable [material # v]\n        hide list [materials v]\n        set [active v] to [1]\n    end\nelse\n    set [mode v] to [2]\n    switch costume to (add v)\n    hide variable [x v]\n    hide variable [y v]\n    hide variable [z v]\n    hide variable [x scale v]\n    hide variable [y scale v]\n    hide variable [z scale v]\n    hide variable [material # v]\n    show list [materials v]\n    set [active v] to [0]\nend\n\nwhen I receive [cancel v]\nset [mode v] to [2]\nswitch costume to (add v)\nhide variable [x v]\nhide variable [y v]\nhide variable [z v]\nhide variable [x scale v]\nhide variable [y scale v]\nhide variable [z scale v]\nhide variable [material # v]\nshow list [materials v]\nset [active v] to [0]\n\nwhen I receive [clear v]\nset [active v] to [0]\nset [mode v] to [2]\nswitch costume to (add v)\nset [material # v] to [1]\nhide variable [x v]\nhide variable [y v]\nhide variable [z v]\nhide variable [x scale v]\nhide variable [y scale v]\nhide variable [z scale v]\nhide variable [material # v]\nshow list [materials v]\nset [active v] to [0]\n\nwhen I receive [tick v]\nif <(Mode) = [1]> then\n    show\nelse\n    hide\nend\n\n@Add Sphere\n\nwhen this sprite clicked\nif <(mode) = [2]> then\n    if <(Active) = [0]> then\n        set [mode v] to [1]\n        broadcast (Add Sphere v)\n        switch costume to (finish v)\n        show variable [x v]\n        show variable [y v]\n        show variable [z v]\n        set [x scale v] to [50]\n        set [y scale v] to [50]\n        set [z scale v] to [50]\n        show variable [x scale v]\n        show variable [y scale v]\n        show variable [z scale v]\n        show variable [material # v]\n        hide list [materials v]\n        set [active v] to [1]\n    end\nelse\n    set [mode v] to [2]\n    switch costume to (add v)\n    hide variable [x v]\n    hide variable [y v]\n    hide variable [z v]\n    hide variable [x scale v]\n    hide variable [y scale v]\n    hide variable [z scale v]\n    hide variable [material # v]\n    show list [materials v]\n    set [active v] to [0]\nend\n\nwhen I receive [cancel v]\nset [mode v] to [2]\nswitch costume to (add v)\nhide variable [x v]\nhide variable [y v]\nhide variable [z v]\nhide variable [x scale v]\nhide variable [y scale v]\nhide variable [z scale v]\nhide variable [material # v]\nshow list [materials v]\nset [active v] to [0]\n\nwhen I receive [clear v]\nswitch costume to (add v)\nset [x v] to [25]\nset [y v] to [0]\nset [z v] to [0]\nset [x scale v] to [50]\nset [y scale v] to [50]\nset [z scale v] to [50]\n\nwhen I receive [tick v]\nif <(Mode) = [1]> then\n    show\nelse\n    hide\nend\n\n@Add End Flag\n\nwhen this sprite clicked\nif <(mode) = [2]> then\n    if <(Active) = [0]> then\n        set [mode v] to [1]\n        broadcast (Add End Flag v)\n        switch costume to (finish v)\n        set [x v] to [0]\n        set [y v] to [5]\n        set [z v] to [0]\n        set [x scale v] to [50]\n        set [y scale v] to [50]\n        set [z scale v] to [50]\n        show variable [x v]\n        show variable [y v]\n        show variable [z v]\n        set [active v] to [1]\n    end\nelse\n    set [mode v] to [2]\n    switch costume to (add v)\n    hide variable [x v]\n    hide variable [y v]\n    hide variable [z v]\n    hide variable [x scale v]\n    hide variable [y scale v]\n    hide variable [z scale v]\n    hide variable [material # v]\n    show list [materials v]\n    set [active v] to [0]\nend\n\nwhen I receive [cancel v]\nset [mode v] to [2]\nswitch costume to (add v)\nhide variable [x v]\nhide variable [y v]\nhide variable [z v]\nhide variable [x scale v]\nhide variable [y scale v]\nhide variable [z scale v]\nhide variable [material # v]\nshow list [materials v]\nset [active v] to [0]\n\nwhen I receive [clear v]\nswitch costume to (add v)\nset [mode v] to [2]\n\nwhen I receive [tick v]\nif <(Mode) = [1]> then\n    show\nelse\n    hide\nend\n\n@Cancel\n\nwhen this sprite clicked\nchange [cancel v] by (1)\nset [active v] to [0]\nset [cancel v] to [1]\nbroadcast (Cancel v)\n\nwhen I receive [tick v]\nif <(Active) = [1]> then\n    set [cancel v] to [0]\n    show\nelse\n    hide\nend\n\nwhen I receive [clear v]\nset [cancel v] to [0]\n\n@Back\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen I receive [death v]\nclear graphic effects\n\nwhen I receive [tick v]\nchange [ghost v] effect by ((#Deltatime) * (100))\n\nwhen I receive [victory! v]\nset [ghost v] effect to (100)\n\nwhen I receive [hide v]\nset [ghost v] effect to (100)\n\n@X To Reset\n\nwhen this sprite clicked\nnext costume\n\nwhen [x v] key pressed\nif <<(costume [number v]) = [2]> and <(Active) = [0]>> then\n    broadcast (Clear v)\n    switch costume to (costume3 v)\nend\n\nwhen I receive [tick v]\nif <(Mode) = [1]> then\n    show\nelse\n    hide\nend\n\n@You Won\n\nwhen flag clicked\nhide\n\nwhen I receive [victory! v]\nshow\n\nwhen this sprite clicked\nbroadcast (Death v)\nbroadcast (Hide v)\nhide\n\n@Play\n\nwhen this sprite clicked\nset [mode v] to <(Mode) = [0]>\nswitch costume to ((Mode) + (1))\nif <(Mode) = [0]> then\n    broadcast (Play Mode v)\n    replace item (1) of [~cool v] with (timer)\nelse\n    clear graphic effects\nend\n\nwhen I receive [tick v]\nif <<(Mode) = [0]> and <[3] < ((timer) - (item (1) of [~cool v]))>> then\n    change [ghost v] effect by (10)\nend\n\nwhen [e v] key pressed\nset [mode v] to <(Mode) = [0]>\nswitch costume to ((Mode) + (1))\nif <(Mode) = [0]> then\n    broadcast (Play Mode v)\n    replace item (1) of [~cool v] with (timer)\nelse\n    clear graphic effects\nend\n\nwhen flag clicked\nif <(Mode) = [0]> then\n    set [ghost v] effect to (100)\nelse\n    clear graphic effects\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\n