~~Arctic~~3D~~Platformer   #Games #All

Instructions: https://scratch.mit.edu/projects/429975103/ New 3D game!\nWASD to move\nArrow keys to change perspective\nSpace to jump\nPeople, if you like this, Follow, cause I make a lot of 3D\nI am planning on trying to make a planet game, that you can go around the entire planet\n\n\n\n\nMass reported: 3 times\n\nCredits\n@Popuiar for list sorting\n@-RISEN- for tri sensing\n@TheLogFather for tri fill\n\n\n#Games #Games!

@Stage\n\n@Sprite1\n\n@engine\n\ndefine Draw letter (letter) at x (x) y (y) Size (s)\ngo to x: (x) y: (y)\nset pen size to ((3) * (s))\nif <[a] = (letter)> then\n    pen down\n    go to x: (((5) * (s)) + (x position)) y: (((20) * (s)) + (y position))\n    go to x: (((5) * (s)) + (x position)) y: ((y position) - ((20) * (s)))\n    go to x: (((-2) * (s)) + (x position)) y: (((7) * (s)) + (y position))\n    change x by ((-5) * (s))\n    pen up\nend\nif <[b] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change y by ((-20) * (s))\n    change x by ((10) * (s))\n    change y by ((9) * (s))\n    change x by ((-10) * (s))\n    change y by ((2) * (s))\n    change x by ((7) * (s))\n    change y by ((9) * (s))\n    change x by ((-7) * (s))\n    pen up\nend\nif <[c] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change y by ((-20) * (s))\n    change x by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((20) * (s))\n    change x by ((10) * (s))\n    pen up\nend\nif <[d] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change x by ((8) * (s))\n    go to x: (((2) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    change y by ((-10) * (s))\n    go to x: (((-2) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    change x by ((-8) * (s))\n    pen up\nend\nif <[e] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change y by ((-20) * (s))\n    change x by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((10) * (s))\n    change x by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((10) * (s))\n    change x by ((10) * (s))\n    change x by ((-10) * (s))\n    pen up\nend\nif <[f] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change y by ((-20) * (s))\n    change y by ((10) * (s))\n    change x by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((10) * (s))\n    change x by ((10) * (s))\n    change x by ((-10) * (s))\n    pen up\nend\nif <[g] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change y by ((-20) * (s))\n    change x by ((7) * (s))\n    change y by ((5) * (s))\n    change x by ((-2) * (s))\n    change x by ((4) * (s))\n    change x by ((-2) * (s))\n    change y by ((-5) * (s))\n    change x by ((-7) * (s))\n    change y by ((20) * (s))\n    change x by ((7) * (s))\n    pen up\nend\nif <[h] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change y by ((-10) * (s))\n    change x by ((10) * (s))\n    change y by ((10) * (s))\n    change y by ((-20) * (s))\n    pen up\nend\nif <[i] = (letter)> then\n    change x by ((5) * (s))\n    pen down\n    change y by ((20) * (s))\n    change x by ((5) * (s))\n    change x by ((-10) * (s))\n    change x by ((5) * (s))\n    change y by ((-20) * (s))\n    change x by ((5) * (s))\n    change x by ((-10) * (s))\n    change x by ((5) * (s))\n    pen up\nend\nif <[j] = (letter)> then\n    pen down\n    change y by ((10) * (s))\n    change y by ((-10) * (s))\n    change x by ((5) * (s))\n    change y by ((20) * (s))\n    change x by ((-5) * (s))\n    change x by ((10) * (s))\n    pen up\nend\nif <[k] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change y by ((-10) * (s))\n    go to x: (((10) * (s)) + (x position)) y: (((-10) * (s)) + (y position))\n    go to x: (((-10) * (s)) + (x position)) y: (((10) * (s)) + (y position))\n    go to x: (((10) * (s)) + (x position)) y: (((10) * (s)) + (y position))\n    pen up\nend\nif <[l] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change y by ((-20) * (s))\n    change x by ((10) * (s))\n    pen up\nend\nif <[m] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    go to x: (((5) * (s)) + (x position)) y: (((-10) * (s)) + (y position))\n    go to x: (((5) * (s)) + (x position)) y: (((10) * (s)) + (y position))\n    change y by ((-20) * (s))\n    pen up\nend\nif <[n] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    go to x: (((10) * (s)) + (x position)) y: (((-20) * (s)) + (y position))\n    change y by ((20) * (s))\n    pen up\nend\nif <[o] = (letter)> then\n    change y by ((5) * (s))\n    pen down\n    change y by ((10) * (s))\n    go to x: (((2) * (s)) + (x position)) y: (((5) * (s)) + (y position))\n    change x by ((6) * (s))\n    go to x: (((2) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    change y by ((-10) * (s))\n    go to x: (((-2) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    change x by ((-6) * (s))\n    go to x: (((-2) * (s)) + (x position)) y: (((5) * (s)) + (y position))\n    pen up\nend\nif <[p] = (letter)> then\n    pen down\n    change y by ((15) * (s))\n    go to x: (((2) * (s)) + (x position)) y: (((5) * (s)) + (y position))\n    change x by ((6) * (s))\n    go to x: (((2) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    change y by ((-1) * (s))\n    go to x: (((-2) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    change x by ((-6) * (s))\n    go to x: (((-2) * (s)) + (x position)) y: (((5) * (s)) + (y position))\n    pen up\nend\nif <[q] = (letter)> then\n    change y by ((5) * (s))\n    pen down\n    change y by ((10) * (s))\n    go to x: ((2) + (x position)) y: (((5) * (s)) + (y position))\n    change x by ((6) * (s))\n    go to x: ((2) + (x position)) y: (((-5) * (s)) + (y position))\n    change y by ((-10) * (s))\n    go to x: ((-2) + (x position)) y: ((-5) + (y position))\n    change x by ((-6) * (s))\n    go to x: ((-2) + (x position)) y: (((5) * (s)) + (y position))\n    pen up\n    change x by ((6) * (s))\n    pen down\n    go to x: (((5) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    pen up\nend\nif <[r] = (letter)> then\n    pen down\n    change y by ((15) * (s))\n    go to x: (((2) * (s)) + (x position)) y: (((5) * (s)) + (y position))\n    change x by ((6) * (s))\n    go to x: (((2) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    change y by ((-1) * (s))\n    go to x: (((-2) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    change x by ((-6) * (s))\n    go to x: (((-2) * (s)) + (x position)) y: (((5) * (s)) + (y position))\n    change y by ((-3) * (s))\n    go to x: (((10) * (s)) + (x position)) y: (((-11) * (s)) + (y position))\n    pen up\nend\nif <[s] = (letter)> then\n    pen down\n    change y by ((2) * (s))\n    change y by ((-2) * (s))\n    change x by ((10) * (s))\n    change y by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((10) * (s))\n    change x by ((10) * (s))\n    change y by ((-2) * (s))\n    change y by ((2) * (s))\n    pen up\nend\nif <[t] = (letter)> then\n    change x by ((5) * (s))\n    pen down\n    change y by ((20) * (s))\n    change x by ((5) * (s))\n    change x by ((-10) * (s))\n    pen up\nend\nif <[u] = (letter)> then\n    change y by ((5) * (s))\n    pen down\n    change y by ((15) * (s))\n    pen up\n    change x by ((10) * (s))\n    pen down\n    change y by ((-15) * (s))\n    go to x: (((-2) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    change x by ((-6) * (s))\n    go to x: (((-2) * (s)) + (x position)) y: (((5) * (s)) + (y position))\n    pen up\n    change x by ((10) * (s))\n    pen down\n    change y by ((-5) * (s))\n    pen up\nend\nif <[v] = (letter)> then\n    change y by ((20) * (s))\n    pen down\n    go to x: (((5) * (s)) + (x position)) y: (((-20) * (s)) + (y position))\n    go to x: (((5) * (s)) + (x position)) y: (((20) * (s)) + (y position))\n    pen up\nend\nif <[w] = (letter)> then\n    change y by ((20) * (s))\n    pen down\n    go to x: (((2.5) * (s)) + (x position)) y: (((-20) * (s)) + (y position))\n    go to x: (((2.5) * (s)) + (x position)) y: (((20) * (s)) + (y position))\n    go to x: (((2.5) * (s)) + (x position)) y: (((-20) * (s)) + (y position))\n    go to x: (((2.5) * (s)) + (x position)) y: (((20) * (s)) + (y position))\n    pen up\nend\nif <[x] = (letter)> then\n    change y by ((20) * (s))\n    pen down\n    go to x: (((10) * (s)) + (x position)) y: (((-20) * (s)) + (y position))\n    pen up\n    change x by ((-10) * (s))\n    pen down\n    go to x: (((10) * (s)) + (x position)) y: (((20) * (s)) + (y position))\n    pen up\nend\nif <[y] = (letter)> then\n    change x by ((5) * (s))\n    pen down\n    change y by ((10) * (s))\n    go to x: (((5) * (s)) + (x position)) y: (((10) * (s)) + (y position))\n    go to x: (((-5) * (s)) + (x position)) y: (((-10) * (s)) + (y position))\n    go to x: (((-5) * (s)) + (x position)) y: (((10) * (s)) + (y position))\n    pen up\nend\nif <[z] = (letter)> then\n    pen down\n    change x by ((10) * (s))\n    go to x: (((-10) * (s)) + (x position)) y: (((20) * (s)) + (y position))\n    change x by ((10) * (s))\n    pen up\nend\nif <[:] = (letter)> then\n    change x by ((5) * (s))\n    change y by ((5) * (s))\n    pen down\n    pen up\n    change y by ((10) * (s))\n    pen down\n    pen up\nend\nif <[1] = (letter)> then\n    change x by ((5) * (s))\n    pen down\n    change y by ((20) * (s))\n    go to x: (((-5) * (s)) + (x position)) y: (((-5) * (s)) + (y position))\n    pen up\nend\nif <[2] = (letter)> then\n    pen down\n    change x by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((10) * (s))\n    change x by ((10) * (s))\n    change y by ((10) * (s))\n    change x by ((-10) * (s))\n    pen up\nend\nif <[3] = (letter)> then\n    pen down\n    change x by ((10) * (s))\n    change y by ((10) * (s))\n    change x by ((-10) * (s))\n    change x by ((10) * (s))\n    change y by ((10) * (s))\n    change x by ((-10) * (s))\n    pen up\nend\nif <[4] = (letter)> then\n    change x by ((10) * (s))\n    pen down\n    change y by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((10) * (s))\n    change y by ((-10) * (s))\n    change x by ((10) * (s))\n    change y by ((10) * (s))\n    pen up\nend\nif <[5] = (letter)> then\n    pen down\n    change x by ((10) * (s))\n    change y by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((10) * (s))\n    change x by ((10) * (s))\n    pen up\nend\nif <[6] = (letter)> then\n    pen down\n    change x by ((10) * (s))\n    change y by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((-10) * (s))\n    change y by ((20) * (s))\n    pen up\nend\nif <[7] = (letter)> then\n    change y by ((20) * (s))\n    pen down\n    change x by ((10) * (s))\n    change y by ((-20) * (s))\n    pen up\nend\nif <[8] = (letter)> then\n    pen down\n    change x by ((10) * (s))\n    change y by ((10) * (s))\n    change x by ((-10) * (s))\n    change y by ((-10) * (s))\n    change y by ((20) * (s))\n    change x by ((10) * (s))\n    change y by ((-10) * (s))\n    pen up\nend\nif <[9] = (letter)> then\n    change x by ((10) * (s))\n    pen down\n    change y by ((20) * (s))\n    change x by ((-10) * (s))\n    change y by ((-10) * (s))\n    change x by ((10) * (s))\n    pen up\nend\nif <[0] = (letter)> then\n    pen down\n    change y by ((20) * (s))\n    change x by ((10) * (s))\n    change y by ((-20) * (s))\n    change x by ((-10) * (s))\n    pen up\nend\nif <[/] = (letter)> then\n    pen down\n    go to x: (((10) * (s)) + (x position)) y: (((20) * (s)) + (y position))\n    pen up\nend\nif <[?] = (letter)> then\n    pen down\n    pen up\n    change y by ((5) * (s))\n    pen down\n    change y by ((7) * (s))\n    change x by ((5) * (s))\n    change y by ((8) * (s))\n    change x by ((-5) * (s))\n    pen up\nend\n\ndefine Phrase (p) starting at (x) (y) size: (s)\nset [x3 v] to (x)\nset [y3 v] to (y)\nset [letter v] to [0]\nrepeat (length of (p))\n    change [letter v] by (1)\n    Draw letter (letter (Letter) of (p)) at x (X3) y (Y3) Size (s)\n    change [x3 v] by ((15) * (s))\nend\n\ndefine XY Clipping\nset [m v] to (((y2) - (y1)) / ((x2) - (x1)))\nif <(x1) > [240]> then\n    if <(x2) > [240]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: (240) ((y1) + (((240) - (x1)) * (m)))\n    end\nend\nif <(y1) > [180]> then\n    if <(y2) > [180]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: ((x1) + (((180) - (y1)) / (m))) (180)\n    end\nend\nif <(x1) < [-240]> then\n    if <(x2) < [-240]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: (-240) ((y1) + (((-240) - (x1)) * (m)))\n    end\nend\nif <(y1) < [-180]> then\n    if <(y2) < [-180]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: ((x1) + (((-180) - (y1)) / (m))) (-180)\n    end\nend\nif <(x2) > [240]> then\n    Set Screen Point 2: (240) ((y1) + (((240) - (x1)) * (m)))\nend\nif <(y2) > [180]> then\n    Set Screen Point 2: ((x1) + (((180) - (y1)) / (m))) (180)\nend\nif <(x2) < [-240]> then\n    Set Screen Point 2: (-240) ((y1) + (((-240) - (x1)) * (m)))\nend\nif <(y2) < [-180]> then\n    Set Screen Point 2: ((x1) + (((-180) - (y1)) / (m))) (-180)\nend\n\ndefine fill (ax) (ay) (bx) (by) (cx) (cy) resolution: (res)\nset [lena v] to ([sqrt v] of ((((bx) - (cx)) * ((bx) - (cx))) + (((by) - (cy)) * ((by) - (cy)))) )\nset [lenb v] to ([sqrt v] of ((((ax) - (cx)) * ((ax) - (cx))) + (((ay) - (cy)) * ((ay) - (cy)))) )\nset [lenc v] to ([sqrt v] of ((((ax) - (bx)) * ((ax) - (bx))) + (((ay) - (by)) * ((ay) - (by)))) )\nset [peri v] to ((1) / (((lena) + (lenb)) + (lenc)))\nset [incx v] to (((((lena) * (ax)) + ((lenb) * (bx))) + ((lenc) * (cx))) * (peri))\nset [incy v] to (((((lena) * (ay)) + ((lenb) * (by))) + ((lenc) * (cy))) * (peri))\nset [ind v] to ([sqrt v] of ((((((lenb) + (lenc)) - (lena)) * (((lenc) + (lena)) - (lenb))) * (((lena) + (lenb)) - (lenc))) * (peri)) )\nset [aox v] to ((incx) - (ax))\nset [aoy v] to ((incy) - (ay))\nset [box v] to ((incx) - (bx))\nset [boy v] to ((incy) - (by))\nset [cox v] to ((incx) - (cx))\nset [coy v] to ((incy) - (cy))\nif <<(lena) < (lenb)> and <(lena) < (lenc)>> then\n    set [td v] to ([sqrt v] of (((Aox) * (Aox)) + ((Aoy) * (Aoy))) )\nelse\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\nend\nset [rate v] to ((((td) * (2)) - (ind)) / ((td) * (4)))\nset [td v] to ((1) + (0))\ngo to x: (round (incx)) y: (round (incy))\nset pen size to (ind)\npen down\nrepeat ([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))\nend\nset pen size to (res)\ngo to x: (ax) y: (ay)\ngo to x: (bx) y: (by)\ngo to x: (cx) y: (cy)\ngo to x: (ax) y: (ay)\npen up\n\ndefine Sort\nset [dummy variable v] to [0]\nrepeat (length of [distance info v])\n    change [dummy variable v] by (1)\n    if <(Dummy Variable) < [10]> then\n        set [dummy variable v] to (join [0] (Dummy Variable))\n    end\n    replace item (Dummy Variable) of [distance info v] with (((item (Dummy Variable) of [distance info v]) * (100)) + (Dummy Variable))\nend\nrepeat (length of [distance info v])\n    set [dummy variable v] to [0]\n    set [dummy 2 v] to [0]\n    repeat ((length of [distance info v]) - (1))\n        change [dummy variable v] by (1)\n        if <(item (Dummy Variable) of [distance info v]) < (item ((Dummy Variable) + (1)) of [distance info v])> then\n            set [dummy 2 v] to (item ((Dummy Variable) + (1)) of [distance info v])\n            replace item ((Dummy Variable) + (1)) of [distance info v] with (item (Dummy Variable) of [distance info v])\n            replace item (Dummy Variable) of [distance info v] with (Dummy 2)\n        end\n    end\nend\n\ndefine Draw tri: type (t) points: (x1) (y1) (z1) -- (x2) (y2) (z2) -- (x3) (y3) (z3) -- ()\nset pen size to (5)\nif <[ground] = (t)> then\n    set pen color to (#9aeff9)\nend\nif <[Shadow] = (t)> then\n    set pen color to (#000000)\nend\nif <[player] = (t)> then\n    set pen color to (#4cff00)\nend\nif <[lava] = (t)> then\n    set pen color to (#006aff)\nend\nif <[end] = (t)> then\n    set pen color to (#0019ff)\nend\nif <[bounce] = (t)> then\n    set pen color to (#ffe46e)\nend\n3d Tri (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3)\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 Draw Line (x1) (y1) (z1) to (x2) (y2) (z2)\nSet Point 1: ((x1) - (cam x)) ((y1) - (cam y)) ((z1) - (cam z))\nSet Point 2: ((x2) - (cam x)) ((y2) - (cam y)) ((z2) - (cam z))\nSet Point 1: (((z1) * (sin Y)) + ((x1) * (cos Y))) (y1) (((z1) * (cos Y)) - ((x1) * (sin Y)))\nSet Point 2: (((z2) * (sin Y)) + ((x2) * (cos Y))) (y2) (((z2) * (cos Y)) - ((x2) * (sin Y)))\nSet Point 1: (x1) (((y1) * (cos X)) - ((z1) * (sin X))) (((y1) * (sin X)) + ((z1) * (cos X)))\nSet Point 2: (x2) (((y2) * (cos X)) - ((z2) * (sin X))) (((y2) * (sin X)) + ((z2) * (cos X)))\nif <not <<(z1) < (near plane)> and <(z2) < (near plane)>>> then\n    Z Clipping\n    Set Screen Point 1: ((view factor) * ((x1) / (z1))) ((view factor) * ((y1) / (z1)))\n    Set Screen Point 2: ((view factor) * ((x2) / (z2))) ((view factor) * ((y2) / (z2)))\n    go to x: (x1) y: (y1)\n    pen down\n    go to x: (x2) y: (y2)\n    pen up\nend\n\ndefine Set Screen Point 1: (x1) (y1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\n\ndefine Set Screen Point 2: (x2) (y2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\n\ndefine Draw tri\nset pen size to (5)\nCalculate Trig Values\nset [loop v] to [0]\nrepeat (length of [distance info v])\n    change [loop v] by (1)\n    set [dummy 2 v] to (join (letter ((length of (item (Loop) of [distance info v])) - (1)) of (item (Loop) of [distance info v])) (letter (length of (item (Loop) of [distance info v])) of (item (Loop) of [distance info v])))\n    Draw tri: type (item (Dummy 2) of [types v]) points: (item (Dummy 2) of [x1 v]) (item (Dummy 2) of [y1 v]) (item (Dummy 2) of [z1 v]) -- (item (Dummy 2) of [x2 v]) (item (Dummy 2) of [y2 v]) (item (Dummy 2) of [z2 v]) -- (item (Dummy 2) of [x3 v]) (item (Dummy 2) of [y3 v]) (item (Dummy 2) of [z3 v]) -- (item (Dummy 2) of [-p direction v])\nend\n\ndefine Calculate Trig Values\nset [sin x v] to ([sin v] of (Rotation Y) )\nset [cos x v] to ([cos v] of (Rotation Y) )\nset [sin y v] to ([sin v] of (Rotation X) )\nset [cos y v] to ([cos v] of (Rotation X) )\n\ndefine Z Clipping\nif <<(z1) < (near plane)> or <(z2) < (near plane)>> then\n    set [percent v] to (((near plane) - (z1)) / ((z2) - (z1)))\n    if <(z1) < (near plane)> then\n        Set Point 1: ((x1) + (((x2) - (x1)) * (percent))) ((y1) + (((y2) - (y1)) * (percent))) (near plane)\n    else\n        if <(z2) < (near plane)> then\n            Set Point 2: ((x1) + (((x2) - (x1)) * (percent))) ((y1) + (((y2) - (y1)) * (percent))) (near plane)\n        end\n    end\nend\n\ndefine Get Level\ndelete all of [types v]\ndelete all of [x1 v]\ndelete all of [x2 v]\ndelete all of [x3 v]\ndelete all of [y1 v]\ndelete all of [y2 v]\ndelete all of [y3 v]\ndelete all of [z1 v]\ndelete all of [z2 v]\ndelete all of [z3 v]\ndelete all of [-p direction v]\ndelete all of [distance info v]\nAdd player\nif <[1] = (_Level)> then\n    Flat Square at [0] [-50] [0] [Ground]\n    Flat Square at [0] [25] [150] [Ground]\n    Flat Square at [0] [75] [300] [Ground]\n    add Spike at [0] [100] [350] []\n    add Spike at [30] [100] [350] []\n    add Spike at [-30] [100] [350] []\n    Flat Square at [0] [75] [400] [Ground]\n    Flat Square at [0] [75] [600] [end]\nend\nif <[2] = (_Level)> then\n    Flat Square at [0] [-50] [0] [Ground]\n    Flat Square at [0] [-25] [100] [Ground]\n    Flat Square at [100] [0] [100] [Ground]\n    Flat Square at [100] [25] [200] [bounce]\n    Flat Square at [100] [200] [200] [bounce]\n    Flat Square at [100] [150] [400] [Ground]\n    Flat Square at [100] [150] [600] [end]\nend\nif <[3] = (_Level)> then\n    Flat Square at [0] [-50] [0] [Ground]\n    Flat Square at [0] [50] [] [Ground]\n    Flat Square at [0] [150] [] [Ground]\n    Flat Square at [0] [250] [] [Ground]\n    Flat Square at [0] [250] [175] [bounce]\n    Flat Square at [0] [250] [350] [bounce]\n    Flat Square at [0] [250] [450] [end]\n    add Spike at [0] [275] [400] []\n    add Spike at [30] [275] [400] []\n    add Spike at [-30] [275] [400] []\n    add Spike at [0] [275] [500] []\n    add Spike at [30] [275] [500] []\n    add Spike at [-30] [275] [500] []\nend\nif <[4] = (_Level)> then\n    stop [other scripts in sprite v]\n    broadcast (End v)\n    stop [this script v]\nend\nset [__loop v] to (Player y)\nrepeat (40)\n    change [__loop v] by (-5)\n    Detect [1] (Player x) (__loop) (Player z)\n    if <[touching? v] contains [ground]?> then\n        Add Tri (((10) * (-last Cos y)) + (Player x)) (__loop) (((10) * (-last sine y)) + (Player z)) - (((-10) * (-last sine y)) + (Player x)) (__loop) (((10) * (-last Cos y)) + (Player z)) - (((-10) * (-last Cos y)) + (Player x)) (__loop) (((-10) * (-last sine y)) + (Player z)) -- [Shadow] []\n        stop [this script v]\n    end\n    if <[touching? v] contains [bounce]?> then\n        Add Tri (((10) * (-last Cos y)) + (Player x)) (__loop) (((10) * (-last sine y)) + (Player z)) - (((-10) * (-last sine y)) + (Player x)) (__loop) (((10) * (-last Cos y)) + (Player z)) - (((-10) * (-last Cos y)) + (Player x)) (__loop) (((-10) * (-last sine y)) + (Player z)) -- [Shadow] []\n        stop [this script v]\n    end\n    if <[touching? v] contains [end]?> then\n        Add Tri (((10) * (-last Cos y)) + (Player x)) (__loop) (((10) * (-last sine y)) + (Player z)) - (((-10) * (-last sine y)) + (Player x)) (__loop) (((10) * (-last Cos y)) + (Player z)) - (((-10) * (-last Cos y)) + (Player x)) (__loop) (((-10) * (-last sine y)) + (Player z)) -- [Shadow] []\n        stop [this script v]\n    end\nend\n\ndefine Add Tri (x1) (y1) (z1) - (x2) (y2) (z2) - (x3) (y3) (z3) -- (t) ()\nset [-d1 v] to (round ([sqrt v] of ((((x1) - (cam x)) * ((x1) - (cam x))) + ((((y1) - (cam y)) * ((y1) - (cam y))) + (((z1) - (cam z)) * ((z1) - (cam z))))) ))\nset [-d2 v] to (round ([sqrt v] of ((((x2) - (cam x)) * ((x2) - (cam x))) + ((((y2) - (cam y)) * ((y2) - (cam y))) + (((z2) - (cam z)) * ((z2) - (cam z))))) ))\nset [-d3 v] to (round ([sqrt v] of ((((x3) - (cam x)) * ((x3) - (cam x))) + ((((y3) - (cam y)) * ((y3) - (cam y))) + (((z3) - (cam z)) * ((z3) - (cam z))))) ))\nset [-dmax v] to [100000000000]\nset [-dloop v] to [1]\nset [-dmax v] to (-D1)\nset [-dmax v] to (round (((-D1) + ((-D2) + (-D3))) / (3)))\nif <(-Dmax) < [500]> then\n    add (t) to [types v]\n    add (x1) to [x1 v]\n    add (y1) to [y1 v]\n    add (z1) to [z1 v]\n    add (x2) to [x2 v]\n    add (y2) to [y2 v]\n    add (z2) to [z2 v]\n    add (x3) to [x3 v]\n    add (y3) to [y3 v]\n    add (z3) to [z3 v]\n    add () to [-p direction v]\n    add (-Dmax) to [distance info v]\nend\n\ndefine Reset\nset [cam x v] to ((Player x) + ((100) * (([cos v] of (Rotation Y) ) * ([sin v] of (Rotation X) ))))\nset [cam y v] to ((Player y) + ((100) * ((-1) * ([sin v] of (Rotation Y) ))))\nset [cam z v] to ((Player z) + ((((100) * ([cos v] of (Rotation X) )) * ([cos v] of (Rotation Y) )) * (-1)))\nset [cam speed v] to [1]\nset [rotation y v] to [-45]\nset [rotation x v] to [0]\nset [player x v] to [0]\nset [player y v] to [100]\nset [player z v] to [0]\nset [player x vel. v] to [0]\nset [player y vel. v] to [0]\nset [player z vel. v] to [0]\nset [_gravity v] to [1]\nset [___ v] to [n]\n\ndefine Sense (x) (y) (z) w (xl) (yl) (zl) Type (t)\nif <<<((Player z) + (15)) > ((z) - ((zl) / (2)))> and <((Player z) + (-15)) < ((z) + ((zl) / (2)))>> and <<<((Player y) + (15)) > ((y) - ((yl) / (2)))> and <((Player y) + (-15)) < ((y) + ((yl) / (2)))>> and <<((Player x) + (15)) > ((x) - ((xl) / (2)))> and <((Player x) + (-15)) < ((x) + ((xl) / (2)))>>>> then\n    add (t) to [touching? v]\nend\n\ndefine Detect (if) (x) (y) (z)\nif <[] = (if)> then\n    delete all of [touching? v]\n    set [loop v] to [1]\n    repeat (length of [types v])\n        # Collision - Sphere pos: (Player x) (Player y) (Player z) radius [ 13] Triangle (item (Loop) of [x1 v]) (item (Loop) of [y1 v]) (item (Loop) of [z1 v]) . (item (Loop) of [x2 v]) (item (Loop) of [y2 v]) (item (Loop) of [z2 v]) . (item (Loop) of [x3 v]) (item (Loop) of [y3 v]) (item (Loop) of [z3 v])\n        if <[1] = (~collisionResult)> then\n            add (item (Loop) of [types v]) to [touching? v]\n        end\n        change [loop v] by (1)\n    end\nelse\n    delete all of [touching? v]\n    set [loop v] to [1]\n    repeat (length of [types v])\n        # Collision - Sphere pos: (x) (y) (z) radius [7] Triangle (item (Loop) of [x1 v]) (item (Loop) of [y1 v]) (item (Loop) of [z1 v]) . (item (Loop) of [x2 v]) (item (Loop) of [y2 v]) (item (Loop) of [z2 v]) . (item (Loop) of [x3 v]) (item (Loop) of [y3 v]) (item (Loop) of [z3 v])\n        if <[1] = (~collisionResult)> then\n            add (item (Loop) of [types v]) to [touching? v]\n        end\n        change [loop v] by (1)\n    end\nend\n\ndefine Settings\nif <key (right arrow v) pressed?> then\n    change [rot y vel. v] by (-1)\nend\nif <key (left arrow v) pressed?> then\n    change [rot y vel. v] by (1)\nend\nif <key (up arrow v) pressed?> then\n    change [rot x vel. v] by (1)\nend\nif <key (down arrow v) pressed?> then\n    change [rot x vel. v] by (-1)\nend\nif <key (w v) pressed?> then\n    change [player z vel. v] by ((1) * ((cam speed) * (cos Y)))\nend\nif <key (s v) pressed?> then\n    change [player z vel. v] by ((-1) * ((cam speed) * (cos Y)))\nend\nif <key (a v) pressed?> then\n    change [player z vel. v] by ((-1) * ((cam speed) * (sin Y)))\nend\nif <key (d v) pressed?> then\n    change [player z vel. v] by ((1) * ((cam speed) * (sin Y)))\nend\nset [player z vel. v] to ((Player z vel.) * (0.8))\nset [rot x vel. v] to ((Rot x vel.) * (0.9))\nset [rot y vel. v] to ((Rot y vel.) * (0.9))\nchange [player z v] by (Player z vel.)\nchange [rotation y v] by (round (Rot x vel.))\nchange [rotation x v] by (round (Rot y vel.))\nif <(Rotation Y) < [-90]> then\n    set [rotation y v] to [-90]\nend\nif <[90] < (Rotation Y)> then\n    set [rotation y v] to [90]\nend\nDetect [] [] [] []\nif <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n    change [player y v] by (1)\n    Detect [] [] [] []\n    if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n        change [player y v] by (1)\n        Detect [] [] [] []\n        if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n            change [player y v] by (1)\n            Detect [] [] [] []\n            if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                change [player y v] by (1)\n                Detect [] [] [] []\n                if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                    change [player y v] by (1)\n                    Detect [] [] [] []\n                    if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                        change [player y v] by (1)\n                        Detect [] [] [] []\n                        if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                            change [player y v] by (1)\n                            Detect [] [] [] []\n                            if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                                change [player y v] by (1)\n                                Detect [] [] [] []\n                                if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                                    change [player y v] by (1)\n                                    Detect [] [] [] []\n                                    if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                                        change [player y v] by (1)\n                                        Detect [] [] [] []\n                                        if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                                            change [player y v] by (-10)\n                                            change [player z v] by ((Player z vel.) * (-1))\n                                            set [player z vel. v] to [0]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <key (w v) pressed?> then\n    change [player x vel. v] by ((-1) * ((cam speed) * (sin Y)))\nend\nif <key (s v) pressed?> then\n    change [player x vel. v] by ((1) * ((cam speed) * (sin Y)))\nend\nif <key (a v) pressed?> then\n    change [player x vel. v] by ((-1) * ((cam speed) * (cos Y)))\nend\nif <key (d v) pressed?> then\n    change [player x vel. v] by ((1) * ((cam speed) * (cos Y)))\nend\nset [player x vel. v] to ((Player x vel.) * (0.8))\nchange [player x v] by (Player x vel.)\nDetect [] [] [] []\nif <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n    change [player y v] by (1)\n    Detect [] [] [] []\n    if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n        change [player y v] by (1)\n        Detect [] [] [] []\n        if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n            change [player y v] by (1)\n            Detect [] [] [] []\n            if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                change [player y v] by (1)\n                Detect [] [] [] []\n                if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                    change [player y v] by (1)\n                    Detect [] [] [] []\n                    if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                        change [player y v] by (1)\n                        Detect [] [] [] []\n                        if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                            change [player y v] by (1)\n                            Detect [] [] [] []\n                            if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                                change [player y v] by (1)\n                                Detect [] [] [] []\n                                if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                                    change [player y v] by (1)\n                                    Detect [] [] [] []\n                                    if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                                        change [player y v] by (1)\n                                        Detect [] [] [] []\n                                        if <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n                                            change [player y v] by (-10)\n                                            change [player x v] by ((Player x vel.) * (-1))\n                                            set [player x vel. v] to [0]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nDetect [] [] [] []\nif <not <(Player y vel.) < [-20]>> then\n    change [player y vel. v] by (-1)\nend\nchange [player y v] by (Player y vel.)\nchange [_air? v] by (1)\nDetect [] [] [] []\nif <[touching? v] contains [lava]?> then\n    Reset\nend\nDetect [] [] [] []\nif <<[touching? v] contains [ground]?> or <[touching? v] contains [snow]?>> then\n    change [player y v] by ((-1) * (Player y vel.))\n    set [player y vel. v] to [0]\n    set [_air? v] to [0]\nend\nDetect [] [] [] []\nif <[touching? v] contains [snow]?> then\n    change [player y v] by (1)\nend\nif <key (space v) pressed?> then\n    if <(_air?) < [8]> then\n        set [player y vel. v] to [10]\n    end\nelse\n    change [_air? v] by (8)\nend\nDetect [] [] [] []\nif <[touching? v] contains [end]?> then\n    change [_level v] by (1)\n    Reset\nend\nif <[touching? v] contains [bounce]?> then\n    set [player y vel. v] to [20]\n    set [_air? v] to [0]\nend\nif <[touching? v] contains [front]?> then\n    set [player y vel. v] to [15]\n    set [player z vel. v] to [50]\n    set [_air? v] to [0]\nend\n\ndefine Get Point (x) (y) (z)\nSet Point 1: ((x) - (cam x)) ((y) - (cam y)) ((z) - (cam z))\nSet Point 1: (((z1) * (sin Y)) + ((x1) * (cos Y))) (y1) (((z1) * (cos Y)) - ((x1) * (sin Y)))\nSet Point 1: (x1) (((y1) * (cos X)) - ((z1) * (sin X))) (((y1) * (sin X)) + ((z1) * (cos X)))\nZ Clipping\nSet Screen Point 1: ((view factor) * ((x1) / (z1))) ((view factor) * ((y1) / (z1)))\n\ndefine Draw square (x) (y) (z) - (x2) (y2) (z2)\n3d Tri (x) (y) (z) (x2) (y2) (z2) (x2) (y) (z2)\nchange pen (brightness v) by (-20)\n3d Tri (x) (y) (z) (x2) (y2) (z2) (x) (y2) (z)\nchange pen (brightness v) by (20)\n\ndefine 3d Tri (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3)\ndelete all of [tri x v]\ndelete all of [tri y v]\ndelete all of [tri z v]\nGet Point (x1) (y1) (z1)\nadd (x1) to [tri x v]\nadd (y1) to [tri y v]\nadd (z1) to [tri z v]\nGet Point (x2) (y2) (z2)\nadd (x1) to [tri x v]\nadd (y1) to [tri y v]\nadd (z1) to [tri z v]\nGet Point (x3) (y3) (z3)\nadd (x1) to [tri x v]\nadd (y1) to [tri y v]\nadd (z1) to [tri z v]\nif <not <<(item (1) of [tri z v]) < (near plane)> and <<(item (2) of [tri z v]) < (near plane)> and <(item (3) of [tri z v]) < (near plane)>>>> then\n    if <not <[0] = (item (1) of [tri z v])>> then\n        if <not <[0] = (item (2) of [tri z v])>> then\n            if <not <[0] = (item (3) of [tri z v])>> then\n                fill (item (1) of [tri x v]) (item (1) of [tri y v]) (item (2) of [tri x v]) (item (2) of [tri y v]) (item (3) of [tri x v]) (item (3) of [tri y v]) resolution: (1)\n                set pen size to (5)\n                set pen color to (#000000)\n                Draw Line (x1) (y1) (z1) to (x2) (y2) (z2)\n                Draw Line (x1) (y1) (z1) to (x3) (y3) (z3)\n                Draw Line (x2) (y2) (z2) to (x3) (y3) (z3)\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nreset timer\nerase all\nset pen size to (2)\nset pen color to (#30cebd)\nReset\nReset\nset [_level v] to [1]\nforever\n    erase all\n    go to x: (0) y: (0)\n    set pen size to (600)\n    set pen color to (#248aff)\n    pen down\n    pen up\n    Detect [] [] [] []\n    Get Level\n    Sort\n    Draw tri\n    Settings\n    if <(Player y) < [-200]> then\n        Reset\n    end\n    set [cam x v] to ((Player x) + ((100) * (([cos v] of (Rotation Y) ) * ([sin v] of (Rotation X) ))))\n    set [cam y v] to ((Player y) + ((100) * (([sin v] of (Rotation Y) ) * (-1))))\n    set [cam z v] to ((Player z) + ((((100) * ([cos v] of (Rotation X) )) * ([cos v] of (Rotation Y) )) * (-1)))\n    if <[1] = (Wireframe?)> then\n        set [_ v] to [no]\n    else\n        set [_ v] to [yes]\n    end\n    if <[360] < (Rotation X)> then\n        change [rotation x v] by (-360)\n        change [-rot x p v] by (-360)\n    end\n    if <(Rotation X) < [-360]> then\n        change [rotation x v] by (360)\n        change [-rot x p v] by (360)\n    end\n    if <[2000] < (Player z)> then\n        broadcast (Point v)\n    end\n    if <(Player x) < [-400]> then\n        broadcast (hidden v)\n    end\n    Detect [] [] [] []\n    if <[touching? v] contains [lever]?> then\n        set pen color to (#000000)\n        Phrase [Press e] starting at [] [75] size: [1]\n    end\nend\n\nwhen I receive [end v]\nforever\n    erase all\n    go to x: (0) y: (0)\n    set pen color to (#00ffe5)\n    set pen size to (600)\n    pen down\n    pen up\n    set pen color to (#1000ff)\n    Phrase [The end] starting at [-200] ((([cos v] of (((timer) - (3)) * (200)) ) * (15)) - (25)) size: [4]\n    Phrase [thanks for playing] starting at [-200] ((([cos v] of (((timer) - (3)) * (100)) ) * (15)) - (75)) size: [1]\nend\n\ndefine # Collision - Sphere pos: (x) (y) (z) radius (r) Triangle (x1) (y1) (z1) . (x2) (y2) (z2) . (x3) (y3) (z3)\nset [~collisionresult v] to [0]\n# Get Max and Min (x1) (x2) (x3)\nset [col: tri x max v] to (#max)\nset [col: tri x min v] to (#min)\n# Get Max and Min (y1) (y2) (y3)\nset [col: tri y max v] to (#max)\nset [col: tri y min v] to (#min)\n# Get Max and Min (z1) (z2) (z3)\nset [col: tri z max v] to (#max)\nset [col: tri z min v] to (#min)\n# Get Plain Data with (x1) (y1) (z1) . (x2) (y2) (z2) . (x3) (y3) (z3)\nset [col: ~dot v] to ((((x) * (Col: plain function A)) + (((y) * (Col: plain function B)) + ((z) * (Col: plain function C)))) - (Col: plain function D))\nif <<((x) + (r)) > (Col: tri x min)> and <((x) - (r)) < (Col: tri x max)>> then\n    if <<((y) + (r)) > (Col: tri y min)> and <((y) - (r)) < (Col: tri y max)>> then\n        if <<((z) + (r)) > (Col: tri z min)> and <((z) - (r)) < (Col: tri z max)>> then\n            if <([abs v] of (Col: ~dot) ) < (r)> then\n                # Precise Collision Sphere (x) (y) (z) radius (r) To triangle (x1) (y1) (z1) . (x2) (y2) (z2) . (x3) (y3) (z3)\n            end\n        end\n    end\nend\n\ndefine # Precise Collision Sphere (x) (y) (z) radius (r) To triangle (x1) (y1) (z1) . (x2) (y2) (z2) . (x3) (y3) (z3)\nset [col: ~tempx v] to ((x) - ((Col: plain function A) * (Col: ~dot)))\nset [col: ~tempy v] to ((y) - ((Col: plain function B) * (Col: ~dot)))\nset [col: ~tempz v] to ((z) - ((Col: plain function C) * (Col: ~dot)))\nset [col: ~ax v] to ((x1) - (Col: ~tempX))\nset [col: ~ay v] to ((y1) - (Col: ~tempY))\nset [col: ~az v] to ((z1) - (Col: ~tempZ))\nset [col: ~bx v] to ((x2) - (Col: ~tempX))\nset [col: ~by v] to ((y2) - (Col: ~tempY))\nset [col: ~bz v] to ((z2) - (Col: ~tempZ))\nset [col: ~cx v] to ((x3) - (Col: ~tempX))\nset [col: ~cy v] to ((y3) - (Col: ~tempY))\nset [col: ~cz v] to ((z3) - (Col: ~tempZ))\nset [col: ~pbcx v] to (((Col: ~by) * (Col: ~cz)) - ((Col: ~bz) * (Col: ~cy)))\nset [col: ~pbcy v] to (((Col: ~bz) * (Col: ~cx)) - ((Col: ~bx) * (Col: ~cz)))\nset [col: ~pbcz v] to (((Col: ~bx) * (Col: ~cy)) - ((Col: ~by) * (Col: ~cx)))\nset [col: ~pcax v] to (((Col: ~cy) * (Col: ~az)) - ((Col: ~cz) * (Col: ~ay)))\nset [col: ~pcay v] to (((Col: ~cz) * (Col: ~ax)) - ((Col: ~cx) * (Col: ~az)))\nset [col: ~pcaz v] to (((Col: ~cx) * (Col: ~ay)) - ((Col: ~cy) * (Col: ~ax)))\nset [col: ~pabx v] to (((Col: ~ay) * (Col: ~bz)) - ((Col: ~az) * (Col: ~by)))\nset [col: ~paby v] to (((Col: ~az) * (Col: ~bx)) - ((Col: ~ax) * (Col: ~bz)))\nset [col: ~pabz v] to (((Col: ~ax) * (Col: ~by)) - ((Col: ~ay) * (Col: ~bx)))\nif <not <<(((Col: ~PbcX) * (Col: ~PcaX)) + (((Col: ~PbcY) * (Col: ~PcaY)) + ((Col: ~PbcZ) * (Col: ~PcaZ)))) < [0]> or <(((Col: ~PbcX) * (Col: ~PabX)) + (((Col: ~PbcY) * (Col: ~PabY)) + ((Col: ~PbcZ) * (Col: ~PabZ)))) < [0]>>> then\n    set [col: ~colx v] to (Col: ~tempX)\n    set [col: ~coly v] to (Col: ~tempY)\n    set [col: ~colz v] to (Col: ~tempZ)\n    change [col: ~tempx v] by (() - (x))\n    change [col: ~tempy v] by (() - (y))\n    change [col: ~tempz v] by (() - (z))\n    set [col: ~mag v] to ([sqrt v] of (((Col: ~tempX) * (Col: ~tempX)) + (((Col: ~tempY) * (Col: ~tempY)) + ((Col: ~tempZ) * (Col: ~tempZ)))) )\n    if <(Col: ~mag) < (r)> then\n        set [~collisionresult v] to [1]\n    end\n    stop [this script v]\nend\n# Closest Point To Line Segment p: (x) (y) (z) Line: (x1) (y1) (z1) | (x2) (y2) (z2)\nset [col: ~tempx v] to ((Col: ~returnX) - (x))\nset [col: ~tempy v] to ((Col: ~returnY) - (y))\nset [col: ~tempz v] to ((Col: ~returnZ) - (z))\nset [col: ~mag v] to ([sqrt v] of (((Col: ~tempX) * (Col: ~tempX)) + (((Col: ~tempY) * (Col: ~tempY)) + ((Col: ~tempZ) * (Col: ~tempZ)))) )\nset [col: ~colx v] to (Col: ~returnX)\nset [col: ~coly v] to (Col: ~returnY)\nset [col: ~colz v] to (Col: ~returnZ)\n# Closest Point To Line Segment p: (x) (y) (z) Line: (x1) (y1) (z1) | (x3) (y3) (z3)\nset [col: ~tempx v] to ((Col: ~returnX) - (x))\nset [col: ~tempy v] to ((Col: ~returnY) - (y))\nset [col: ~tempz v] to ((Col: ~returnZ) - (z))\nset [col: ~temp v] to ([sqrt v] of (((Col: ~tempX) * (Col: ~tempX)) + (((Col: ~tempY) * (Col: ~tempY)) + ((Col: ~tempZ) * (Col: ~tempZ)))) )\nif <(Col: ~temp) < (Col: ~mag)> then\n    set [col: ~mag v] to (Col: ~temp)\n    set [col: ~colx v] to (Col: ~returnX)\n    set [col: ~coly v] to (Col: ~returnY)\n    set [col: ~colz v] to (Col: ~returnZ)\nend\n# Closest Point To Line Segment p: (x) (y) (z) Line: (x3) (y3) (z3) | (x2) (y2) (z2)\nset [col: ~tempx v] to ((Col: ~returnX) - (x))\nset [col: ~tempy v] to ((Col: ~returnY) - (y))\nset [col: ~tempz v] to ((Col: ~returnZ) - (z))\nset [col: ~temp v] to ([sqrt v] of (((Col: ~tempX) * (Col: ~tempX)) + (((Col: ~tempY) * (Col: ~tempY)) + ((Col: ~tempZ) * (Col: ~tempZ)))) )\nif <(Col: ~temp) < (Col: ~mag)> then\n    set [col: ~mag v] to (Col: ~temp)\n    set [col: ~colx v] to (Col: ~returnX)\n    set [col: ~coly v] to (Col: ~returnY)\n    set [col: ~colz v] to (Col: ~returnZ)\nend\nif <(Col: ~mag) < ((r) * (1))> then\n    set [~collisionresult v] to [1]\nend\n\ndefine # Get Plain Data with (x1) (y1) (z1) . (x2) (y2) (z2) . (x3) (y3) (z3)\nset [col: plain function a v] to ((((z3) - (z1)) * ((y2) - (y1))) - (((y3) - (y1)) * ((z2) - (z1))))\nset [col: plain function b v] to ((((x3) - (x1)) * ((z2) - (z1))) - (((z3) - (z1)) * ((x2) - (x1))))\nset [col: plain function c v] to ((((y3) - (y1)) * ((x2) - (x1))) - (((x3) - (x1)) * ((y2) - (y1))))\nif <not <(Col: plain function B) < [0]>> then\n    set [col: plain function a v] to (() - (Col: plain function A))\n    set [col: plain function b v] to (() - (Col: plain function B))\n    set [col: plain function c v] to (() - (Col: plain function C))\nend\nset [col: plain function d v] to ([sqrt v] of (((Col: plain function A) * (Col: plain function A)) + (((Col: plain function B) * (Col: plain function B)) + ((Col: plain function C) * (Col: plain function C)))) )\nset [col: plain function a v] to ((Col: plain function A) / (Col: plain function D))\nset [col: plain function b v] to ((Col: plain function B) / (Col: plain function D))\nset [col: plain function c v] to ((Col: plain function C) / (Col: plain function D))\nset [col: plain function d v] to (((Col: plain function A) * (x1)) + (((Col: plain function B) * (y1)) + ((Col: plain function C) * (z1))))\n\ndefine # Closest Point To Line Segment p: (px) (py) (pz) Line: (x1) (y1) (z1) | (x2) (y2) (z2)\nset [col: ~vx v] to ((x2) - (x1))\nset [col: ~vy v] to ((y2) - (y1))\nset [col: ~vz v] to ((z2) - (z1))\nset [col: ~t v] to (((((px) - (x1)) * (Col: ~vx)) + ((((py) - (y1)) * (Col: ~vy)) + (((pz) - (z1)) * (Col: ~vz)))) / (((Col: ~vx) * (Col: ~vx)) + (((Col: ~vy) * (Col: ~vy)) + ((Col: ~vz) * (Col: ~vz)))))\nif <(Col: ~T) > [1]> then\n    set [col: ~t v] to [1]\nend\nif <(Col: ~T) < [0]> then\n    set [col: ~t v] to [0]\nend\nset [col: ~returnx v] to ((x1) + ((Col: ~vx) * (Col: ~T)))\nset [col: ~returny v] to ((y1) + ((Col: ~vy) * (Col: ~T)))\nset [col: ~returnz v] to ((z1) + ((Col: ~vz) * (Col: ~T)))\n\ndefine # Get Max and Min (a) (b) (c)\nif <(a) > (b)> then\n    if <(b) > (c)> then\n        set [#max v] to (a)\n        set [#min v] to (c)\n    else\n        set [#min v] to (b)\n        if <(a) > (c)> then\n            set [#max v] to (a)\n        else\n            set [#max v] to (c)\n        end\n    end\nelse\n    if <(a) > (c)> then\n        set [#max v] to (b)\n        set [#min v] to (c)\n    else\n        set [#min v] to (a)\n        if <(b) > (c)> then\n            set [#max v] to (b)\n        else\n            set [#max v] to (c)\n        end\n    end\nend\n\nwhen flag clicked\n\nbroadcast (Start v)\n\ndelete all of [#cloudlist v]\n\ndefine add Spike at (x) (y) (z) (t)\nAdd Tri ((10) + (x)) ((y) + (-20)) ((10) + (z)) - ((-10) + (x)) ((y) + (-20)) ((10) + (z)) - (x) ((y) + (20)) (z) -- [lava] []\nAdd Tri ((10) + (x)) ((y) + (-20)) ((-10) + (z)) - ((-10) + (x)) ((y) + (-20)) ((-10) + (z)) - (x) ((y) + (20)) (z) -- [lava] []\nAdd Tri ((10) + (x)) ((y) + (-20)) ((-10) + (z)) - ((10) + (x)) ((y) + (-20)) ((10) + (z)) - (x) ((y) + (20)) (z) -- [lava] []\nAdd Tri ((-10) + (x)) ((y) + (-20)) ((-10) + (z)) - ((-10) + (x)) ((y) + (-20)) ((10) + (z)) - (x) ((y) + (20)) (z) -- [lava] []\n\nif <not <[player] = (t)>> then\nend\n\nwhen I receive [point v]\nif <[0] = (__)> then\n    set [__ v] to (round (timer))\n    if <(☁ Highscore) < (__)> then\n        if <[0] = (letter (2) of (☁ Highscore))> then\n            set [☁ highscore v] to (join [00] (__))\n        else\n            set [☁ highscore v] to (join [0] (__))\n        end\n    end\nend\nset pen color to (#000000)\nPhrase (join [You reached the end with a time of:] (__)) starting at [-220] [75] size: [0.8]\nPhrase (join [Worldscore:] ((☁ Highscore) + ())) starting at [-220] [40] size: [0.8]\n\nrepeat (100)\nend\n\nwhen flag clicked\nset [__ v] to [0]\n\ndefine Add elevator at (x) (z) on? ()\nset [_ele v] to ((100) * (round ((Player y) / (100))))\nchange [_ele v] by (300)\nrepeat (5)\n    set [_ele y v] to ((_ele) + (<[y] = ()> * (join ((1) * <[00] = (join (letter (10) of (days since 2000)) (letter (11) of (days since 2000)))>) (join (letter (10) of (days since 2000)) (letter (11) of (days since 2000))))))\n    Add Tri ((x) + (-50)) (_Ele y) ((z) + (-50)) - ((x) + (-50)) (_Ele y) ((z) + (50)) - ((x) + (50)) (_Ele y) ((z) + (-50)) -- [snow] []\n    Add Tri ((x) + (50)) (_Ele y) ((z) + (50)) - ((x) + (-50)) (_Ele y) ((z) + (50)) - ((x) + (50)) (_Ele y) ((z) + (-50)) -- [snow] []\n    change [_ele v] by (-100)\nend\n\nwhen [e v] key pressed\nDetect [] [] [] []\nif <[touching? v] contains [lever]?> then\n    set [___ v] to [y]\nend\n\nif  then\nelse\n    set [☁ highscore v] to (join [00] (() + (☁ Highscore)))\nend\n\nwhen I receive [hidden v]\nset pen color to (#000000)\nPhrase [You reached the hidden platform] starting at [-220] [75] size: [0.8]\n\nwhen flag clicked\nbroadcast (Start v)\n\ndefine Flat Square at (x) (y) (z) ()\nAdd Tri ((x) + (-50)) (y) ((z) + (-50)) - ((x) + (-50)) (y) ((z) + (50)) - ((x) + (50)) (y) ((z) + (-50)) -- () []\nAdd Tri ((x) + (50)) (y) ((z) + (50)) - ((x) + (-50)) (y) ((z) + (50)) - ((x) + (50)) (y) ((z) + (-50)) -- () []\n\ndefine Add player\nchange [-rot x p v] by (((Rotation X) - (-Rot x p)) / (10))\nset [-last cos y v] to ([cos v] of (-Rot x p) )\nset [-last sine y v] to ([sin v] of (-Rot x p) )\nAdd Tri (((10) * (-last Cos y)) + (Player x)) ((Player y) + (-10)) (((10) * (-last sine y)) + (Player z)) - (((-10) * (-last sine y)) + (Player x)) ((Player y) + (-10)) (((10) * (-last Cos y)) + (Player z)) - (((-10) * (-last Cos y)) + (Player x)) ((Player y) + (-10)) (((-10) * (-last sine y)) + (Player z)) -- [Player] []\nAdd Tri (((10) * (-last Cos y)) + (Player x)) ((Player y) + (-10)) (((10) * (-last sine y)) + (Player z)) - (((-10) * (-last sine y)) + (Player x)) ((Player y) + (-10)) (((10) * (-last Cos y)) + (Player z)) - (Player x) ((Player y) + (20)) (Player z) -- [Player] []\nAdd Tri (Player x) ((Player y) + (20)) (Player z) - (((-10) * (-last sine y)) + (Player x)) ((Player y) + (-10)) (((10) * (-last Cos y)) + (Player z)) - (((-10) * (-last Cos y)) + (Player x)) ((Player y) + (-10)) (((-10) * (-last sine y)) + (Player z)) -- [Player] []\nAdd Tri (((10) * (-last Cos y)) + (Player x)) ((Player y) + (-10)) (((10) * (-last sine y)) + (Player z)) - (Player x) ((Player y) + (20)) (Player z) - (((-10) * (-last Cos y)) + (Player x)) ((Player y) + (-10)) (((-10) * (-last sine y)) + (Player z)) -- [Player] []\n\n@Sprite2\n\nwhen flag clicked\nhide\n\n