3D Platformer -6k Contest Entry-
@Stage\n\nwhen flag clicked\nforever\n    play sound [The face of innocence v] until done\nend\n\n@Screenshot_2020-04-22 Scratch - 3D Platformer\n\nwhen flag clicked\nset size to (110) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\n@Sprite1\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\n\nwhen [k v] key pressed\nhide\n\n@3D\n\ndefine Sort Lists\nset [passes v] to [0]\nset [switches v] to [0]\nrepeat until <<(Passes) > [0]> and <(Switches) = [0]>>\n    set [list_item v] to [0]\n    change [passes v] by (1)\n    set [switches v] to [0]\n    repeat ((length of [block distances v]) - (1))\n        change [list_item v] by (1)\n        if <(item ((List_Item) + (1)) of [block distances v]) > (item (List_Item) of [block distances v])> then\n            set [value v] to (item ((List_Item) + (1)) of [block distances v])\n            replace item ((List_Item) + (1)) of [block distances v] with (item (List_Item) of [block distances v])\n            replace item (List_Item) of [block distances v] with (value)\n            set [value v] to (item ((List_Item) + (1)) of [cube y pos v])\n            replace item ((List_Item) + (1)) of [cube y pos v] with (item (List_Item) of [cube y pos v])\n            replace item (List_Item) of [cube y pos v] with (value)\n            set [value v] to (item ((List_Item) + (1)) of [cube x pos v])\n            replace item ((List_Item) + (1)) of [cube x pos v] with (item (List_Item) of [cube x pos v])\n            replace item (List_Item) of [cube x pos v] with (value)\n            set [value v] to (item ((List_Item) + (1)) of [cube z pos v])\n            replace item ((List_Item) + (1)) of [cube z pos v] with (item (List_Item) of [cube z pos v])\n            replace item (List_Item) of [cube z pos v] with (value)\n            set [value v] to (item ((List_Item) + (1)) of [platform type v])\n            replace item ((List_Item) + (1)) of [platform type v] with (item (List_Item) of [platform type v])\n            replace item (List_Item) of [platform type v] with (value)\n            change [switches v] by (1)\n        end\n    end\nend\n\ndefine Distance\ndelete all of [block distances v]\nset [iii v] to [0]\nrepeat (length of [cube x pos v])\n    change [iii v] by (1)\n    add (round ([sqrt v] of ((((cam z) - (item (iii) of [cube z pos v])) * ((cam z) - (item (iii) of [cube z pos v]))) + ((((cam y) - (item (iii) of [cube y pos v])) * ((cam y) - (item (iii) of [cube y pos v]))) + (((cam x) - (item (iii) of [cube x pos v])) * ((cam x) - (item (iii) of [cube x pos v]))))) )) to [block distances v]\nend\n\ndefine Set Point 1: (x1) (y1) (z1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\nset [z1 v] to (z1)\n\ndefine Set Point 2: (x2) (y2) (z2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nset [z2 v] to (z2)\n\ndefine 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    XY Clipping\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 Put Cube at (x) (y) (z) (platform type)\nCalculate Trig Values\nSelect color (platform type)\nDraw Square ((x) * (100)) ((y) * (100)) ((50) + ((z) * (100)))\nDraw Line ((50) + ((x) * (100))) ((50) + ((y) * (100))) ((50) + ((z) * (100))) to ((50) + ((x) * (100))) ((50) + ((y) * (100))) ((-50) + ((z) * (100)))\nDraw Line ((50) + ((x) * (100))) ((-50) + ((y) * (100))) ((50) + ((z) * (100))) to ((50) + ((x) * (100))) ((-50) + ((y) * (100))) ((-50) + ((z) * (100)))\nDraw Line ((-50) + ((x) * (100))) ((-50) + ((y) * (100))) ((50) + ((z) * (100))) to ((-50) + ((x) * (100))) ((-50) + ((y) * (100))) ((-50) + ((z) * (100)))\nDraw Line ((-50) + ((x) * (100))) ((50) + ((y) * (100))) ((50) + ((z) * (100))) to ((-50) + ((x) * (100))) ((50) + ((y) * (100))) ((-50) + ((z) * (100)))\nDraw Square ((x) * (100)) ((y) * (100)) ((-50) + ((z) * (100)))\n\ndefine Calculate Trig Values\nset [sin x v] to ([sin v] of (rot Y) )\nset [cos x v] to ([cos v] of (rot Y) )\nset [sin y v] to ([sin v] of (rot X) )\nset [cos y v] to ([cos v] of (rot 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 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 Turn and Move\nif <(Mode) = [computer]> then\n    if <key (up arrow v) pressed?> then\n        change [rot y v] by (4)\n    end\n    if <key (left arrow v) pressed?> then\n        change [rot x v] by (4)\n    end\n    if <key (right arrow v) pressed?> then\n        change [rot x v] by (-4)\n    end\n    if <key (down arrow v) pressed?> then\n        change [rot y v] by (-4)\n    end\n    if <key (w v) pressed?> then\n        change [zvel v] by ((2) * (cos Y))\n        change [xvel v] by ((-2) * (sin Y))\n    end\n    if <key (s v) pressed?> then\n        change [zvel v] by ((-2) * (cos Y))\n        change [xvel v] by ((2) * (sin Y))\n    end\n    if <key (a v) pressed?> then\n        change [zvel v] by ((-2) * (sin Y))\n        change [xvel v] by ((-2) * (cos Y))\n    end\n    if <key (d v) pressed?> then\n        change [zvel v] by ((2) * (sin Y))\n        change [xvel v] by ((2) * (cos Y))\n    end\nelse\n    if <<mouse down?> and <<<(mouse y) < [-80]> and <(mouse y) > [-110]>> and <<(mouse x) < [-175]> and <(mouse x) > [-205]>>>> then\n        change [zvel v] by ((2) * (cos Y))\n        change [xvel v] by ((-2) * (sin Y))\n    end\n    if <<mouse down?> and <<<(mouse y) < [-150]> and <(mouse y) > [-180]>> and <<(mouse x) < [-175]> and <(mouse x) > [-205]>>>> then\n        change [zvel v] by ((-2) * (cos Y))\n        change [xvel v] by ((2) * (sin Y))\n    end\n    if <<mouse down?> and <<<(mouse y) < [-115]> and <(mouse y) > [-145]>> and <<(mouse x) < [-140]> and <(mouse x) > [-170]>>>> then\n        change [zvel v] by ((2) * (sin Y))\n        change [xvel v] by ((2) * (cos Y))\n    end\n    if <<mouse down?> and <<<(mouse y) < [-115]> and <(mouse y) > [-145]>> and <<(mouse x) < [-210]> and <(mouse x) > [-240]>>>> then\n        change [zvel v] by ((-2) * (sin Y))\n        change [xvel v] by ((-2) * (cos Y))\n    end\nend\nif <(rot Y) < [-90]> then\n    set [rot y v] to [-90]\nend\nif <[90] < (rot Y)> then\n    set [rot y v] to [90]\nend\nPhysics\n\ndefine Collisions!\nset [touching platform? v] to [no]\nset [touching end v] to [no]\nset [i v] to [0]\nrepeat (length of [cube x pos v])\n    change [i v] by (1)\n    if <<<not <(cam y) < ((item (i) of [cube y pos v]) - (90))>> and <not <(cam y) > ((item (i) of [cube y pos v]) + (130))>>> and <<<not <(cam z) < ((item (i) of [cube z pos v]) - (60))>> and <not <(cam z) > ((item (i) of [cube z pos v]) + (60))>>> and <<not <(cam x) < ((item (i) of [cube x pos v]) - (60))>> and <not <(cam x) > ((item (i) of [cube x pos v]) + (60))>>>>> then\n        if <(item (i) of [platform type v]) = [1]> then\n            set [touching platform? v] to [yes]\n        else\n            if <(item (i) of [platform type v]) = [2]> then\n                Reset\n            else\n                if <(item (i) of [platform type v]) = [3]> then\n                    start sound [Boing v]\n                    set [y vel v] to [40]\n                else\n                    set [touching end v] to [yes]\n                end\n            end\n        end\n        stop [this script v]\n    end\nend\n\ndefine Physics\nchange [falling? v] by (1)\nchange [y vel v] by (-1)\nchange [cam y v] by (Y vel)\nCollisions!\nif <(Touching platform?) = [yes]> then\n    Y collision (Y vel)\nend\nchange [cam z v] by (Zvel)\nCollisions!\nif <(Touching platform?) = [yes]> then\n    Z Collision (Zvel)\nend\nchange [cam x v] by (Xvel)\nCollisions!\nif <(Touching platform?) = [yes]> then\n    X Collisions (Xvel)\nend\nset [zvel v] to ((Zvel) * (0.7))\nset [xvel v] to ((Xvel) * (0.7))\nif <<key (space v) pressed?> and <(Falling?) < [5]>> then\n    set [y vel v] to [14]\nend\nif <<<<mouse down?> and <<<(mouse y) < [-115]> and <(mouse y) > [-145]>> and <<(mouse x) < [-175]> and <(mouse x) > [-205]>>>> and <(Falling?) < [5]>> or <<<mouse down?> and <<<(mouse y) < [-115]> and <(mouse y) > [-145]>> and <<(mouse x) < [175]> and <(mouse x) > [205]>>>> and <(Falling?) < [5]>>> then\n    set [y vel v] to [14]\nend\nif <(cam y) < [-500]> then\n    Reset\nend\nRender\n\ndefine Y collision (y)\nrepeat until <not <(Touching platform?) = [yes]>>\n    if <(y) > [0]> then\n        change [cam y v] by (-1)\n    else\n        change [cam y v] by (1)\n        set [falling? v] to [0]\n    end\n    set [y vel v] to [0]\n    Collisions!\nend\n\ndefine Z Collision (z)\nrepeat until <not <(Touching platform?) = [yes]>>\n    if <(z) > [0]> then\n        change [cam z v] by (-1)\n    else\n        change [cam z v] by (1)\n    end\n    set [zvel v] to [0]\n    Collisions!\nend\n\ndefine X Collisions (x)\nrepeat until <not <(Touching platform?) = [yes]>>\n    if <(x) > [0]> then\n        change [cam x v] by (-1)\n    else\n        change [cam x v] by (1)\n    end\n    set [xvel v] to [0]\n    Collisions!\nend\n\ndefine Reset\nset [view factor v] to [200]\nset [cam speed v] to [6]\nset [cam x v] to [0]\nset [cam y v] to [150]\nset [cam z v] to [0]\nset [rot x v] to [0]\nset [rot y v] to [0]\nset [near plane v] to [1]\nset [y vel v] to [0]\n\nwhen flag clicked\nreset timer\nerase all\nset [level v] to [1]\nset [mode v] to [mobile]\nLevel\nReset\nforever\n    erase all\n    Turn and Move\n    change [ticks in a time v] by (1)\n    if <(Touching end) = [yes]> then\n        change [level v] by (1)\n        Animation\n        Level\n        Reset\n    end\nend\n\ndefine Level\ndelete all of [cube y pos v]\ndelete all of [cube x pos v]\ndelete all of [cube z pos v]\ndelete all of [platform type v]\nif <(Level) = [1]> then\n    Level design [0] [0] [0] [1]\n    Level design [0] [0] [1] [1]\n    Level design [0] [0] [2] [4]\nelse\n    if <(Level) = [2]> then\n        Level design [0] [0] [0] [1]\n        Level design [0] [0] [1] [2]\n        Level design [0] [0] [2] [1]\n        Level design [0] [0] [3] [4]\n    else\n        if <(Level) = [3]> then\n            Level design [0] [0] [0] [1]\n            Level design [0] [0] [3] [4]\n        else\n            if <(Level) = [4]> then\n                Level design [0] [0] [0] [1]\n                Level design [0] [0] [1] [3]\n                Level design [0] [0] [2] [1]\n                Level design [1] [0] [2] [1]\n                Level design [2] [0] [2] [1]\n                Level design [3] [0] [2] [1]\n                Level design [0] [0] [3] [4]\n            else\n                if <(Level) = [5]> then\n                    Level design [0] [0] [0] [1]\n                    Level design [0] [0] [2] [1]\n                    Level design [0] [2] [0] [1]\n                    Level design [0] [0] [4] [1]\n                    Level design [0] [4] [0] [1]\n                    Level design [0] [4] [2] [1]\n                    Level design [0] [2] [4] [1]\n                    Level design [0] [4] [4] [4]\n                else\n                    if <(Level) = [6]> then\n                        Level design [0] [0] [0] [1]\n                        Level design [0] [0] [1] [3]\n                        Level design [5] [0] [1] [1]\n                        Level design [6] [0] [1] [4]\n                    else\n                        if <(Level) = [7]> then\n                            Level design [0] [0] [0] [1]\n                            Level design [0] [0] [1] [3]\n                            Level design [5] [0] [1] [2]\n                            Level design [6] [0] [1] [4]\n                        else\n                            if <(Level) = [8]> then\n                                Level design [0] [0] [0] [1]\n                                Level design [0] [0] [1] [3]\n                                Level design [5] [0] [1] [1]\n                                Level design [5] [0] [0] [1]\n                                Level design [5] [0] [2] [1]\n                                Level design [6] [0] [1] [4]\n                            else\n                                if <(Level) = [9]> then\n                                    Level design [0] [0] [0] [1]\n                                    Level design [0] [0] [1] [3]\n                                    Level design [5] [0] [1] [1]\n                                    Level design [5] [0] [0] [1]\n                                    Level design [5] [0] [2] [1]\n                                    Level design [5] [1] [1] [1]\n                                    Level design [5] [-1] [1] [1]\n                                    Level design [6] [0] [1] [4]\n                                else\n                                    if <(Level) = [10]> then\n                                        Level design [0] [0] [0] [1]\n                                        Level design [0] [0] [1] [1]\n                                        Level design [1] [0] [1] [1]\n                                        Level design [2] [0] [1] [1]\n                                        Level design [3] [0] [1] [1]\n                                        Level design [0] [-1] [2] [1]\n                                        Level design [0] [-1] [3] [4]\n                                    else\n                                        if <(Level) = [11]> then\n                                            Level design [0] [0] [0] [1]\n                                            Level design [0] [0] [1] [1]\n                                            Level design [1] [0] [1] [1]\n                                            Level design [2] [0] [1] [1]\n                                            Level design [3] [0] [1] [1]\n                                            Level design [0] [0] [2] [1]\n                                            Level design [0] [0] [3] [4]\n                                        else\n                                            if <(Level) = [12]> then\n                                                Level design [0] [0] [0] [1]\n                                                Level design [1] [0] [2] [1]\n                                                Level design [2] [0] [4] [1]\n                                                Level design [3] [-2] [4] [1]\n                                                Level design [4] [-4] [4] [1]\n                                                Level design [5] [-4] [2] [1]\n                                                Level design [6] [-4] [0] [1]\n                                                Level design [7] [-2] [0] [1]\n                                                Level design [8] [0] [0] [4]\n                                            else\n                                                if <(Level) = [13]> then\n                                                    Level design [0] [0] [0] [1]\n                                                    Level design [1] [0] [1] [2]\n                                                    Level design [2] [0] [1] [2]\n                                                    Level design [2] [2] [1] [2]\n                                                    Level design [1] [2] [1] [2]\n                                                    Level design [0] [1] [2] [1]\n                                                    Level design [0] [1] [3] [4]\n                                                else\n                                                    if <(Level) = [14]> then\n                                                        Level design [0] [0] [0] [1]\n                                                        Level design [1] [0] [1] [2]\n                                                        Level design [2] [0] [1] [2]\n                                                        Level design [2] [2] [1] [2]\n                                                        Level design [1] [2] [1] [2]\n                                                        Level design [1] [1] [2] [1]\n                                                        Level design [1] [1] [3] [4]\n                                                    else\n                                                        if <(Level) = [15]> then\n                                                            Level design [0] [0] [0] [1]\n                                                            Level design [0] [0] [1] [2]\n                                                            Level design [1] [0] [1] [2]\n                                                            Level design [2] [0] [1] [2]\n                                                            Level design [0] [0] [2] [1]\n                                                            Level design [0] [0] [3] [4]\n                                                        else\n                                                            if <(Level) = [16]> then\n                                                                Level design [0] [0] [0] [1]\n                                                                Level design [-1] [0] [0] [3]\n                                                                Level design [4] [0] [0] [1]\n                                                                Level design [4] [0] [2] [1]\n                                                                Level design [4] [0] [3] [1]\n                                                                Level design [4] [1] [4] [1]\n                                                                Level design [5] [1] [4] [1]\n                                                                Level design [6] [1] [4] [1]\n                                                                Level design [4] [1] [5] [1]\n                                                                Level design [0] [4] [7] [1]\n                                                                Level design [-1] [6] [10] [4]\n                                                            else\n                                                                if <(Level) = [17]> then\n                                                                    Level design [0] [0] [0] [1]\n                                                                    Level design [0] [0] [1] [1]\n                                                                    Level design [1] [0] [1] [1]\n                                                                    Level design [2] [0] [1] [1]\n                                                                    Level design [2] [0] [3] [1]\n                                                                    Level design [1] [0] [3] [1]\n                                                                    Level design [0] [0] [4] [1]\n                                                                    Level design [0] [0] [2] [1]\n                                                                    Level design [0] [0] [5] [1]\n                                                                    Level design [0] [0] [6] [3]\n                                                                    Level design [6] [0] [6] [2]\n                                                                    Level design [0] [0] [7] [1]\n                                                                    Level design [0] [0] [8] [3]\n                                                                    Level design [6] [0] [8] [2]\n                                                                    Level design [0] [0] [9] [2]\n                                                                    Level design [0] [0] [14] [4]\n                                                                else\n                                                                    if <(Level) = [18]> then\n                                                                        Level design [0] [0] [0] [1]\n                                                                        Level design [0] [0] [1] [3]\n                                                                        Level design [6] [0] [1] [2]\n                                                                        Level design [6] [0] [0] [2]\n                                                                        Level design [6] [0] [2] [2]\n                                                                        Level design [6] [1] [1] [2]\n                                                                        Level design [6] [-1] [1] [2]\n                                                                        Level design [7] [0] [1] [1]\n                                                                        Level design [8] [0] [3] [1]\n                                                                        Level design [8] [-1] [4] [2]\n                                                                        Level design [8] [-2] [4] [3]\n                                                                        Level design [14] [0] [4] [3]\n                                                                        Level design [20] [0] [0] [3]\n                                                                        Level design [25] [4] [0] [1]\n                                                                        Level design [25] [6] [0] [1]\n                                                                        Level design [25] [8] [0] [4]\n                                                                    else\n                                                                        if <(Level) = [19]> then\n                                                                            Level design [0] [0] [0] [1]\n                                                                            Level design [0] [0] [4] [2]\n                                                                            Level design [1] [0] [4] [2]\n                                                                            Level design [1] [1] [4] [2]\n                                                                            Level design [1] [-1] [4] [2]\n                                                                            Level design [2] [0] [4] [2]\n                                                                            Level design [2] [1] [4] [2]\n                                                                            Level design [2] [-1] [4] [2]\n                                                                            Level design [2] [-2] [4] [2]\n                                                                            Level design [2] [2] [4] [2]\n                                                                            Level design [3] [0] [4] [2]\n                                                                            Level design [3] [1] [4] [2]\n                                                                            Level design [3] [-1] [4] [2]\n                                                                            Level design [3] [-2] [4] [2]\n                                                                            Level design [3] [2] [4] [2]\n                                                                            Level design [3] [3] [4] [2]\n                                                                            Level design [3] [-3] [4] [2]\n                                                                            Level design [4] [0] [4] [2]\n                                                                            Level design [4] [1] [4] [2]\n                                                                            Level design [4] [-1] [4] [2]\n                                                                            Level design [4] [-2] [4] [2]\n                                                                            Level design [4] [2] [4] [2]\n                                                                            Level design [4] [3] [4] [2]\n                                                                            Level design [4] [-3] [4] [2]\n                                                                            Level design [5] [0] [4] [2]\n                                                                            Level design [5] [1] [4] [2]\n                                                                            Level design [5] [-1] [4] [2]\n                                                                            Level design [5] [-2] [4] [2]\n                                                                            Level design [5] [2] [4] [2]\n                                                                            Level design [5] [3] [4] [2]\n                                                                            Level design [5] [-3] [4] [2]\n                                                                            Level design [6] [1] [4] [2]\n                                                                            Level design [6] [-1] [4] [2]\n                                                                            Level design [6] [-2] [4] [2]\n                                                                            Level design [6] [2] [4] [2]\n                                                                            Level design [0] [0] [-1] [4]\n                                                                        else\n                                                                            if <(Level) = [20]> then\n                                                                                Level design [0] [0] [0] [1]\n                                                                                Level design [0] [0] [-1] [4]\n                                                                                Level design [0] [-2] [4] [3]\n                                                                                Level design [0] [2] [4] [3]\n                                                                                Level design [1] [2] [4] [3]\n                                                                                Level design [1] [-2] [4] [3]\n                                                                                Level design [1] [-1] [4] [3]\n                                                                                Level design [1] [1] [4] [3]\n                                                                                Level design [2] [2] [4] [3]\n                                                                                Level design [2] [-2] [4] [3]\n                                                                                Level design [2] [-1] [4] [3]\n                                                                                Level design [2] [1] [4] [3]\n                                                                                Level design [2] [0] [4] [3]\n                                                                                Level design [3] [2] [4] [3]\n                                                                                Level design [3] [-2] [4] [3]\n                                                                                Level design [3] [-1] [4] [3]\n                                                                                Level design [3] [1] [4] [3]\n                                                                                Level design [3] [0] [4] [3]\n                                                                                Level design [3] [-3] [4] [3]\n                                                                                Level design [3] [3] [4] [3]\n                                                                                Level design [4] [2] [4] [3]\n                                                                                Level design [4] [-2] [4] [3]\n                                                                                Level design [4] [-1] [4] [3]\n                                                                                Level design [4] [1] [4] [3]\n                                                                                Level design [4] [0] [4] [3]\n                                                                                Level design [4] [-3] [4] [3]\n                                                                                Level design [4] [3] [4] [3]\n                                                                                Level design [4] [-4] [4] [3]\n                                                                                Level design [4] [4] [4] [3]\n                                                                                Level design [5] [-1] [4] [3]\n                                                                                Level design [5] [1] [4] [3]\n                                                                                Level design [5] [0] [4] [3]\n                                                                                Level design [6] [0] [4] [3]\n                                                                            else\n                                                                                Level design [0] [0] [0] [1]\n                                                                                Level design [0] [-5] [4] [1]\n                                                                                Level design [1] [-5] [4] [1]\n                                                                                Level design [2] [-5] [4] [1]\n                                                                                Level design [3] [-5] [4] [1]\n                                                                                Level design [4] [-5] [4] [1]\n                                                                                Level design [4] [-4] [4] [1]\n                                                                                Level design [4] [-3] [4] [1]\n                                                                                Level design [2] [-4] [4] [1]\n                                                                                Level design [0] [-4] [4] [1]\n                                                                                Level design [0] [-3] [4] [1]\n                                                                                Level design [0] [-1] [4] [1]\n                                                                                Level design [1] [-1] [4] [1]\n                                                                                Level design [2] [-1] [4] [1]\n                                                                                Level design [3] [-1] [4] [1]\n                                                                                Level design [4] [-1] [4] [1]\n                                                                                Level design [3] [0] [4] [1]\n                                                                                Level design [2] [1] [4] [1]\n                                                                                Level design [1] [2] [4] [1]\n                                                                                Level design [0] [3] [4] [1]\n                                                                                Level design [1] [3] [4] [1]\n                                                                                Level design [2] [3] [4] [1]\n                                                                                Level design [3] [3] [4] [1]\n                                                                                Level design [4] [3] [4] [1]\n                                                                                Level design [0] [5] [4] [1]\n                                                                                Level design [1] [5] [4] [1]\n                                                                                Level design [2] [5] [4] [1]\n                                                                                Level design [3] [5] [4] [1]\n                                                                                Level design [4] [5] [4] [1]\n                                                                                Level design [4] [6] [4] [1]\n                                                                                Level design [3] [7] [4] [1]\n                                                                                Level design [2] [7] [4] [1]\n                                                                                Level design [1] [7] [4] [1]\n                                                                                Level design [0] [6] [4] [1]\n                                                                                Level design [0] [0] [-2] [1]\n                                                                                Level design [0] [0] [-4] [1]\n                                                                                Level design [0] [0] [-6] [1]\n                                                                                Level design [0] [0] [-8] [4]\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Render\nDistance\nSort Lists\nset pen size to (8)\nset [ii v] to [0]\nrepeat (length of [cube x pos v])\n    change [ii v] by (1)\n    Put Cube at ((item (ii) of [cube x pos v]) / (100)) ((item (ii) of [cube y pos v]) / (100)) ((item (ii) of [cube z pos v]) / (100)) (item (ii) of [platform type v])\nend\nDraw Frame\nif <(Mode) = [mobile]> then\n    Draw Controls\nend\nset pen color to (#ffffff)\nset pen size to (5)\ngo to x: (-10) y: (0)\npen down\ngo to x: (10) y: (0)\npen up\ngo to x: (0) y: (-10)\npen down\ngo to x: (0) y: (10)\npen up\n\ndefine Draw Frame\nset pen size to (10)\nset pen color to (#000000)\ngo to x: (-240) y: (-180)\npen down\ngo to x: (-240) y: (180)\ngo to x: (240) y: (180)\ngo to x: (240) y: (-180)\ngo to x: (-240) y: (-180)\npen up\n\ndefine Draw Controls\nset pen size to (4)\nset pen color to (#9aeaff)\ngo to x: (-190) y: (-80)\npen down\ngo to x: (-205) y: (-110)\ngo to x: (-175) y: (-110)\ngo to x: (-190) y: (-80)\npen up\ngo to x: (-170) y: (-115)\npen down\ngo to x: (-170) y: (-145)\ngo to x: (-140) y: (-130)\ngo to x: (-170) y: (-115)\npen up\ngo to x: (-210) y: (-115)\npen down\ngo to x: (-210) y: (-145)\ngo to x: (-240) y: (-130)\ngo to x: (-210) y: (-115)\npen up\ngo to x: (-190) y: (-180)\npen down\ngo to x: (-205) y: (-150)\ngo to x: (-175) y: (-150)\ngo to x: (-190) y: (-180)\npen up\ngo to x: (-205) y: (-145)\npen down\ngo to x: (-175) y: (-145)\ngo to x: (-175) y: (-115)\ngo to x: (-205) y: (-115)\ngo to x: (-205) y: (-145)\npen up\ngo to x: (205) y: (-145)\npen down\ngo to x: (175) y: (-145)\ngo to x: (175) y: (-115)\ngo to x: (205) y: (-115)\ngo to x: (205) y: (-145)\npen up\nif <<not <key (k v) pressed?>> and <<(timer) < [10]> and <(Mode) = [mobile]>>> then\n    Type [K for keyboard controls] at ( (-130) , (-160) ) color: (255) (255) (255) size: (2) thickness: (4)\nend\nif <key (k v) pressed?> then\n    set [mode v] to [Computer]\nend\n\nwhen flag clicked\nforever\n    if <mouse down?> then\n        set [old mouse x v] to (mouse x)\n        set [old mouse y v] to (mouse y)\n        wait (0.000001) seconds\n        if <not <<<(mouse y) < [-80]> and <(mouse x) < [-140]>> and <(mouse y) < [-80]>>> then\n            change [rot y v] by (((mouse y) - (Old Mouse Y)) / (0.7))\n            change [rot x v] by (((Old Mouse X) - (mouse x)) / (0.7))\n        end\n    end\nend\n\ndefine Select color (current platform type)\nif <(current platform type) = [1]> then\n    set pen color to (#33f7db)\nelse\n    if <(current platform type) = [2]> then\n        set pen color to (#ff3333)\n    else\n        if <(current platform type) = [3]> then\n            set pen color to (#fff830)\n        else\n            set pen color to (#33ff30)\n        end\n    end\nend\n\ndefine Level design (y) (x) (z) (type)\nadd ((y) * (100)) to [cube y pos v]\nadd ((x) * (100)) to [cube x pos v]\nadd ((z) * (100)) to [cube z pos v]\nadd (type) to [platform type v]\n\ndefine --- (label)\n\ndefine Draw Square (x) (y) (z)\nDraw Line ((50) + (x)) ((50) + (y)) (z) to ((50) + (x)) ((-50) + (y)) (z)\nDraw Line ((50) + (x)) ((-50) + (y)) (z) to ((-50) + (x)) ((-50) + (y)) (z)\nDraw Line ((-50) + (x)) ((-50) + (y)) (z) to ((-50) + (x)) ((50) + (y)) (z)\nDraw Line ((-50) + (x)) ((50) + (y)) (z) to ((50) + (x)) ((50) + (y)) (z)\n\nwhen flag clicked\nforever\n    reset timer\n    wait until <mouse down?>\n    if <<<not <(mouse y) < [-80]>> and <not <(mouse x) < [-140]>>> and <mouse down?>> then\n        if <<<not <(mouse y) < [-80]>> and <not <(mouse x) < [-140]>>> and <mouse down?>> then\n            wait until <not <mouse down?>>\n        end\n        wait until <mouse down?>\n        if <<<not <(mouse y) < [-80]>> and <not <(mouse x) < [-140]>>> and <mouse down?>> then\n            wait until <not <mouse down?>>\n        end\n        wait until <mouse down?>\n        if <<<not <(mouse y) < [-80]>> and <not <(mouse x) < [-140]>>> and <mouse down?>> then\n            wait until <not <mouse down?>>\n        end\n        set [touching end v] to [yes]\n        if <<(timer) < [1]> and <(Touching end) = [yes]>> then\n            change [level v] by (1)\n            Reset\n            Level\n        end\n        set [touching end v] to [no]\n    end\nend\n\nwhen [t v] key pressed\nchange [level v] by (1)\nLevel\nReset\nwait until <not <key (t v) pressed?>>\n\ndefine Animation\nset pen color to (#32ff30)\nset pen size to (100)\npoint in direction (90)\ngo to x: (-240) y: (-150)\npen down\nrepeat (5)\n    repeat (6)\n        move (80) steps\n    end\n    turn right (180) degrees\n    change y by (80)\nend\npen up\n\ndefine Type (string) at ( (x) , (y) ) color: (r) (g) (b) size: (size) thickness: (thickness)\nset pen color to ((((r) * (65536)) + ((g) * (256))) + (b))\nset pen size to (((thickness) * (size)) / (2))\nset [overall x v] to (x)\nset [overall y v] to (y)\nset [what letter of string v] to [0]\nrepeat (length of (string))\n    change [what letter of string v] by (1)\n    if <(letter (what letter of string) of (string)) = [ ]> then\n        change [overall x v] by ((8) * (size))\n    else\n        if <[symbols it can use v] contains (letter (what letter of string) of (string))?> then\n            set [what item of list equals letter of string v] to [0]\n            repeat until <(letter (what letter of string) of (string)) = (item (what item of list equals letter of string) of [symbols it can use v])>\n                change [what item of list equals letter of string v] by (1)\n            end\n            set [if it is drawing right now v] to [-1]\n            set [what letter of the item of codes v] to [0]\n            repeat until <(what letter of the item of codes) = (length of (item (what item of list equals letter of string) of [codes for the item of symbols v]))>\n                change [what letter of the item of codes v] by (1)\n                if <(letter (what letter of the item of codes) of (item (what item of list equals letter of string) of [codes for the item of symbols v])) = [/]> then\n                    set [if it is drawing right now v] to ((if it is drawing right now) * (-1))\n                    if <(if it is drawing right now) = [1]> then\n                        pen down\n                    else\n                        pen up\n                    end\n                    change [what letter of the item of codes v] by (1)\n                end\n                set [x position of the small graph v] to (letter (what letter of the item of codes) of (item (what item of list equals letter of string) of [codes for the item of symbols v]))\n                change [what letter of the item of codes v] by (1)\n                set [y position of the small graph v] to (letter (what letter of the item of codes) of (item (what item of list equals letter of string) of [codes for the item of symbols v]))\n                go to x: ((overall x) + ((x position of the small graph) * (size))) y: ((overall y) + ((y position of the small graph) * (size)))\n            end\n            pen up\n            change [overall x v] by ((8) * (size))\n        end\n    end\n    if <(overall x) > ((240) - ((8) * (size)))> then\n        set [overall x v] to (x)\n        set [overall y v] to ((overall y) - ((11) * (size)))\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Dance Energetic v] until done\nend\n\nwhen flag clicked\nforever\n    set [ticks in a time v] to [0]\n    wait (0.5) seconds\n    set [fps v] to (round ((Ticks in a time) / (0.5)))\nend\n\n
Main one:\nhttps://scratch.mit.edu/projects/387059463/\n\nmobile friendly!!!\n\nK FOR KEYBOARD CONTROL!!!!!!!!\n---------------------------- Block Types ------------------------\nTeal - Land, Safe to Walk on\nRed - Lava!!!\nYellow - Trampolines!!!\nGreen - Portal!!!\n------------------------------------------------------------------------\nGo to green block to reach next level\n\nTriple click to skip level or press t\n\n---------------------- Keyboard Controls ----------------------\n-Movement-\nW to move forward\nA to move left\nS to move backwards\nD to move right\nSpace bar to jump\n\n-Turning-\nUp arrow key to look up\nDown arrow key to look down\nLeft arrow key to turn left\nRight arrow key to turn right\n-------------------- Non-Keyboard Controls--------------------\n-Movement-    (Arrows on left bottom corner)\nUp arrow to move forward\nLeft arrow to move left\nDown arrow to move backwards\nRight arrow to move right\n-Turning-\nDrag your mouse/finger across te screen to turn around\n