3D Platformer V2
@Stage\n\nwhen flag clicked\nforever\n    play sound [music v] until done\nend\n\n@3D Engine\n\nwhen flag clicked\nhide\nset [start v] to [0]\nset [pause v] to [0]\nset [mouse? v] to [0]\nset [playerview? v] to [1]\nset [sort? v] to [1]\nset [fov v] to [240]\nset [level v] to []\nwait until <(level) = [0]>\nreset\nrepeat until <(start) = [1]>\n    erase all\n    set cam (lookY) (lookX) (0)\n    change [gravity v] by (-10)\n    move (SinHor) (gravity) (CosHor)\n    LoopThroughCubesAndCollide\n    moveObjects\n    Interact\n    teleportPlayer\n    change [lookx v] by (-3)\n    render (length of [pointx v]) points\n    ConnectPoints\nend\nset [level v] to [1]\nreset\nforever\n    if <<(pause) = [0]> and <(Instructions) = [0]>> then\n        if <(level) < [5]> then\n            set [time v] to (timer)\n            erase all\n            ReadKeys\n            Decay (0.93)\n            set cam (lookY) (lookX) (0)\n            change [gravity v] by (-10)\n            move (SinHor) (gravity) (CosHor)\n            LoopThroughCubesAndCollide\n            moveObjects\n            Interact\n            teleportPlayer\n            change [lookx v] by (horAcc)\n            change [looky v] by (vertAcc)\n            change [lookz v] by (rollAcc)\n            if <([abs v] of (lookY) ) > [90]> then\n                change [looky v] by ((0) - (vertAcc))\n                set [vertacc v] to [0]\n            end\n            render (length of [pointx v]) points\n            ConnectPoints\n            set [fps v] to ((1) / ((timer) - (time)))\n        else\n            broadcast (Finish v)\n        end\n    end\nend\n\ndefine None\nadd (x) to [pointx v]\nadd (y) to [pointy v]\nadd (z) to [pointz v]\n\ndefine reset\nresetLists\nAdd Objects\nresetPosAndMove\n\ndefine None\nset [vertacc v] to ((vertAcc) * ((rate) / (1.1)))\nset [horacc v] to ((horAcc) * ((rate) / (1.1)))\nset [rollacc v] to ((rollAcc) * (rate))\nset [moveacc v] to ((moveAcc) * (rate))\nset [sideacc v] to ((SideAcc) * (rate))\n\ndefine None\ndelete (all) of [pointscreenx v]\ndelete (all) of [pointscreeny v]\ndelete (all) of [pointscreenz v]\ndelete (all) of [pointscreensize v]\nif <(PlayerView?) = [0]> then\n    set [camx v] to (posX)\n    set [camy v] to (posY)\n    set [camz v] to (posZ)\nelse\n    if <(Mouse?) = [0]> then\n        SlowlyMoveCamera (-4000) (CamSpeed)\n    else\n        SlowlyMoveCamera (-4000) (1)\n    end\nend\nif <(Sort?) = [1]> then\n    Sort\nend\nset [loop# v] to [1]\ndelete (all) of [pointx2 v]\ndelete (all) of [pointy2 v]\ndelete (all) of [pointz2 v]\nif <(Sort?) = [1]> then\n    repeat ((length of [sorted? v]) / (2))\n        set [innerloop# v] to (((item (loop#) of [sorted? v]) * (8)) - (7))\n        repeat (8)\n            set [transformx v] to (item (innerLoop#) of [pointx v])\n            set [transformy v] to (item (innerLoop#) of [pointy v])\n            set [transformz v] to (item (innerLoop#) of [pointz v])\n            add (transformX) to [pointx2 v]\n            add (transformY) to [pointy2 v]\n            add (transformZ) to [pointz2 v]\n            Transform \n            add (transformZ) to [pointscreenz v]\n            add (transformX) to [pointscreenx v]\n            add (transformY) to [pointscreeny v]\n            add (round ((24000) / (transformZ))) to [pointscreensize v]\n            change [innerloop# v] by (1)\n        end\n        change [loop# v] by (2)\n    end\nelse\n    repeat (length of [pointx v])\n        set [transformx v] to (item (loop#) of [pointx v])\n        set [transformy v] to (item (loop#) of [pointy v])\n        set [transformz v] to (item (loop#) of [pointz v])\n        Transform \n        add (transformZ) to [pointscreenz v]\n        add (transformX) to [pointscreenx v]\n        add (transformY) to [pointscreeny v]\n        add (round ((24000) / (transformZ))) to [pointscreensize v]\n        change [loop# v] by (1)\n    end\nend\n\ndefine ReadKeys\nif <(Mouse?) = [0]> then\n    if <key (up arrow v) pressed?> then\n        change [vertacc v] by (0.8)\n    end\n    if <key (down arrow v) pressed?> then\n        change [vertacc v] by (-0.8)\n    end\n    if <key (right arrow v) pressed?> then\n        change [horacc v] by (0.8)\n    end\n    if <key (left arrow v) pressed?> then\n        change [horacc v] by (-0.8)\n    end\nelse\n    set [vertacc v] to ((mouse y) - (PrevY))\n    if <([abs v] of (mouse x) ) > [235]> then\n        set [horacc v] to ((mouse x) / (38))\n    else\n        set [horacc v] to ((mouse x) - (prevX))\n    end\n    set [prevx v] to (mouse x)\n    set [prevy v] to (mouse y)\nend\nif <key (d v) pressed?> then\n    change [sideacc v] by (-10)\nend\nif <key (a v) pressed?> then\n    change [sideacc v] by (10)\nend\nif <key (w v) pressed?> then\n    change [moveacc v] by (10)\nend\nif <key (s v) pressed?> then\n    change [moveacc v] by (-10)\nend\nif <key (space v) pressed?> then\n    if <(Collided?) = [1  ]> then\n        set [gravity v] to [200]\n    end\nend\n\ndefine None\nrepeat (number)\n    Add Point at (pick random ((0) - (range)) to (range)) (pick random ((0) - (range)) to (range)) (pick random ((0) - (range)) to (range))\nend\n\ndefine ConnectPoints\nset [playerdraw? v] to [0]\nset [innerloop# v] to [1]\nset [loop# v] to [1]\nif <(Sort?) = [1]> then\n    repeat (length of [objects v])\n        set [object# v] to (item (((innerLoop#) * (2)) - (1)) of [sorted? v])\n        set [dist v] to (item ((innerLoop#) * (2)) of [sorted? v])\n        if <[deleted v] contains (object#)?> then\n            change [innerloop# v] by (1)\n            change [loop# v] by (8)\n        else\n            if <(item (object#) of [objects v]) = [Cube]> then\n                if <(item (object#) of [objecttype v]) = [1]> then\n                    if <<[interactiveobjects v] contains (object#)?> and <not <[interacted? v] contains (object#)?>>> then\n                        set [color v] to [1]\n                    else\n                        set [color v] to [2]\n                    end\n                else\n                    if <(item (object#) of [objecttype v]) = [2]> then\n                        set [color v] to [3]\n                    else\n                        if <(item (object#) of [objecttype v]) = [3]> then\n                            set [color v] to [4]\n                        else\n                            if <(item (object#) of [objecttype v]) = [4]> then\n                                set [color v] to [5]\n                            else\n                                set [color v] to [6]\n                            end\n                        end\n                    end\n                end\n                connect point (loop#) to point ((loop#) + (1))\n                connect point ((loop#) + (1)) to point ((loop#) + (2))\n                connect point ((loop#) + (2)) to point ((loop#) + (3))\n                connect point ((loop#) + (3)) to point (loop#)\n                connect point ((loop#) + (4)) to point ((loop#) + (5))\n                connect point ((loop#) + (5)) to point ((loop#) + (6))\n                connect point ((loop#) + (6)) to point ((loop#) + (7))\n                connect point ((loop#) + (7)) to point ((loop#) + (4))\n                connect point ((loop#) + (7)) to point (loop#)\n                connect point ((loop#) + (6)) to point ((loop#) + (1))\n                connect point ((loop#) + (5)) to point ((loop#) + (2))\n                connect point ((loop#) + (4)) to point ((loop#) + (3))\n                change [loop# v] by (8)\n            else\n                if <(item (object#) of [objects v]) = [Pyramid]> then\n                    Set Pen Color to R: (255) G: (0) B: (0)\n                    connect point (loop#) to point ((loop#) + (1))\n                    connect point ((loop#) + (1)) to point ((loop#) + (2))\n                    connect point ((loop#) + (2)) to point ((loop#) + (3))\n                    connect point ((loop#) + (3)) to point (loop#)\n                    connect point (loop#) to point ((loop#) + (4))\n                    connect point ((loop#) + (1)) to point ((loop#) + (4))\n                    connect point ((loop#) + (2)) to point ((loop#) + (4))\n                    connect point ((loop#) + (3)) to point ((loop#) + (4))\n                    change [loop# v] by (5)\n                else\n                end\n            end\n            change [innerloop# v] by (1)\n        end\n    end\n    if <(PlayerView?) = [1]> then\n        DrawPlayer\n    end\nelse\n    set [object# v] to [1]\n    repeat (length of [objects v])\n        if <[deleted v] contains (object#)?> then\n            change [object# v] by (1)\n            change [loop# v] by (8)\n        else\n            if <(item (object#) of [objects v]) = [Cube]> then\n                if <(item (object#) of [objecttype v]) = [1]> then\n                    if <<[interactiveobjects v] contains (object#)?> and <not <[interacted? v] contains (object#)?>>> then\n                        set [color v] to [1]\n                    else\n                        set [color v] to [2]\n                    end\n                else\n                    if <(item (object#) of [objecttype v]) = [2]> then\n                        set [color v] to [3]\n                    else\n                        if <(item (object#) of [objecttype v]) = [3]> then\n                            set [color v] to [4]\n                        else\n                            if <(item (object#) of [objecttype v]) = [4]> then\n                                set [color v] to [5]\n                            else\n                                set [color v] to [6]\n                            end\n                        end\n                    end\n                end\n                connect point (loop#) to point ((loop#) + (1))\n                connect point ((loop#) + (1)) to point ((loop#) + (2))\n                connect point ((loop#) + (2)) to point ((loop#) + (3))\n                connect point ((loop#) + (3)) to point (loop#)\n                connect point ((loop#) + (4)) to point ((loop#) + (5))\n                connect point ((loop#) + (5)) to point ((loop#) + (6))\n                connect point ((loop#) + (6)) to point ((loop#) + (7))\n                connect point ((loop#) + (7)) to point ((loop#) + (4))\n                connect point ((loop#) + (7)) to point (loop#)\n                connect point ((loop#) + (6)) to point ((loop#) + (1))\n                connect point ((loop#) + (5)) to point ((loop#) + (2))\n                connect point ((loop#) + (4)) to point ((loop#) + (3))\n                change [loop# v] by (8)\n            else\n                if <(item (object#) of [objects v]) = [Pyramid]> then\n                    Set Pen Color to R: (255) G: (0) B: (0)\n                    connect point (loop#) to point ((loop#) + (1))\n                    connect point ((loop#) + (1)) to point ((loop#) + (2))\n                    connect point ((loop#) + (2)) to point ((loop#) + (3))\n                    connect point ((loop#) + (3)) to point (loop#)\n                    connect point (loop#) to point ((loop#) + (4))\n                    connect point ((loop#) + (1)) to point ((loop#) + (4))\n                    connect point ((loop#) + (2)) to point ((loop#) + (4))\n                    connect point ((loop#) + (3)) to point ((loop#) + (4))\n                    change [loop# v] by (5)\n                else\n                end\n            end\n            change [object# v] by (1)\n        end\n    end\n    if <(PlayerView?) = [1]> then\n        DrawPlayer\n    end\nend\n\ndefine None\npen up\nif <not <<(item (1) of [pointscreenz v]) < [10]> and <(item (2) of [pointscreenz v]) < [10]>>> then\n    set [x1 v] to (item (1) of [pointscreenx v])\n    set [y1 v] to (item (1) of [pointscreeny v])\n    set [x2 v] to (item (2) of [pointscreenx v])\n    set [y2 v] to (item (2) of [pointscreeny v])\n    set [size1 v] to (item (1) of [pointscreensize v])\n    set [size2 v] to (item (2) of [pointscreensize v])\n    set [z1 v] to (item (1) of [pointscreenz v])\n    set [z2 v] to (item (2) of [pointscreenz v])\n    set [pointdistzz v] to ((z2) - (z1))\n    if <(z2) < [10]> then\n        if <(Sort?) = [1]> then\n            set [transformx v] to ((item (1) of [pointx2 v]) + (((item (2) of [pointx2 v]) - (item (1) of [pointx2 v])) * (((10) - (z1)) / (pointDistZZ))))\n            set [transformy v] to ((item (1) of [pointy2 v]) + (((item (2) of [pointy2 v]) - (item (1) of [pointy2 v])) * (((10) - (z1)) / (pointDistZZ))))\n            set [transformz v] to ((item (1) of [pointz2 v]) + (((item (2) of [pointz2 v]) - (item (1) of [pointz2 v])) * (((10) - (z1)) / (pointDistZZ))))\n        else\n            set [transformx v] to ((item (1) of [pointx v]) + (((item (2) of [pointx v]) - (item (1) of [pointx v])) * (((10) - (z1)) / (pointDistZZ))))\n            set [transformy v] to ((item (1) of [pointy v]) + (((item (2) of [pointy v]) - (item (1) of [pointy v])) * (((10) - (z1)) / (pointDistZZ))))\n            set [transformz v] to ((item (1) of [pointz v]) + (((item (2) of [pointz v]) - (item (1) of [pointz v])) * (((10) - (z1)) / (pointDistZZ))))\n        end\n        Transform \n        set [x2 v] to (transformX)\n        set [y2 v] to (transformY)\n        set [size2 v] to (round ((24000) / (transformZ)))\n    else\n        if <(z1) < [10]> then\n            if <(Sort?) = [1]> then\n                set [transformx v] to ((item (2) of [pointx2 v]) - (((item (2) of [pointx2 v]) - (item (1) of [pointx2 v])) * (((z2) - (10)) / (pointDistZZ))))\n                set [transformy v] to ((item (2) of [pointy2 v]) - (((item (2) of [pointy2 v]) - (item (1) of [pointy2 v])) * (((z2) - (10)) / (pointDistZZ))))\n                set [transformz v] to ((item (2) of [pointz2 v]) - (((item (2) of [pointz2 v]) - (item (1) of [pointz2 v])) * (((z2) - (10)) / (pointDistZZ))))\n            else\n                set [transformx v] to ((item (2) of [pointx v]) - (((item (2) of [pointx v]) - (item (1) of [pointx v])) * (((z2) - (10)) / (pointDistZZ))))\n                set [transformy v] to ((item (2) of [pointy v]) - (((item (2) of [pointy v]) - (item (1) of [pointy v])) * (((z2) - (10)) / (pointDistZZ))))\n                set [transformz v] to ((item (2) of [pointz v]) - (((item (2) of [pointz v]) - (item (1) of [pointz v])) * (((z2) - (10)) / (pointDistZZ))))\n            end\n            Transform \n            set [x1 v] to (transformX)\n            set [y1 v] to (transformY)\n            set [size1 v] to (round ((24000) / (transformZ)))\n        end\n    end\n    set [pointdistx v] to ((x2) - (x1))\n    set [pointdisty v] to ((y2) - (y1))\n    set [pointdistz v] to ((size2) - (size1))\n    if <not <<(x1) > [240]> and <(x2) > [240]>>> then\n        if <not <<(x1) < [-240]> and <(x2) < [-240]>>> then\n            if <not <<(y1) > [180]> and <(y2) > [180]>>> then\n                if <not <<(y1) < [-180]> and <(y2) < [-180]>>> then\n                    Draw to Edge:\n                    Line <(Effects) = [1]> <(LineSize) = [1]>\n                end\n            end\n        end\n    end\nend\npen up\n\ndefine Draw to Edge:\nif <(x1) < [-240]> then\n    set [x1 v] to [-240]\n    set [y1 v] to ((y2) - ((((x2) - (-240)) / (pointDistX)) * (pointDistY)))\n    set [size1 v] to ((size2) - ((((x2) - (-240)) / (pointDistX)) * (pointDistZ)))\nelse\n    if <(x1) > [240]> then\n        set [x1 v] to [240]\n        set [y1 v] to ((y2) - ((((x2) - (240)) / (pointDistX)) * (pointDistY)))\n        set [size1 v] to ((size2) - ((((x2) - (240)) / (pointDistX)) * (pointDistZ)))\n    end\nend\nif <(x2) < [-240]> then\n    set [x2 v] to [-240]\n    set [y2 v] to ((y1) + ((((-240) - (x1)) / (pointDistX)) * (pointDistY)))\n    set [size2 v] to ((size1) + ((((-240) - (x1)) / (pointDistX)) * (pointDistZ)))\nelse\n    if <(x2) > [240]> then\n        set [x2 v] to [240]\n        set [y2 v] to ((y1) + ((((240) - (x1)) / (pointDistX)) * (pointDistY)))\n        set [size2 v] to ((size1) + ((((240) - (x1)) / (pointDistX)) * (pointDistZ)))\n    end\nend\nif <(y1) < [-180]> then\n    set [y1 v] to [-180]\n    set [x1 v] to ((x2) - ((((y2) - (-180)) / (pointDistY)) * (pointDistX)))\n    set [size1 v] to ((size2) - ((((y2) - (-180)) / (pointDistY)) * (pointDistZ)))\nelse\n    if <(y1) > [180]> then\n        set [y1 v] to [180]\n        set [x1 v] to ((x2) - ((((y2) - (180)) / (pointDistY)) * (pointDistX)))\n        set [size1 v] to ((size2) - ((((y2) - (180)) / (pointDistY)) * (pointDistZ)))\n    end\nend\nif <(y2) < [-180]> then\n    set [y2 v] to [-180]\n    set [x2 v] to ((x1) + ((((-180) - (y1)) / (pointDistY)) * (pointDistX)))\n    set [size2 v] to ((size1) + ((((-180) - (y1)) / (pointDistY)) * (pointDistZ)))\nelse\n    if <(y2) > [180]> then\n        set [y2 v] to [180]\n        set [x2 v] to ((x1) + ((((180) - (y1)) / (pointDistY)) * (pointDistX)))\n        set [size2 v] to ((size1) + ((((180) - (y1)) / (pointDistY)) * (pointDistZ)))\n    end\nend\n\ndefine None\nchange [posx v] by ((x) * (moveAcc))\nchange [posz v] by ((z) * (moveAcc))\nchange [posx v] by (((0) - (z)) * (SideAcc))\nchange [posz v] by ((x) * (SideAcc))\nchange [posy v] by (y)\nif <(posY) < [-20000]> then\n    reset\n    change [attempts v] by (1)\nend\n\ndefine None\nset [coshor v] to ([cos v] of (hor) )\nset [sinhor v] to ([sin v] of (hor) )\nset [cosvert v] to ([cos v] of (vert) )\nset [sinvert v] to ([sin v] of (vert) )\nset [cosroll v] to ([cos v] of (roll) )\nset [sinroll v] to ([sin v] of (roll) )\n\ndefine None\nset pen color to (((r) * (65536)) + (((g) * (256)) + (b)))\n\ndefine None\nadd (x) to [cubex v]\nadd (y) to [cubey v]\nadd (z) to [cubez v]\nadd (h) to [cubeh v]\nadd (l) to [cubew v]\nadd (l) to [cubel v]\nadd [Pyramid] to [objects v]\nadd [2] to [objecttype v]\nAdd Point at (x) (y) (z)\nAdd Point at ((x) + (l)) (y) (z)\nAdd Point at ((x) + (l)) (y) ((z) + (l))\nAdd Point at (x) (y) ((z) + (l))\nAdd Point at ((x) + ((l) / (2))) ((y) + (h)) ((z) + ((l) / (2)))\n\ndefine None\nadd (x) to [cubex v]\nadd (y) to [cubey v]\nadd (z) to [cubez v]\nadd (h) to [cubeh v]\nadd (w) to [cubew v]\nadd (l) to [cubel v]\nadd [Cube] to [objects v]\nadd (type) to [objecttype v]\nadd [1] to [movedir v]\nadd [0] to [touchingobject v]\nAdd Point at (x) (y) (z)\nAdd Point at ((x) + (w)) (y) (z)\nAdd Point at ((x) + (w)) (y) ((z) + (l))\nAdd Point at (x) (y) ((z) + (l))\nAdd Point at (x) ((y) + (h)) ((z) + (l))\nAdd Point at ((x) + (w)) ((y) + (h)) ((z) + (l))\nAdd Point at ((x) + (w)) ((y) + (h)) (z)\nAdd Point at (x) ((y) + (h)) (z)\n\ndefine resetLists\ndelete (all) of [pointx v]\ndelete (all) of [pointy v]\ndelete (all) of [pointz v]\ndelete (all) of [objects v]\ndelete (all) of [objecttype v]\ndelete (all) of [cubex v]\ndelete (all) of [cubey v]\ndelete (all) of [cubez v]\ndelete (all) of [cubeh v]\ndelete (all) of [cubew v]\ndelete (all) of [cubel v]\ndelete (all) of [movedir v]\ndelete (all) of [interactiveobjects v]\ndelete (all) of [interacted? v]\ndelete (all) of [deleted v]\ndelete (all) of [touchingobject v]\n\ndefine resetPosAndMove\nset [gravity v] to [0]\nset [vertacc v] to [0]\nset [horacc v] to [0]\nset [rollacc v] to [0]\nset [sideacc v] to [0]\nset [moveacc v] to [0]\nset [posx v] to [0]\nset [posy v] to [6000]\nset [posz v] to [0]\nset [lookx v] to [0]\nset [looky v] to [0]\nset [lookz v] to [0]\nset [camx v] to [0]\nset [camy v] to [0]\nset [targetx v] to [0]\nset [targety v] to [0]\nif <(PlayerView?) = [0]> then\n    set [camz v] to [0]\nelse\n    set [camz v] to [-30000]\nend\n\ndefine Add Objects\nif <(level) > [0]> then\n    if <(level) = [4]> then\n        Level4\n    else\n        Create Cube Left Bottom Corner- X: (-2000) Y: (-2000) Z: (-2000) H: (1000) W: (4000) L: (4000) type: (1)\n        if <(level) = [1]> then\n            Level1\n        else\n            if <(level) = [2]> then\n                Level2\n            else\n                if <(level) = [3]> then\n                    Level3\n                else\n                    if <(level) = [5]> then\n                    else\n                        if <(level) = [6]> then\n                        else\n                            if <(level) = [7]> then\n                            else\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nelse\n    Create Cube Left Bottom Corner- X: (-1500) Y: (3000) Z: (-1500) H: (500) W: (3000) L: (3000) type: (1)\nend\n\ndefine Interact\nif <(level) = [2]> then\n    if touching object (14) then delete object (10)\nelse\n    if <(level) = [4]> then\n        if touching object (13) then delete object (5)\n        if touching object (19) then delete object (6)\n        if touching object (25) then delete object (8)\n    end\nend\n\ndefine None\nif <not <[interactiveobjects v] contains (number)?>> then\n    add (number) to [interactiveobjects v]\nend\nif <<not <(posX) < (item (number) of [cubex v])>> and <not <(posX) > ((item (number) of [cubex v]) + (item (number) of [cubew v]))>>> then\n    if <<not <(posZ) < (item (number) of [cubez v])>> and <not <(posZ) > ((item (number) of [cubez v]) + (item (number) of [cubel v]))>>> then\n        if <<<not <((posY) - (1000)) < (item (number) of [cubey v])>> and <not <((posY) - (1000)) > ((item (number) of [cubey v]) + (item (number) of [cubeh v]))>>> or <<(posY) > (item (number) of [cubey v])> and <(posY) < ((item (number) of [cubey v]) + (item (number) of [cubeh v]))>>> then\n            if <not <[interacted? v] contains (number)?>> then\n                add (number) to [interacted? v]\n                add (number2) to [deleted v]\n            end\n        end\n    end\nend\n\ndefine None\nif <<not <(posX) < (item (number) of [cubex v])>> and <not <(posX) > ((item (number) of [cubex v]) + (item (number) of [cubew v]))>>> then\n    if <<not <(posZ) < (item (number) of [cubez v])>> and <not <(posZ) > ((item (number) of [cubez v]) + (item (number) of [cubel v]))>>> then\n        if <<<not <((posY) - (1000)) < (item (number) of [cubey v])>> and <not <((posY) - (1000)) > ((item (number) of [cubey v]) + (item (number) of [cubeh v]))>>> or <<(posY) > (item (number) of [cubey v])> and <(posY) < ((item (number) of [cubey v]) + (item (number) of [cubeh v]))>>> then\n            if <(item (number) of [touchingobject v]) = [0]> then\n                replace item (number) of [touchingobject v] with [0]\n                set [posx v] to ((item (number2) of [cubex v]) + ((item (number2) of [cubew v]) / (2)))\n                set [posy v] to ((item (number2) of [cubey v]) + ((item (number2) of [cubeh v]) / (2)))\n                set [posz v] to ((item (number2) of [cubez v]) + ((item (number2) of [cubel v]) / (2)))\n                replace item (number2) of [touchingobject v] with [1]\n            end\n        else\n            if <not <(item (number) of [touchingobject v]) = [0]>> then\n                replace item (number) of [touchingobject v] with [0]\n            end\n        end\n    else\n        if <not <(item (number) of [touchingobject v]) = [0]>> then\n            replace item (number) of [touchingobject v] with [0]\n        end\n    end\nelse\n    if <not <(item (number) of [touchingobject v]) = [0]>> then\n        replace item (number) of [touchingobject v] with [0]\n    end\nend\n\ndefine teleportPlayer\nif <(level) = [4]> then\n    teleport from object (2) to object (10)\n    teleport from object (3) to object (15)\n    teleport from object (4) to object (21)\nend\n\ndefine None\nif touching object (number) then teleport to (number2)\nif touching object (number2) then teleport to (number)\n\ndefine None\ngo to x: (x1) y: (y1)\nset pen size to (size1)\nset [pointdistx v] to ((x2) - (x1))\nset [pointdisty v] to ((y2) - (y1))\nset [pointdistz v] to ((size2) - (size1))\nif <([floor v] of ([abs v] of (pointDistZ) ) ) = [0]> then\n    pen down\n    go to x: (x2) y: (y2)\nelse\n    pen down\n    repeat ([floor v] of ([abs v] of (pointDistZ) ) )\n        go to x: ((x position) + ((pointDistX) / ([floor v] of ([abs v] of (pointDistZ) ) ))) y: ((y position) + ((pointDistY) / ([floor v] of ([abs v] of (pointDistZ) ) )))\n        change pen size by ((pointDistZ) / ([floor v] of ([abs v] of (pointDistZ) ) ))\n    end\nend\n\ndefine None\nchange [camx v] by ((((posX) + ((CosVert) * ((SinHor) * (distance)))) - (CamX)) / (time))\nchange [camz v] by ((((posZ) + ((CosVert) * ((CosHor) * (distance)))) - (CamZ)) / (time))\nchange [camy v] by ((((posY) + ((SinVert) * (distance))) - (CamY)) / (time))\n\ndefine None\nchange [lookx v] by (((targetX) - (lookX)) / (speed))\nchange [looky v] by (((targetY) - (lookY)) / (speed))\n\ndefine None\nif <(color) = [1]> then\n    Set Pen Color to R: (255) G: (128) B: (0)\nelse\n    if <(color) = [2]> then\n        set pen color to (#0000ff)\n    else\n        if <(color) = [3]> then\n            set pen color to (#ff0000)\n        else\n            if <(color) = [4]> then\n                set pen color to (#00ff00)\n            else\n                if <(color) = [5]> then\n                    set pen color to (#ffff00)\n                else\n                    Set Pen Color to R: (127) G: (0) B: (255)\n                end\n            end\n        end\n    end\nend\nif <(shade) = [1]> then\n    set pen shade to (70)\nelse\n    set pen shade to (20)\nend\n\ndefine None\nset [distance v] to (round ((((x2) - (x1)) * ((x2) - (x1))) + ((((y2) - (y1)) * ((y2) - (y1))) + (((z2) - (z1)) * ((z2) - (z1))))))\n\ndefine DrawPlayer\nset pen color to (#00c800)\nset [transformx v] to (posX)\nset [transformy v] to ((posY) - (1000))\nset [transformz v] to (posZ)\nTransform <[] = []>\nset pen size to (round ((24000) / (transformZ)))\ngo to x: (transformX) y: (transformY)\nset [transformx v] to (posX)\nset [transformy v] to (posY)\nset [transformz v] to (posZ)\nTransform <[] = []>\npen down\ngo to x: (transformX) y: (transformY)\nset pen size to (round ((80000) / (transformZ)))\npen down\npen up\n\nadd (transformZ) to [pointscreenz v]\nadd (transformX) to [pointscreenx v]\nadd (transformY) to [pointscreeny v]\nadd (round ((24000) / (transformZ))) to [pointscreensize v]\n\ndefine None\nif <(item (number) of [movedir v]) = [-1]> then\n    if <<not <(posX) < (item (number) of [cubex v])>> and <not <(posX) > ((item (number) of [cubex v]) + (item (number) of [cubew v]))>>> then\n        if <<not <(posZ) < (item (number) of [cubez v])>> and <not <(posZ) > ((item (number) of [cubez v]) + (item (number) of [cubel v]))>>> then\n            if <<<not <((posY) - (1000)) < (item (number) of [cubey v])>> and <not <((posY) - (1000)) > ((item (number) of [cubey v]) + (item (number) of [cubeh v]))>>> or <<(posY) > (item (number) of [cubey v])> and <(posY) < ((item (number) of [cubey v]) + (item (number) of [cubeh v]))>>> then\n                if <(item (number) of [objecttype v]) = [1]> then\n                    change [posx v] by ((x) * (item (number) of [movedir v]))\n                    change [posy v] by ((y) * (item (number) of [movedir v]))\n                    change [posz v] by ((z) * (item (number) of [movedir v]))\n                end\n            end\n        end\n    end\nend\nset [loop# v] to ((((number) - (1)) * (8)) + (1))\nreplace item (number) of [cubex v] with ((item (number) of [cubex v]) + ((x) * (item (number) of [movedir v])))\nreplace item (number) of [cubey v] with ((item (number) of [cubey v]) + ((y) * (item (number) of [movedir v])))\nreplace item (number) of [cubez v] with ((item (number) of [cubez v]) + ((z) * (item (number) of [movedir v])))\nrepeat (8)\n    replace item (loop#) of [pointx v] with ((item (loop#) of [pointx v]) + ((x) * (item (number) of [movedir v])))\n    replace item (loop#) of [pointy v] with ((item (loop#) of [pointy v]) + ((y) * (item (number) of [movedir v])))\n    replace item (loop#) of [pointz v] with ((item (loop#) of [pointz v]) + ((z) * (item (number) of [movedir v])))\n    change [loop# v] by (1)\nend\nif <(item (number) of [movedir v]) > [-1]> then\n    if <<not <(posX) < (item (number) of [cubex v])>> and <not <(posX) > ((item (number) of [cubex v]) + (item (number) of [cubew v]))>>> then\n        if <<not <(posZ) < (item (number) of [cubez v])>> and <not <(posZ) > ((item (number) of [cubez v]) + (item (number) of [cubel v]))>>> then\n            if <<<not <((posY) - (1000)) < (item (number) of [cubey v])>> and <not <((posY) - (1000)) > ((item (number) of [cubey v]) + (item (number) of [cubeh v]))>>> or <<(posY) > (item (number) of [cubey v])> and <(posY) < ((item (number) of [cubey v]) + (item (number) of [cubeh v]))>>> then\n                if <(item (number) of [objecttype v]) = [1]> then\n                    change [posx v] by ((x) * (item (number) of [movedir v]))\n                    change [posy v] by ((y) * (item (number) of [movedir v]))\n                    change [posz v] by ((z) * (item (number) of [movedir v]))\n                end\n            end\n        end\n    end\nend\nif <<<(item (number) of [cubex v]) > (mx)> or <(item (number) of [cubey v]) > (my)>> or <(item (number) of [cubez v]) > (mz)>> then\n    replace item (number) of [movedir v] with [-1]\nend\nif <<<(item (number) of [cubex v]) < (mx)> or <(item (number) of [cubey v]) < (my)>> or <(item (number) of [cubez v]) < (mz)>> then\n    replace item (number) of [movedir v] with [1]\nend\n\ndefine Line <> <>\nif <<sizechange> and <([abs v] of ((size1) - (size2)) ) > [5]>> then\n    if <effects?> then\n        SetColor (Color) (0)\n        draw line from x (x1) y (y1) to x (x2) y (y2) start width ((size1) * (2)) end width ((size2) * (2))\n    end\n    SetColor (Color) (1)\n    draw line from x (x1) y (y1) to x (x2) y (y2) start width (size1) end width (size2)\nelse\n    if <effects?> then\n        SetColor (Color) (0)\n        set pen size to ((size1) + (size2))\n        go to x: (x1) y: (y1)\n        pen down\n        go to x: (x2) y: (y2)\n        pen up\n    end\n    SetColor (Color) (1)\n    set pen size to (((size1) + (size2)) / (2))\n    go to x: (x1) y: (y1)\n    pen down\n    go to x: (x2) y: (y2)\n    pen up\nend\n\ndefine Transform <>\nset [pointdistx v] to ((transformX) - (CamX))\nset [pointdisty v] to ((transformY) - (CamY))\nset [pointdistz v] to ((transformZ) - (CamZ))\nRotations\nif <-z> then\n    set [transformz v] to ([abs v] of (transformZ) )\nend\nset [transformx v] to (((FOV) * (transformX)) / (transformZ))\nset [transformy v] to (((FOV) * (transformY)) / (transformZ))\n\ndefine Rotations\nset [transformx v] to (((CosHor) * (pointDistX)) - ((SinHor) * (pointDistZ)))\nset [transformz v] to (((SinHor) * (pointDistX)) + ((CosHor) * (pointDistZ)))\nset [transformy v] to (((CosVert) * (pointDistY)) - ((SinVert) * (transformZ)))\nset [transformz v] to (((SinVert) * (pointDistY)) + ((CosVert) * (transformZ)))\n\ndefine Shade\nif <(Sort?) = [1]> then\n    set [shade v] to (round ((400000) / ([sqrt v] of (Dist) )))\n    if <(Shade) > [100]> then\n        set pen shade to (100)\n    else\n        set pen shade to (Shade)\n    end\nelse\n    set pen shade to (50)\nend\n\ndefine Level2\nCreate Cube Left Bottom Corner- X: (-2000) Y: (-2000) Z: (2000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-12500) Y: (-2000) Z: (15000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-20000) Y: (-4000) Z: (15000) H: (1000) W: (6000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-50000) Y: (6000) Z: (15000) H: (1000) W: (30000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-25000) Y: (7000) Z: (14000) H: (4000) W: (500) L: (6000) type: (2)\nCreate Cube Left Bottom Corner- X: (-29000) Y: (7000) Z: (14000) H: (4000) W: (500) L: (6000) type: (2)\nCreate Cube Left Bottom Corner- X: (-35000) Y: (7000) Z: (14000) H: (4000) W: (2000) L: (6000) type: (2)\nCreate Cube Left Bottom Corner- X: (-45000) Y: (7000) Z: (15500) H: (4000) W: (1000) L: (3000) type: (3)\nCreate Cube Left Bottom Corner- X: (-46000) Y: (7000) Z: (14500) H: (4000) W: (3000) L: (5000) type: (2)\nCreate Cube Left Bottom Corner- X: (-40000) Y: (8000) Z: (10000) H: (1000) W: (3000) L: (3000) type: (1)\nCreate Cube Left Bottom Corner- X: (-40000) Y: (9000) Z: (5000) H: (1000) W: (3000) L: (3000) type: (1)\nCreate Cube Left Bottom Corner- X: (-40000) Y: (10000) Z: (0) H: (1000) W: (3000) L: (3000) type: (1)\nCreate Cube Left Bottom Corner- X: (-40000) Y: (11000) Z: (-5000) H: (1000) W: (3000) L: (3000) type: (1)\nCreate Cube Left Bottom Corner- X: (-40000) Y: (8000) Z: (10000) H: (1000) W: (3000) L: (3000) type: (2)\nCreate Cube Left Bottom Corner- X: (-40000) Y: (9000) Z: (5000) H: (1000) W: (3000) L: (3000) type: (2)\nCreate Cube Left Bottom Corner- X: (-40000) Y: (10000) Z: (0) H: (1000) W: (3000) L: (3000) type: (2)\n\ndefine Level1\nCreate Cube Left Bottom Corner- X: (-2000) Y: (-1000) Z: (5000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-9000) Y: (0) Z: (5000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-9000) Y: (1000) Z: (-8000) H: (1000) W: (4000) L: (10000) type: (1)\nCreate Cube Left Bottom Corner- X: (-10000) Y: (2000) Z: (-2000) H: (1250) W: (6000) L: (1000) type: (2)\nCreate Cube Left Bottom Corner- X: (-10000) Y: (2000) Z: (-6000) H: (1250) W: (6000) L: (1000) type: (2)\nCreate Cube Left Bottom Corner- X: (-15000) Y: (2500) Z: (-10000) H: (1000) W: (3000) L: (3000) type: (4)\nCreate Cube Left Bottom Corner- X: (-9000) Y: (6000) Z: (-8000) H: (1000) W: (4000) L: (10000) type: (1)\nCreate Cube Left Bottom Corner- X: (-9000) Y: (7000) Z: (-6000) H: (5000) W: (2000) L: (3000) type: (2)\nCreate Cube Left Bottom Corner- X: (-7000) Y: (7000) Z: (-1000) H: (5000) W: (2000) L: (3000) type: (2)\nCreate Cube Left Bottom Corner- X: (-9500) Y: (7000) Z: (-3000) H: (5000) W: (500) L: (5000) type: (2)\nCreate Cube Left Bottom Corner- X: (-9000) Y: (7000) Z: (4000) H: (1000) W: (3000) L: (3000) type: (4)\nCreate Cube Left Bottom Corner- X: (-9000) Y: (12000) Z: (-8000) H: (2000) W: (4000) L: (10000) type: (1)\nCreate Cube Left Bottom Corner- X: (-10000) Y: (14000) Z: (-4000) H: (1500) W: (6000) L: (1000) type: (2)\nCreate Cube Left Bottom Corner- X: (-9000) Y: (14000) Z: (-14000) H: (1000) W: (3000) L: (3000) type: (4)\nCreate Cube Left Bottom Corner- X: (-2000) Y: (20000) Z: (-2000) H: (1000) W: (4000) L: (4000) type: (3)\nCreate Cube Left Bottom Corner- X: (-2000) Y: (19000) Z: (-10000) H: (1000) W: (4000) L: (5000) type: (1)\n\ndefine LoopThroughCubesAndCollide\nset [loop# v] to [1]\nset [collided? v] to [0]\nrepeat until <(loop#) > (length of [cubex v])>\n    if <[deleted v] contains (loop#)?> then\n        repeat until <not <[deleted v] contains (loop#)?>>\n            change [loop# v] by (1)\n        end\n    end\n    if <<not <(posX) < (item (loop#) of [cubex v])>> and <not <(posX) > ((item (loop#) of [cubex v]) + (item (loop#) of [cubew v]))>>> then\n        if <<not <(posZ) < (item (loop#) of [cubez v])>> and <not <(posZ) > ((item (loop#) of [cubez v]) + (item (loop#) of [cubel v]))>>> then\n            if <<<((posY) - (1000)) > (item (loop#) of [cubey v])> and <((posY) - (1000)) < ((item (loop#) of [cubey v]) + (item (loop#) of [cubeh v]))>> or <<(posY) > (item (loop#) of [cubey v])> and <(posY) < ((item (loop#) of [cubey v]) + (item (loop#) of [cubeh v]))>>> then\n                if <(item (loop#) of [objecttype v]) = [1]> then\n                    if <<((posY) - (1000)) > (item (loop#) of [cubey v])> and <((posY) - (1000)) < ((item (loop#) of [cubey v]) + (item (loop#) of [cubeh v]))>> then\n                        set [collided? v] to [1]\n                    else\n                        set [collided? v] to [-1]\n                    end\n                    set [oldy v] to (posY)\n                    change [posy v] by ((0) - (gravity))\n                    if <(Collided?) = [1]> then\n                        if <((posY) - (1000)) < ((item (loop#) of [cubey v]) + (item (loop#) of [cubeh v]))> then\n                            set [posy v] to (((item (loop#) of [cubey v]) + (item (loop#) of [cubeh v])) + (1000))\n                        end\n                        if <((posY) - (1500)) > (oldY)> then\n                            change [posx v] by ((0) - ((SinHor) * (moveAcc)))\n                            change [posz v] by ((0) - ((CosHor) * (moveAcc)))\n                            change [posx v] by ((0) - (((0) - (CosHor)) * (SideAcc)))\n                            change [posz v] by ((0) - ((SinHor) * (SideAcc)))\n                            set [posy v] to ((oldY) + (10))\n                            set [moveacc v] to [0]\n                            set [sideacc v] to [0]\n                            set [collided? v] to [0]\n                        end\n                    else\n                        if <(posY) > (item (loop#) of [cubey v])> then\n                            set [posy v] to (item (loop#) of [cubey v])\n                        end\n                    end\n                    set [gravity v] to [0]\n                else\n                    if <(item (loop#) of [objecttype v]) = [2]> then\n                        change [attempts v] by (1)\n                        reset\n                    else\n                        if <(item (loop#) of [objecttype v]) = [4]> then\n                            set [gravity v] to [400]\n                        else\n                            if <(item (loop#) of [objecttype v]) = [3]> then\n                                change [score v] by ([ceiling v] of (((1000) * (level)) / (attempts)) )\n                                change [level v] by (1)\n                                set [attempts v] to [1]\n                                reset\n                            else\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [loop# v] by (1)\nend\n\ndefine Level3\nCreate Cube Left Bottom Corner- X: (-2000) Y: (-2000) Z: (5500) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-6000) Y: (-2000) Z: (13000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (0) Y: (0) Z: (17000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (0) Y: (2000) Z: (22000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-8000) Y: (2000) Z: (22000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-8000) Y: (2000) Z: (30500) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-2000) Y: (0) Z: (39000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (4000) Y: (0) Z: (46000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-2000) Y: (3000) Z: (51000) H: (1000) W: (4000) L: (4000) type: (3)\nCreate Cube Left Bottom Corner- X: (-20000) Y: (-10000) Z: (-5000) H: (25000) W: (4000) L: (60000) type: (2)\nCreate Cube Left Bottom Corner- X: (18000) Y: (-10000) Z: (-5000) H: (25000) W: (4000) L: (60000) type: (2)\nCreate Cube Left Bottom Corner- X: (-20000) Y: (-10000) Z: (-5000) H: (25000) W: (4000) L: (45000) type: (2)\nCreate Cube Left Bottom Corner- X: (18000) Y: (-10000) Z: (-5000) H: (25000) W: (4000) L: (45000) type: (2)\nCreate Cube Left Bottom Corner- X: (-20000) Y: (-10000) Z: (-5000) H: (25000) W: (4000) L: (15000) type: (2)\nCreate Cube Left Bottom Corner- X: (18000) Y: (-10000) Z: (-5000) H: (25000) W: (4000) L: (15000) type: (2)\n\ndefine moveObjects\nif <(level) = [2]> then\n    move object (2) by (-50) (0) (100) max (15000) (15000) (15000) min (-100000) (-100000) (2000)\n    move object (4) by (0) (150) (0) max (0) (8000) (20000) min (-30000) (-4000) (0)\n    move object (6) by (0) (0) (50) max (0) (20000) (17000) min (-40000) (0) (14000)\n    move object (7) by (0) (0) (70) max (0) (20000) (14000) min (-40000) (0) (11000)\n    move object (8) by (0) (100) (0) max (0) (11000) (20000) min (-40000) (7000) (10000)\n    move object (15) by (0) (13) (0) max (0) (9000) (20000) min (-40000) (7000) (-10000)\n    move object (16) by (0) (13) (0) max (0) (10000) (20000) min (-40000) (8000) (-10000)\n    move object (17) by (0) (13) (0) max (0) (11000) (20000) min (-40000) (9000) (-10000)\nelse\n    if <(level) = [3]> then\n        move object (11) by (21) (0) (0) max (-2000) (50000) (50000) min (-20000) (-50000) (-50000)\n        move object (12) by (21) (0) (0) max (18000) (50000) (50000) min (0) (-50000) (-50000)\n        move object (13) by (21) (0) (0) max (-2000) (50000) (50000) min (-20000) (-50000) (-50000)\n        move object (14) by (21) (0) (0) max (18000) (50000) (50000) min (0) (-50000) (-50000)\n        move object (15) by (21) (0) (0) max (-2000) (50000) (50000) min (-20000) (-50000) (-50000)\n        move object (16) by (21) (0) (0) max (18000) (50000) (50000) min (0) (-50000) (-50000)\n    else\n        if <(level) = [4]> then\n            move object (12) by (0) (0) (250) max (0) (5000) (11000) min (-40000) (-5000) (-5000)\n            move object (22) by (0) (0) (90) max (40000) (50000) (-26000) min (-40000) (-50000) (-34000)\n            move object (23) by (0) (0) (98) max (40000) (50000) (-26000) min (-40000) (-50000) (-34000)\n            move object (24) by (0) (0) (105) max (40000) (50000) (-26000) min (-40000) (-50000) (-34000)\n        else\n        end\n    end\nend\n\ndefine None\nset [#~draw x v] to (x1)\nset [#~draw y v] to (y1)\nif <(start size) > [1]> then\n    set [#~draw size v] to (start size)\nelse\n    set [#~draw size v] to [1]\nend\nif <(#~Draw Size) < (end size)> then\n    repeat until <((#~Draw Size) * (2)) > (end size)>\n        set [#~draw perc v] to ((((2) * (#~Draw Size)) - (start size)) / (size diff))\n        set [#~draw x new v] to ((x1) + ((x diff) * (#~Draw Perc)))\n        set [#~draw y new v] to ((y1) + ((y diff) * (#~Draw Perc)))\n        set pen size to (1)\n        go to x: ((#~Draw X New) - ((#~Draw Size) * (x normal))) y: ((#~Draw Y New) - ((#~Draw Size) * (y normal)))\n        pen down\n        set pen size to (#~Draw Size)\n        go to x: (#~Draw X) y: (#~Draw Y)\n        go to x: ((#~Draw X New) + ((#~Draw Size) * (x normal))) y: ((#~Draw Y New) + ((#~Draw Size) * (y normal)))\n        pen up\n        set [#~draw x v] to (#~Draw X New)\n        set [#~draw y v] to (#~Draw Y New)\n        set [#~draw size v] to ((#~Draw Size) * (2))\n    end\n    go to x: ((x2) - (((end size) - (#~Draw Size)) * (x normal))) y: ((y2) - (((end size) - (#~Draw Size)) * (y normal)))\n    set pen size to (1)\n    pen down\n    set pen size to (#~Draw Size)\n    go to x: (#~Draw X) y: (#~Draw Y)\n    go to x: ((x2) + (((end size) - (#~Draw Size)) * (x normal))) y: ((y2) + (((end size) - (#~Draw Size)) * (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 None\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 [#~distance 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)) / (#~Distance)) (((x1) - (x2)) / (#~Distance)) ((end size) - (start size)) ((x2) - (x1)) ((y2) - (y1))\n    else\n        int draw line (x2) (y2) (x1) (y1) (end size) (start size) (((y1) - (y2)) / (#~Distance)) (((x2) - (x1)) / (#~Distance)) ((start size) - (end size)) ((x1) - (x2)) ((y1) - (y2))\n    end\nend\n\ndefine Level4\nCreate Cube Left Bottom Corner- X: (-15000) Y: (-1000) Z: (-15000) H: (1000) W: (30000) L: (30000) type: (1)\nCreate Cube Left Bottom Corner- X: (-15000) Y: (0) Z: (12000) H: (5000) W: (3000) L: (3000) type: (5)\nCreate Cube Left Bottom Corner- X: (12000) Y: (0) Z: (12000) H: (5000) W: (3000) L: (3000) type: (5)\nCreate Cube Left Bottom Corner- X: (-1500) Y: (0) Z: (-15000) H: (5000) W: (3000) L: (3000) type: (5)\nCreate Cube Left Bottom Corner- X: (11000) Y: (0) Z: (11000) H: (5000) W: (5000) L: (5000) type: (2)\nCreate Cube Left Bottom Corner- X: (-2500) Y: (0) Z: (-16000) H: (5000) W: (5000) L: (5000) type: (2)\nCreate Cube Left Bottom Corner- X: (-2500) Y: (0) Z: (10000) H: (5000) W: (5000) L: (5000) type: (3)\nCreate Cube Left Bottom Corner- X: (-3500) Y: (0) Z: (9000) H: (5000) W: (7000) L: (7000) type: (2)\nCreate Cube Left Bottom Corner- X: (-30000) Y: (0) Z: (15000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-28000) Y: (1000) Z: (17000) H: (3000) W: (2000) L: (2000) type: (5)\nCreate Cube Left Bottom Corner- X: (-30000) Y: (0) Z: (-5000) H: (1000) W: (4000) L: (16000) type: (1)\nCreate Cube Left Bottom Corner- X: (-31000) Y: (1000) Z: (-5000) H: (1500) W: (6000) L: (1000) type: (2)\nCreate Cube Left Bottom Corner- X: (-30000) Y: (0) Z: (-12000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (10000) Y: (0) Z: (30000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (12000) Y: (1000) Z: (30000) H: (3000) W: (2000) L: (2000) type: (5)\nCreate Cube Left Bottom Corner- X: (10000) Y: (0) Z: (37500) H: (1000) W: (4000) L: (4000) type: (4)\nCreate Cube Left Bottom Corner- X: (0) Y: (3000) Z: (37500) H: (1000) W: (4000) L: (4000) type: (4)\nCreate Cube Left Bottom Corner- X: (-13000) Y: (3000) Z: (37500) H: (1000) W: (4000) L: (4000) type: (4)\nCreate Cube Left Bottom Corner- X: (-19000) Y: (10000) Z: (37500) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-15000) Y: (0) Z: (-30000) H: (1000) W: (4000) L: (4000) type: (1)\nCreate Cube Left Bottom Corner- X: (-15000) Y: (1000) Z: (-28000) H: (3000) W: (2000) L: (2000) type: (5)\nCreate Cube Left Bottom Corner- X: (-8000) Y: (0) Z: (-30000) H: (1000) W: (3000) L: (3000) type: (1)\nCreate Cube Left Bottom Corner- X: (-2500) Y: (1000) Z: (-30000) H: (1000) W: (3000) L: (3000) type: (1)\nCreate Cube Left Bottom Corner- X: (3000) Y: (2000) Z: (-30000) H: (1000) W: (3000) L: (3000) type: (1)\nCreate Cube Left Bottom Corner- X: (8500) Y: (3000) Z: (-30000) H: (1000) W: (3000) L: (3000) type: (1)\n\nSetLevel (4)\n\ndefine None\nset [level v] to (level)\nreset\n\ndefine Sort\nset [loop# v] to [1]\ndelete (all) of [sorted? v]\nrepeat (length of [objects v])\n    DistanceFrom (CamX) (CamY) (CamZ) ((item (loop#) of [cubex v]) + ((item (loop#) of [cubew v]) / (2))) ((item (loop#) of [cubey v]) + ((item (loop#) of [cubeh v]) / (2))) ((item (loop#) of [cubez v]) + ((item (loop#) of [cubel v]) / (2)))\n    set [innerloop# v] to [2]\n    repeat until <(Distance) > (item (innerLoop#) of [sorted? v])>\n        change [innerloop# v] by (2)\n    end\n    insert (Distance) at ((innerLoop#) - (1)) of [sorted? v] \n    insert (loop#) at ((innerLoop#) - (1)) of [sorted? v] \n    change [loop# v] by (1)\nend\n\n@Paused\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nwait until <(level) = []>\nwait until <(level) = [0]>\ngo to [front v] layer\nset [ghost v] effect to (30)\nforever\n    if <<(pause) = [0]> and <(Instructions) = [0]>> then\n        hide\n    else\n        set [ghost v] effect to (30)\n        show\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nswitch costume to (3d stage v)\nshow\nforever\n    set [ghost v] effect to (100)\nend\n\n@Settings\n\nwhen flag clicked\nset size to (100) %\ngo to x: (-183) y: (159)\nswitch costume to (costume1 v)\nhide\nwait until <(level) = [0]>\nwait until <(level) = [1]>\ngo to [front v] layer\nshow\nforever\n    if <(level) < [5]> then\n        if <(costume [number v]) = [1]> then\n            Touching Mouse? (x position) (y position) (95) (32)\n        else\n            Touching Mouse? (x position) (y position) (58) (32)\n        end\n        if <(touchingMouse?) = [1]> then\n            repeat until <(size) > [119]>\n                change size by (5)\n            end\n            if <mouse down?> then\n                if <(costume [number v]) = [1]> then\n                    set [pause v] to [1]\n                else\n                    set [pause v] to [0]\n                    set [instructions v] to [0]\n                end\n                next costume\n                wait until <not <mouse down?>>\n            end\n        else\n            repeat until <(size) < [101]>\n                change size by (-5)\n            end\n        end\n    else\n        hide\n    end\nend\n\ndefine None\nset [touchingmouse? v] to [0]\nif <<(mouse x) > ((x) - ((width) / (2)))> and <(mouse x) < ((x) + ((width) / (2)))>> then\n    if <<(mouse y) > ((y) - ((length) / (2)))> and <(mouse y) < ((y) + ((length) / (2)))>> then\n        set [touchingmouse? v] to [1]\n    end\nend\n\nwhen I receive [instructions v]\nswitch costume to (costume2 v)\n\n@PTE Bezier\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [sine v] to [0]\nset [text# v] to [1]\nset [introdone? v] to [0]\nforever\n    if <(IntroDone?) = [0]> then\n        erase all\n        if <(TextSize) < [45]> then\n            DoStuff\n        else\n            if <(Text#) > [7]> then\n                broadcast (Intro v)\n                set [introdone? v] to [1]\n                change [text# v] by (1)\n            end\n        end\n    end\nend\n\ndefine Import Font Code: []\ndelete (all) of [temp0 v]\ndelete (all) of [temp1 v]\nset [_i0 v] to [2]\nrepeat until <(letter (_i0) of (font code)) = [§]>\n    add (letter (_i0) of (font code)) to [temp0 v]\n    change [_i0 v] by (1)\nend\nchange [_i0 v] by (1)\nrepeat until <(letter (_i0) of (font code)) = [§]>\n    add (letter (_i0) of (font code)) to [temp1 v]\n    change [_i0 v] by (1)\nend\ndelete (all) of [\['concatenate:with:', '“', \['concatenate:with:', \['contentsoflist:', 'temp0'\], \['concatenate:with:', '” by ', \['concatenate:with:', \['contentsoflist:', 'temp1'\], ' | pen font'\]\]\]\] v]\nadd (font code) to [\['concatenate:with:', '“', \['concatenate:with:', \['contentsoflist:', 'temp0'\], \['concatenate:with:', '” by ', \['concatenate:with:', \['contentsoflist:', 'temp1'\], ' | pen font'\]\]\]\] v]\n\ndefine None\nif <(align) = [r]> then\n    set [_i4 v] to (length of [temp0 v])\n    set [_i5 v] to [1]\n    repeat (_i4)\n        set [_x v] to ((x) + (_i2))\n        set [_i6 v] to (item (_i5) of [temp0 v])\n        set [_i7 v] to (length of (_i6))\n        set [_i8 v] to (_i7)\n        repeat (_i7)\n            set [_i9 v] to ([\['letter:of:', \['readvariable', '_i8'\], \['readvariable', '_i6'\]\] v] of [pte bezier v])\n            change [_x v] by ((-1) * (((_i0) * (join (letter (1) of (_i9)) (join (letter (2) of (_i9)) (letter (3) of (_i9))))) + (_i2)))\n            Print Character\n            change [_i8 v] by (-1)\n        end\n        change [_y v] by (_i3)\n        change [_i5 v] by (1)\n    end\nelse\n    set [_i4 v] to (length of [temp0 v])\n    set [_i5 v] to [1]\n    repeat (_i4)\n        if <(align) = [c]> then\n            set [_x v] to ((x) - ((0.5) * (item (_i5) of [temp1 v])))\n        else\n            set [_x v] to (x)\n        end\n        set [_i6 v] to (item (_i5) of [temp0 v])\n        set [_i7 v] to (length of (_i6))\n        set [_i8 v] to [1]\n        repeat (_i7)\n            set [_i9 v] to ([\['letter:of:', \['readvariable', '_i8'\], \['readvariable', '_i6'\]\] v] of [pte bezier v])\n            Print Character\n            change [_x v] by (((_i0) * (join (letter (1) of (_i9)) (join (letter (2) of (_i9)) (letter (3) of (_i9))))) + (_i2))\n            change [_i8 v] by (1)\n        end\n        change [_y v] by (_i3)\n        change [_i5 v] by (1)\n    end\nend\npen up\n\ndefine None\npen up\nset pen color to ((((round (r)) * (65536)) + ((round (g)) * (256))) + (round (b)))\nset pen size to ((0.1) * ((size) * (weight)))\nset [_x v] to (x)\nset [_y v] to (y)\nset [_i0 v] to ((0.01) * (size))\nset [_i1 v] to ([tan v] of (slant) )\nset [_i2 v] to ((char space) * ((0.3) * (size)))\nset [_i3 v] to (((-0.6) * ((line space) * (size))) - (size))\nset [_i13 v] to (([ceiling v] of ((0.15) * (size)) ) + (2))\nset [_i14 v] to ((1) / (([ceiling v] of ((0.15) * (size)) ) + (1)))\nset [_i4 v] to (length of (text))\nset [_i5 v] to (((_i0) * (join (letter (1) of ([  v] of [pte bezier v])) (join (letter (2) of ([  v] of [pte bezier v])) (letter (3) of ([  v] of [pte bezier v]))))) + (_i2))\nset [_i6 v] to ((ww width) + (_i2))\ndelete (all) of [temp0 v]\ndelete (all) of [temp1 v]\nset [_i7 v] to [1]\nset [_i8 v] to []\nset [_i9 v] to [0]\nset [_i10 v] to []\nset [_i11 v] to [0]\nrepeat (_i4)\n    set [_i12 v] to (((_i0) * (join (letter (1) of ([\['letter:of:', \['readvariable', '_i7'\], \['getparam', 'text', 'r'\]\] v] of [pte bezier v])) (join (letter (2) of ([\['letter:of:', \['readvariable', '_i7'\], \['getparam', 'text', 'r'\]\] v] of [pte bezier v])) (letter (3) of ([\['letter:of:', \['readvariable', '_i7'\], \['getparam', 'text', 'r'\]\] v] of [pte bezier v]))))) + (_i2))\n    if <<(letter (_i7) of (text)) = [ ]> and <not <(letter ((_i7) + (1)) of (text)) = [ ]>>> then\n        if <(_i10) = []> then\n            set [_i10 v] to (_i8)\n            set [_i11 v] to (_i9)\n            set [_i8 v] to []\n            set [_i9 v] to [0]\n        else\n            if <((_i11) + ((_i9) + (_i5))) > (_i6)> then\n                add (_i10) to [temp0 v]\n                add ((_i11) - (_i2)) to [temp1 v]\n                set [_i10 v] to (_i8)\n                set [_i11 v] to (_i9)\n                set [_i8 v] to []\n                set [_i9 v] to [0]\n            else\n                set [_i10 v] to (join (_i10) (join [ ] (_i8)))\n                change [_i11 v] by ((_i9) + (_i5))\n                set [_i8 v] to []\n                set [_i9 v] to [0]\n            end\n        end\n    else\n        if <((_i9) + (_i12)) > (_i6)> then\n            if <(_i10) = []> then\n                add (_i8) to [temp0 v]\n                add ((_i9) - (_i2)) to [temp1 v]\n                set [_i8 v] to (letter (_i7) of (text))\n                set [_i9 v] to (_i12)\n            else\n                add (_i10) to [temp0 v]\n                add ((_i11) - (_i2)) to [temp1 v]\n                set [_i10 v] to []\n                set [_i11 v] to [0]\n                add (_i8) to [temp0 v]\n                add ((_i9) - (_i2)) to [temp1 v]\n                set [_i8 v] to (letter (_i7) of (text))\n                set [_i9 v] to (_i12)\n            end\n        else\n            set [_i8 v] to (join (_i8) (letter (_i7) of (text)))\n            change [_i9 v] by (_i12)\n        end\n    end\n    change [_i7 v] by (1)\nend\nif <not <(_i8) = []>> then\n    if <not <(_i10) = []>> then\n        if <((_i11) + ((_i9) + (_i5))) > (_i6)> then\n            add (_i10) to [temp0 v]\n            add ((_i11) - (_i2)) to [temp1 v]\n            add (_i8) to [temp0 v]\n            add ((_i9) - (_i2)) to [temp1 v]\n        else\n            set [_i10 v] to (join (_i10) (join [ ] (_i8)))\n            change [_i11 v] by ((_i9) + (_i5))\n            add (_i10) to [temp0 v]\n            add ((_i11) - (_i2)) to [temp1 v]\n        end\n    else\n        add (_i8) to [temp0 v]\n        add ((_i9) - (_i2)) to [temp1 v]\n    end\nelse\n    if <not <(_i10) = []>> then\n        add (_i10) to [temp0 v]\n        add ((_i11) - (_i2)) to [temp1 v]\n    end\nend\nRender WW (_x) (align)\n\ndefine None\npen up\nset pen color to ((((round (r)) * (65536)) + ((round (g)) * (256))) + (round (b)))\nset pen size to ([ceiling v] of ((0.1) * ((size) * (weight))) )\nset [_x v] to (x)\nset [_y v] to (y)\nset [_i0 v] to ((0.01) * (size))\nset [_i1 v] to ([tan v] of (slant) )\nset [_i2 v] to ((spacing) * ((0.3) * (size)))\nset [_i13 v] to (([ceiling v] of ((0.15) * (size)) ) + (2))\nset [_i14 v] to ((1) / (([ceiling v] of ((0.15) * (size)) ) + (1)))\nset [_i3 v] to (length of (text))\nif <(align) = [c]> then\n    set [_i4 v] to [1]\n    set [_i5 v] to [0]\n    repeat (_i3)\n        set [_i6 v] to ([\['letter:of:', \['readvariable', '_i4'\], \['getparam', 'text', 'r'\]\] v] of [pte bezier v])\n        change [_i5 v] by (((_i0) * (join (letter (1) of (_i6)) (join (letter (2) of (_i6)) (letter (3) of (_i6))))) + (_i2))\n        change [_i4 v] by (1)\n    end\n    change [_x v] by ((-0.5) * ((_i5) - (_i2)))\nend\nif <(align) = [r]> then\n    change [_x v] by (_i2)\n    set [_i4 v] to (_i3)\n    repeat (_i3)\n        set [_i9 v] to ([\['letter:of:', \['readvariable', '_i4'\], \['getparam', 'text', 'r'\]\] v] of [pte bezier v])\n        change [_x v] by ((-1) * (((_i0) * (join (letter (1) of (_i9)) (join (letter (2) of (_i9)) (letter (3) of (_i9))))) + (_i2)))\n        Print Character\n        change [_i4 v] by (-1)\n    end\nelse\n    set [_i4 v] to [1]\n    repeat (_i3)\n        set [_i9 v] to ([\['letter:of:', \['readvariable', '_i4'\], \['getparam', 'text', 'r'\]\] v] of [pte bezier v])\n        Print Character\n        change [_x v] by (((_i0) * (join (letter (1) of (_i9)) (join (letter (2) of (_i9)) (letter (3) of (_i9))))) + (_i2))\n        change [_i4 v] by (1)\n    end\nend\npen up\n\ndefine None\nset [_i15 v] to [0]\nrepeat (_i13)\n    set [_i16 v] to (((y1) + (((y2) - (y1)) * (_i15))) + ((((y2) + (((y3) - (y2)) * (_i15))) - ((y1) + (((y2) - (y1)) * (_i15)))) * (_i15)))\n    go to x: ((_x) + ((_i0) * ((((x1) + (((x2) - (x1)) * (_i15))) + ((((x2) + (((x3) - (x2)) * (_i15))) - ((x1) + (((x2) - (x1)) * (_i15)))) * (_i15))) + ((_i1) * (_i16))))) y: ((_y) + ((_i0) * (_i16)))\n    change [_i15 v] by (_i14)\nend\n\ndefine Print Character\nset [_i10 v] to (length of (_i9))\nset [_i11 v] to [4]\nrepeat until <(_i11) > (_i10)>\n    if <(letter (_i11) of (_i9)) = [d]> then\n        pen down\n        change [_i11 v] by (1)\n    else\n        if <(letter (_i11) of (_i9)) = [u]> then\n            pen up\n            change [_i11 v] by (1)\n        else\n            if <(letter (_i11) of (_i9)) = [b]> then\n                Draw Bezier (join (letter ((_i11) + (1)) of (_i9)) (join (letter ((_i11) + (2)) of (_i9)) (letter ((_i11) + (3)) of (_i9)))) (join (letter ((_i11) + (4)) of (_i9)) (join (letter ((_i11) + (5)) of (_i9)) (letter ((_i11) + (6)) of (_i9)))) (join (letter ((_i11) + (7)) of (_i9)) (join (letter ((_i11) + (8)) of (_i9)) (letter ((_i11) + (9)) of (_i9)))) (join (letter ((_i11) + (10)) of (_i9)) (join (letter ((_i11) + (11)) of (_i9)) (letter ((_i11) + (12)) of (_i9)))) (join (letter ((_i11) + (13)) of (_i9)) (join (letter ((_i11) + (14)) of (_i9)) (letter ((_i11) + (15)) of (_i9)))) (join (letter ((_i11) + (16)) of (_i9)) (join (letter ((_i11) + (17)) of (_i9)) (letter ((_i11) + (18)) of (_i9))))\n                change [_i11 v] by (19)\n            else\n                set [_i12 v] to (join (letter ((_i11) + (3)) of (_i9)) (join (letter ((_i11) + (4)) of (_i9)) (letter ((_i11) + (5)) of (_i9))))\n                go to x: ((_x) + ((_i0) * ((join (letter (_i11) of (_i9)) (join (letter ((_i11) + (1)) of (_i9)) (letter ((_i11) + (2)) of (_i9)))) + ((_i1) * (_i12))))) y: ((_y) + ((_i0) * (_i12)))\n                change [_i11 v] by (6)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [textsize v] to [45]\nset [texttime v] to [0]\nrepeat until <(Text#) > [8]>\n    NewText\nend\n\ndefine Load Font: %m.list\ndelete (all) of [temp0 v]\nset [_i0 v] to [2]\nrepeat (2)\n    repeat until <(letter (_i0) of (item (1) of [\['getparam', 'font', 'r'\] v])) = [§]>\n        change [_i0 v] by (1)\n    end\n    change [_i0 v] by (1)\nend\nset [_i1 v] to (length of (item (1) of [\['getparam', 'font', 'r'\] v]))\nrepeat until <(_i0) > (_i1)>\n    set [_i2 v] to (letter (_i0) of (item (1) of [\['getparam', 'font', 'r'\] v]))\n    change [_i0 v] by (1)\n    repeat until <(letter (_i0) of (item (1) of [\['getparam', 'font', 'r'\] v])) = [§]>\n        add (letter (_i0) of (item (1) of [\['getparam', 'font', 'r'\] v])) to [temp0 v]\n        change [_i0 v] by (1)\n    end\n    set [\['readvariable', '_i2'\] v] to (Temp0)\n    delete (all) of [temp0 v]\n    change [_i0 v] by (1)\nend\n\nwhen flag clicked\nset [texttime v] to [0]\nforever\n    wait (3) seconds\n    change [texttime v] by (1)\nend\n\ndefine NewText\nset [currenttexttime v] to (textTime)\nset [currenttext# v] to [1]\nrepeat until <<not <(textTime) = (CurrentTextTime)>> or <(CurrentText#) > [10]>>\n    change [textsize v] by (-3)\n    change [currenttext# v] by (1)\nend\nwait until <not <(textTime) = (CurrentTextTime)>>\nset [textsize v] to [15]\nrepeat (10)\n    change [textsize v] by (3)\nend\nchange [text# v] by (1)\n\ndefine DoStuff\nset [size v] to ((15) + (([cos v] of (Sine) ) * (2)))\nif <(Text#) = [1]> then\n    Print Text: [Once upon a time, there was a ] (X, Y): (([sin v] of (Sine) ) * (10)) (([cos v] of (Sine) ) * (10)) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n    Print Text: [stick figure, green in color.] (X, Y): (([sin v] of (Sine) ) * (10)) ((([cos v] of (Sine) ) * (10)) - ((Size) * (2))) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n    change [sine v] by (10)\nelse\n    if <(Text#) = [2]> then\n        Print Text: [Who lived in a world] (X, Y): (([sin v] of (Sine) ) * (10)) (([cos v] of (Sine) ) * (10)) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n        Print Text: [called "Scratch"] (X, Y): (([sin v] of (Sine) ) * (10)) ((([cos v] of (Sine) ) * (10)) - ((Size) * (2))) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n        change [sine v] by (10)\n    else\n        if <(Text#) = [3]> then\n            Print Text: [Where most games] (X, Y): (([sin v] of (Sine) ) * (10)) (([cos v] of (Sine) ) * (10)) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n            Print Text: [were two dimensional.] (X, Y): (([sin v] of (Sine) ) * (10)) ((([cos v] of (Sine) ) * (10)) - ((Size) * (2))) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n            change [sine v] by (10)\n        else\n            if <(Text#) = [4]> then\n                Print Text: [But one day....] (X, Y): (([sin v] of (Sine) ) * (10)) (([cos v] of (Sine) ) * (10)) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n                change [sine v] by (10)\n            else\n                if <(Text#) = [5]> then\n                    Print Text: [A new world appeared] (X, Y): (([sin v] of (Sine) ) * (10)) (([cos v] of (Sine) ) * (10)) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n                    Print Text: [with three dimensions!] (X, Y): (([sin v] of (Sine) ) * (10)) ((([cos v] of (Sine) ) * (10)) - ((Size) * (2))) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n                    change [sine v] by (10)\n                else\n                    if <(Text#) = [6]> then\n                        Print Text: [But with an extra dimension] (X, Y): (([sin v] of (Sine) ) * (10)) (([cos v] of (Sine) ) * (10)) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n                        Print Text: [came extra challenges] (X, Y): (([sin v] of (Sine) ) * (10)) ((([cos v] of (Sine) ) * (10)) - ((Size) * (2))) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n                        change [sine v] by (10)\n                    else\n                        if <(Text#) = [7]> then\n                            Print Text: [Because This is....] (X, Y): (([sin v] of (Sine) ) * (10)) (([cos v] of (Sine) ) * (10)) Size: (Size) RGB: ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) ((255) - (((TextSize) - (15)) * (8))) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\n                            change [sine v] by (10)\n                        else\n                            broadcast (Intro v)\n                            set [introdone? v] to [1]\n                            change [text# v] by (1)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [finish v]\nFinish\n\ndefine Finish\nerase all\nset [size v] to ((15) + (([cos v] of (Sine) ) * (2)))\nPrint Text: [You finished the game!] (X, Y): (([sin v] of (Sine) ) * (10)) (([cos v] of (Sine) ) * (10)) Size: (Size) RGB: (255) (255) (255) Weight: (1) Slant: (0) Spacing: (1) Alignment: [c]\nchange [sine v] by (10)\n\n@3d logo\n\nwhen flag clicked\nswitch costume to (3d logo v)\nhide\n\nwhen I receive [intro v]\nset [introvely v] to [0]\nset y to (180)\nshow\nrepeat until <(IntroVelY) = [e]>\n    Bounce\nend\nglide (0.3) secs to x: (0) y: (150)\nset [level v] to [0]\nnext costume\n\ndefine Bounce\nchange y by (IntroVelY)\nchange [introvely v] by (-1.5)\nif <(y position) < [0]> then\n    set y to (0)\n    set [introvely v] to ((IntroVelY) * (-0.7))\n    if <(round (IntroVelY)) < [12]> then\n        set [introvely v] to [e]\n    end\nend\n\nwhen I receive [start v]\nhide\nset [start v] to [1]\n\n@Buttons\n\nwhen flag clicked\nClone\n\nwhen I start as a clone\nset size to (50) %\nwait until <(level) = []>\nwait until <(level) = [0]>\nshow\nglide (0.3) secs to x: (-155) y: (y position)\nforever\n    if <(costume [number v]) = [1]> then\n        if <(Credits) = [0]> then\n            Touching Mouse? (x position) (y position) (105) (45)\n            if <(touchingMouse?) = [1]> then\n                repeat until <(size) > [59]>\n                    change size by (2.5)\n                end\n                if <mouse down?> then\n                    set [credits v] to [0]\n                    broadcast (Start v)\n                end\n            else\n                repeat until <(size) < [51]>\n                    change size by (-2.5)\n                end\n            end\n        end\n    else\n        if <(costume [number v]) = [2]> then\n            Touching Mouse? (x position) (y position) (131) (45)\n            if <(touchingMouse?) = [1]> then\n                repeat until <(size) > [59]>\n                    change size by (2.5)\n                end\n                if <mouse down?> then\n                    set [credits v] to [1]\n                    switch costume to (play3 v)\n                    go to x: (-170) y: (-150)\n                    set size to (40) %\n                end\n            else\n                repeat until <(size) < [51]>\n                    change size by (-2.5)\n                end\n            end\n        else\n            go to [front v] layer\n            Touching Mouse? (x position) (y position) (105) (45)\n            if <(touchingMouse?) = [1]> then\n                repeat until <(size) > [49]>\n                    change size by (2.5)\n                end\n                if <mouse down?> then\n                    set [credits v] to [0]\n                    switch costume to (credits2 v)\n                    go to x: (-155) y: (-74)\n                    set size to (50) %\n                end\n            else\n                repeat until <(size) < [41]>\n                    change size by (-2.5)\n                end\n            end\n        end\n    end\nend\n\ndefine Clone\nhide\ngo to x: (-275) y: (6)\nswitch costume to (play2 v)\ncreate clone of (_myself_ v)\nchange y by (-80)\nswitch costume to (credits2 v)\ncreate clone of (_myself_ v)\n\nwhen I receive [start v]\ndelete this clone\n\ndefine None\nset [touchingmouse? v] to [0]\nif <<(mouse x) > ((x) - ((width) / (2)))> and <(mouse x) < ((x) + ((width) / (2)))>> then\n    if <<(mouse y) > ((y) - ((length) / (2)))> and <(mouse y) < ((y) + ((length) / (2)))>> then\n        set [touchingmouse? v] to [1]\n    end\nend\n\n@Skip\n\nwhen flag clicked\nset size to (100) %\ngo to x: (197) y: (-157)\nshow\nwait until <(Text#) < [8]>\nrepeat until <(Text#) > [7]>\n    Touching Mouse? (x position) (y position) (40) (23)\n    if <(touchingMouse?) = [1]> then\n        repeat until <(size) > [119]>\n            change size by (5)\n        end\n        if <mouse down?> then\n            set [text# v] to [8]\n        end\n    else\n        repeat until <(size) < [101]>\n            change size by (-5)\n        end\n    end\nend\nhide\n\ndefine None\nset [touchingmouse? v] to [0]\nif <<(mouse x) > ((x) - ((width) / (2)))> and <(mouse x) < ((x) + ((width) / (2)))>> then\n    if <<(mouse y) > ((y) - ((length) / (2)))> and <(mouse y) < ((y) + ((length) / (2)))>> then\n        set [touchingmouse? v] to [1]\n    end\nend\n\n@Option Name\n\nwhen flag clicked\nhide\nwait until <(level) = [0]>\nwait until <(level) = [1]>\ngo to [front v] layer\nforever\n    if <(pause) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@Option\n\nwhen flag clicked\nhide\nset size to (100) %\nClones\nset x to (-44.6)\nset [camspeed v] to [7]\nwait until <(level) = [0]>\nwait until <(level) = [1]>\nset y to (56)\ngo to [front v] layer\nswitch costume to (costume4 v)\nforever\n    if <(pause) = [1]> then\n        show\n        Touching Mouse? (-39) (y position) (56) (13)\n        if <(touchingMouse?) = [1]> then\n            repeat until <not <mouse down?>>\n                SetX (1)\n            end\n        end\n    else\n        hide\n    end\nend\n\ndefine Clones\ngo to x: (-39) y: (96)\nrepeat (7)\n    create clone of (_myself_ v)\n    change y by (-47)\nend\ngo to x: (206) y: (96)\nrepeat (1)\n    create clone of (_myself_ v)\n    change y by (-47)\nend\n\ndefine None\nset [touchingmouse? v] to [0]\nif <<(mouse x) > ((x) - ((width) / (2)))> and <(mouse x) < ((x) + ((width) / (2)))>> then\n    if <<(mouse y) > ((y) - ((length) / (2)))> and <(mouse y) < ((y) + ((length) / (2)))>> then\n        set [touchingmouse? v] to [1]\n    end\nend\n\ndefine None\nif <(y) = [0]> then\n    set [playerview? v] to [1]\n    switch costume to (costume2 v)\nelse\n    if <(y) = [2]> then\n        set [effects v] to [1]\n        switch costume to (costume1 v)\n    else\n        if <(y) = [3]> then\n            set [sort? v] to [1]\n            switch costume to (costume1 v)\n        else\n            if <(y) = [4]> then\n                set [linesize v] to [1]\n                switch costume to (costume1 v)\n            else\n                if <(y) = [1]> then\n                    switch costume to (costume3 v)\n                else\n                    if <(y) = [5]> then\n                        switch costume to (costume5 v)\n                    else\n                        if <(y) = [6]> then\n                            switch costume to (costume4 v)\n                            set y to (-132)\n                            set [fov v] to [240]\n                            set x to (-39)\n                        else\n                            set [mouse? v] to [0]\n                            switch costume to (costume2 v)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine None\nset x to (mouse x)\nif <(x position) < [-67]> then\n    set x to (-67)\nelse\n    if <(x position) > [-11]> then\n        set x to (-11)\n    end\nend\nif <(type) = [1]> then\n    set [camspeed v] to ((11) - (round ((((x position) - (-67)) / (56)) * (10))))\nelse\n    set [fov v] to ((60) + (round ((((x position) - (-67)) / (56)) * (60))))\n    set [fov v] to (round ((240) / ([tan v] of ((FOV) / (2)) )))\nend\n\nwhen I start as a clone\nwait until <(level) = [0]>\nwait until <(level) = [1]>\ngo to [front v] layer\nif <(x position) < [0]> then\n    DefaultValues (round (((96) - (y position)) / (47)))\nelse\n    DefaultValues ((7) + (round (((96) - (y position)) / (47))))\nend\nforever\n    if <(pause) = [1]> then\n        show\n        if <(costume [number v]) = [1]> then\n            Touching Mouse? (x position) (y position) (43) (32)\n        else\n            if <(costume [number v]) < [3]> then\n                Touching Mouse? (x position) (y position) (54) (32)\n            else\n                Touching Mouse? (-39) (y position) (56) (13)\n            end\n        end\n        if <(costume [number v]) < [3]> then\n            if <(touchingMouse?) = [1]> then\n                repeat until <(size) > [120]>\n                    change size by (5)\n                end\n                if <mouse down?> then\n                    if <(costume [number v]) = [1]> then\n                        switch costume to (costume2 v)\n                    else\n                        switch costume to (costume1 v)\n                    end\n                    if <(x position) < [0]> then\n                        MouseDown (round (((96) - (y position)) / (47)))\n                    else\n                        MouseDown ((7) + (round (((96) - (y position)) / (47))))\n                    end\n                    repeat until <(size) < [101]>\n                        change size by (-5)\n                    end\n                    wait until <not <mouse down?>>\n                end\n            else\n                repeat until <(size) < [101]>\n                    change size by (-5)\n                end\n            end\n        else\n            if <(costume [number v]) = [4]> then\n                if <(touchingMouse?) = [1]> then\n                    repeat until <not <mouse down?>>\n                        SetX (2)\n                    end\n                end\n            end\n        end\n    else\n        hide\n    end\nend\n\ndefine None\nif <(y) = [0]> then\n    set [playerview? v] to ((costume [number v]) - (1))\nelse\n    if <(y) = [2]> then\n        set [effects v] to ((1) - ((costume [number v]) - (1)))\n    else\n        if <(y) = [3]> then\n            set [sort? v] to ((1) - ((costume [number v]) - (1)))\n        else\n            if <(y) = [4]> then\n                set [linesize v] to ((1) - ((costume [number v]) - (1)))\n            else\n                if <(y) = [7]> then\n                    set [mouse? v] to ((1) - ((costume [number v]) - (1)))\n                else\n                end\n            end\n        end\n    end\nend\n\n@Credits\n\nwhen flag clicked\nClone\nset [creditsmove v] to [0]\nforever\n    if <(Credits) = [1]> then\n        show\n        set size to ((105) + (([cos v] of (CreditsMove) ) * (5))) %\n        change [creditsmove v] by (10)\n    else\n        go to [front v] layer\n        hide\n    end\nend\n\ndefine Clone\nset [credits v] to [0]\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset size to (105) %\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [creditsmove v] to [0]\nswitch costume to (costume3 v)\nforever\n    if <(Credits) = [1]> then\n        show\n        set x to (([sin v] of (CreditsMove) ) * (10))\n        set y to (10)\n        set size to ((105) + (([cos v] of (CreditsMove) ) * (10))) %\n        change [creditsmove v] by (10)\n    else\n        go to [front v] layer\n        hide\n    end\nend\n\n@Instructions\n\nwhen flag clicked\nset [instructions v] to [0]\nset size to (100) %\ngo to x: (155) y: (159)\nswitch costume to (costume1 v)\nhide\nwait until <(level) = [0]>\nwait until <(level) = [1]>\ngo to [front v] layer\nshow\nforever\n    if <<(pause) = [0]> and <(level) < [5]>> then\n        show\n        Touching Mouse? (x position) (y position) (140) (32)\n        if <(touchingMouse?) = [1]> then\n            repeat until <(size) > [119]>\n                change size by (5)\n            end\n            if <mouse down?> then\n                set [instructions v] to [1]\n                broadcast (Instructions v)\n                set size to (100) %\n                hide\n                wait until <(Instructions) = [0]>\n                show\n            end\n        else\n            repeat until <(size) < [101]>\n                change size by (-5)\n            end\n        end\n    else\n        hide\n    end\nend\n\ndefine None\nset [touchingmouse? v] to [0]\nif <<(mouse x) > ((x) - ((width) / (2)))> and <(mouse x) < ((x) + ((width) / (2)))>> then\n    if <<(mouse y) > ((y) - ((length) / (2)))> and <(mouse y) < ((y) + ((length) / (2)))>> then\n        set [touchingmouse? v] to [1]\n    end\nend\n\n@Option Name2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nwait until <(level) = [0]>\nwait until <(level) = [1]>\ngo to [front v] layer\nforever\n    if <(Instructions) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n