Wall Runner [3D] [Platformer]
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nforever\n    play sound [ParagonX9 - HyperioxX.mp3 v] until done\nend\n\n@Sprite1\n\ndefine Triangle Filler X1 (x1) Y1 (y1) X2 (x2) Y2 (y2) X3 (x3) Y3 (y3)\nset [$4 v] to ([sqrt v] of ((((x3) - (x2)) * ((x3) - (x2))) + (((y3) - (y2)) * ((y3) - (y2)))) )\nset [$5 v] to ([sqrt v] of ((((x1) - (x3)) * ((x1) - (x3))) + (((y1) - (y3)) * ((y1) - (y3)))) )\nset [$6 v] to ([sqrt v] of ((((x2) - (x1)) * ((x2) - (x1))) + (((y2) - (y1)) * ((y2) - (y1)))) )\nset [$8 v] to (($4) + (($5) + ($6)))\nset [$2 v] to ((((x1) * ($4)) + (((x2) * ($5)) + ((x3) * ($6)))) / ($8))\nset [$3 v] to ((((y1) * ($4)) + (((y2) * ($5)) + ((y3) * ($6)))) / ($8))\nset [$7 v] to ((2) * ([sqrt v] of ((($8) / (2)) * (((($8) / (2)) - ($4)) * (((($8) / (2)) - ($5)) * ((($8) / (2)) - ($6))))) ))\npen up\nset [$9 v] to [1]\nrepeat until <<($9) = (Filling Quality)> or <((($7) / ($8)) / ([10 ^ v] of ((($9) - (1)) * ([log v] of (2) )) )) < ((15) / (Filling Quality))>>\n    set pen size to (((($7) / ($8)) / ([10 ^ v] of ((($9) - (1)) * ([log v] of (2) )) )) * (1))\n    go to x: (($2) + (((x3) - ($2)) * ((1) - ((1) / ([10 ^ v] of (($9) * ([log v] of (2) )) ))))) y: (($3) + (((y3) - ($3)) * ((1) - ((1) / ([10 ^ v] of (($9) * ([log v] of (2) )) )))))\n    pen down\n    go to x: (($2) + (((x1) - ($2)) * ((1) - ((1) / ([10 ^ v] of (($9) * ([log v] of (2) )) ))))) y: (($3) + (((y1) - ($3)) * ((1) - ((1) / ([10 ^ v] of (($9) * ([log v] of (2) )) )))))\n    go to x: (($2) + (((x2) - ($2)) * ((1) - ((1) / ([10 ^ v] of (($9) * ([log v] of (2) )) ))))) y: (($3) + (((y2) - ($3)) * ((1) - ((1) / ([10 ^ v] of (($9) * ([log v] of (2) )) )))))\n    go to x: (($2) + (((x3) - ($2)) * ((1) - ((1) / ([10 ^ v] of (($9) * ([log v] of (2) )) ))))) y: (($3) + (((y3) - ($3)) * ((1) - ((1) / ([10 ^ v] of (($9) * ([log v] of (2) )) )))))\n    change [$9 v] by (1)\nend\npen up\n\ndefine Draw Cubes\nif <(length of [cube x v]) > [1]> then\n    delete (all) of [cube distance v]\n    set [cnt v] to [1]\n    repeat (length of [cube x v])\n        add ([sqrt v] of (([e ^ v] of ((2) * ([ln v] of ([abs v] of ((item (cnt) of [cube x v]) - (Cam X)) ) )) ) + (([e ^ v] of ((2) * ([ln v] of ([abs v] of ((item (cnt) of [cube z v]) - (Cam Z)) ) )) ) + ([e ^ v] of ((2) * ([ln v] of ([abs v] of ((item (cnt) of [cube y v]) - (Cam Y)) ) )) ))) ) to [cube distance v]\n        change [cnt v] by (1)\n    end\n    Quick sort  for Cube (1) to (length of [cube x v])\nend\nset [cnt v] to (length of [cube x v])\nrepeat (length of [cube x v])\n    set pen size to (5)\n    set [cube x v] to ((item (cnt) of [cube size v]) / (2))\n    set [cube y v] to ((item (cnt) of [cube size v]) / (2))\n    set [cube z v] to ((item (cnt) of [cube size v]) / (2))\n    set pen color to (#ffffff)\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    Draw line ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    Draw line (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) to ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    set pen color to (join [0x] (item ((1) + (((item (cnt) of [cube color type v]) - (1)) * (3))) of [color v]))\n    Draw square (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) , (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw square (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) , (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    set pen color to (join [0x] (item ((2) + (((item (cnt) of [cube color type v]) - (1)) * (3))) of [color v]))\n    Draw square (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) , (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw square (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) , (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    set pen color to (join [0x] (item ((3) + (((item (cnt) of [cube color type v]) - (1)) * (3))) of [color v]))\n    Draw square (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) , (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) , (((Cube x) * (-1)) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) , (((Cube x) * (-1)) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v]))\n    Draw square ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) (((Cube z) * (-1)) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) ((Cube y) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v])) , ((Cube x) + (item (cnt) of [cube x v])) (((Cube y) * (-1)) + (item (cnt) of [cube y v])) ((Cube z) + (item (cnt) of [cube z v]))\n    change [cnt v] by (-1)\nend\n\ndefine Set point1 (x1) (y1) (z1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\nset [z1 v] to (z1)\n\nwhen flag clicked\ndelete (all) of [cube x v]\ndelete (all) of [cube y v]\ndelete (all) of [cube z v]\ndelete (all) of [cube size v]\ndelete (all) of [cube color type v]\nset [filling quality v] to [10]\nshow variable [level v]\nMake first map\nforever\n    erase all\n    Culculate tring values\n    Draw Cubes\n    if <(to VF) = [2500]> then\n        Draw Mark\n    else\n        set pen size to (8)\n        ARGB Alpha (255) Red (200) Green (200) Blue (200)\n        pen up\n        go to x: (0) y: (0)\n        pen down\n        pen up\n    end\nend\n\ndefine Set point2 (x2) (y2) (z2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nset [z2 v] to (z2)\n\ndefine Go up\nrepeat until <(Collision \(Cube\) Result) = [0]>\n    Collision (Cube)\n    change [p y v] by (1)\nend\n\ndefine Make first map\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (0) (400) size: (200) Color: [1]\nMake a Cube (0) (0) (800) size: (200) Color: [1]\nMake a Cube (0) (0) (1200) size: (200) Color: [1]\nMake a Cube (0) (0) (1600) size: (200) Color: [4]\n\ndefine Draw Mark\nset pen size to (2)\nARGB Alpha (255) Red (200) Green (200) Blue (200)\npen up\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\nwhen flag clicked\nset [level v] to [1]\nset [rot x v] to [0]\nset [rot y v] to [0]\nset [p x v] to [0]\nset [p y v] to [100]\nset [p z v] to [0]\nset [near plane v] to [30]\nset [z speed v] to [0]\nset [x speed v] to [0]\nset [y speed v] to [0]\nset [to vf v] to [150]\nset [vf v] to (to VF)\nset [iswallrunning v] to [0]\nset [x boost v] to [0]\nset [z boost v] to [0]\nforever\n    set [cam x v] to (P X)\n    set [cam z v] to (P Z)\n    set [cam y v] to ((P Y) + (120))\n    set [rot y v] to ((rot Y) mod (360))\n    set [rot x v] to ((rot X) mod (360))\n    change [vf v] by (((to VF) - (VF)) * (0.5))\n    if <(isWallRunning) = [0]> then\n        set [to vf v] to [220]\n        set [rot speed v] to ((600) / (VF))\n        change [rot x v] by (rot X Speed)\n        change [rot x v] by (Reaction)\n        change [rot y v] by (rot Y Speed)\n        set [rot x speed v] to ((rot X Speed) * (0.4))\n        set [rot y speed v] to ((rot Y Speed) * (0.4))\n        set [reaction v] to ((Reaction) * (0.6))\n        if <key (up arrow v) pressed?> then\n            change [rot x speed v] by (rot Speed)\n        end\n        if <key (down arrow v) pressed?> then\n            change [rot x speed v] by ((rot Speed) * (-1))\n        end\n        if <key (right arrow v) pressed?> then\n            change [rot y speed v] by ((rot Speed) * (-1))\n        end\n        if <key (left arrow v) pressed?> then\n            change [rot y speed v] by (rot Speed)\n        end\n        change [p y v] by (Y Speed)\n        Collision (Cube)\n        if <(Collision \(Cube\) Result) = [1]> then\n            if <(Y Speed) > [0]> then\n                set [going up v] to [1]\n            else\n                set [going up v] to [0]\n            end\n            set [y speed v] to [0]\n            if <(Going up) = [0]> then\n                Go up\n                if <(Collision Color Result) = [3]> then\n                    set [y speed v] to [60]\n                    broadcast (Play bounce sound v)\n                else\n                    if <key (space v) pressed?> then\n                        set [y speed v] to [26]\n                    end\n                end\n            else\n                Go down\n            end\n            set [x speed v] to ((X Speed) * (0.65))\n            set [z speed v] to ((Z speed) * (0.65))\n            set [x boost v] to ((X boost) * (0.3))\n            set [z boost v] to ((Z boost) * (0.3))\n        else\n            set [x speed v] to ((X Speed) * (0.65))\n            set [z speed v] to ((Z speed) * (0.65))\n            set [x boost v] to ((X boost) * (0.95))\n            set [z boost v] to ((Z boost) * (0.95))\n        end\n        if <key (a v) pressed?> then\n            change [x speed v] by (([cos v] of (rot Y) ) * (-5))\n            change [z speed v] by (([sin v] of (rot Y) ) * (-5))\n        end\n        if <key (d v) pressed?> then\n            change [x speed v] by (([cos v] of (rot Y) ) * (5))\n            change [z speed v] by (([sin v] of (rot Y) ) * (5))\n        end\n        if <key (w v) pressed?> then\n            change [x speed v] by (([cos v] of ((rot Y) + (90)) ) * (5))\n            change [z speed v] by (([sin v] of ((rot Y) + (90)) ) * (5))\n        end\n        if <key (s v) pressed?> then\n            change [x speed v] by (([cos v] of ((rot Y) + (90)) ) * (-5))\n            change [z speed v] by (([sin v] of ((rot Y) + (90)) ) * (-5))\n        end\n        change [p z v] by ((Z speed) + (Z boost))\n        Collision (Cube)\n        if <(Collision \(Cube\) Result) = [1]> then\n            change [p z v] by (((Z speed) + (Z boost)) * (-1))\n            if <([abs v] of ([cos v] of (rot Y) ) ) < [0.7]> then\n                if <key (space v) pressed?> then\n                    set [spacepressedbeforecollision v] to [1]\n                else\n                    set [spacepressedbeforecollision v] to [0]\n                end\n                set [iswallrunning v] to [x]\n                broadcast (Play attach sound v)\n            end\n        end\n        change [p x v] by ((X Speed) + (X boost))\n        Collision (Cube)\n        if <(Collision \(Cube\) Result) = [1]> then\n            change [p x v] by (((X Speed) + (X boost)) * (-1))\n            if <([abs v] of ([sin v] of (rot Y) ) ) < [0.7]> then\n                if <key (space v) pressed?> then\n                    set [spacepressedbeforecollision v] to [1]\n                else\n                    set [spacepressedbeforecollision v] to [0]\n                end\n                set [iswallrunning v] to [z]\n                broadcast (Play attach sound v)\n            end\n        end\n        change [y speed v] by (-2)\n        if <(P Y) < [-4000]> then\n            set [rot x v] to [0]\n            set [rot y v] to [0]\n            set [z speed v] to [0]\n            set [x speed v] to [0]\n            set [y speed v] to [0]\n            set [p x v] to [0]\n            set [p y v] to [100]\n            set [p z v] to [0]\n        end\n    else\n        set [to vf v] to [220]\n        if <[0] > (rot X)> then\n            set [rot x v] to ((360) + (rot X))\n        end\n        if <(rot X) < [180]> then\n            if <(rot X) > [2]> then\n                change [rot x v] by ((rot X) * (-0.2))\n            end\n        else\n            if <[358] > (rot X)> then\n                change [rot x v] by (((360) - (rot X)) * (0.2))\n            end\n        end\n        if <(isWallRunning) = [z]> then\n            if <([cos v] of (rot Y) ) > [0]> then\n                change [p z v] by (Wall Run Speed)\n                Collision (Cube)\n                if <(Collision \(Cube\) Result) = [1]> then\n                    set [iswallrunning v] to [0]\n                    change [p z v] by ((Wall Run Speed) * (-1))\n                end\n                if <(rot Y) > [180]> then\n                    if <[358] > (rot Y)> then\n                        change [rot y v] by (((360) - (rot Y)) * (0.2))\n                    end\n                else\n                    if <(rot Y) > [2]> then\n                        change [rot y v] by (((0) - (rot Y)) * (0.2))\n                    end\n                end\n            else\n                change [p z v] by ((Wall Run Speed) * (-1))\n                Collision (Cube)\n                if <(Collision \(Cube\) Result) = [1]> then\n                    set [iswallrunning v] to [0]\n                    change [p z v] by (Wall Run Speed)\n                end\n                if <(rot Y) > [180]> then\n                    if <(rot Y) > [182]> then\n                        change [rot y v] by (((180) - (rot Y)) * (0.2))\n                    end\n                else\n                    if <[178] > (rot Y)> then\n                        change [rot y v] by (((180) - (rot Y)) * (0.2))\n                    end\n                end\n            end\n            change [p x v] by ((X Speed) + (X boost))\n            Collision (Cube)\n            change [p x v] by (((X Speed) + (X boost)) * (-1))\n            if <(Collision \(Cube\) Result) = [0]> then\n                set [iswallrunning v] to [0]\n                set [x boost v] to ((([abs v] of ((X Speed) + (X boost)) ) / ((X Speed) + (X boost))) * (-20))\n                if <([cos v] of (rot Y) ) > [0]> then\n                    set [z boost v] to [20]\n                else\n                    set [z boost v] to [-20]\n                end\n                set [x speed v] to [0]\n                set [z speed v] to [0]\n                set [y speed v] to [5]\n                broadcast (Play jump sound v)\n            end\n            if <key (space v) pressed?> then\n                if <(SpacePressedBeforeCollision) = [0]> then\n                    set [iswallrunning v] to [0]\n                    set [x boost v] to ((([abs v] of ((X Speed) + (X boost)) ) / ((X Speed) + (X boost))) * (-40))\n                    if <([cos v] of (rot Y) ) > [0]> then\n                        set [z boost v] to [20]\n                    else\n                        set [z boost v] to [-20]\n                    end\n                    set [x speed v] to [0]\n                    set [z speed v] to [0]\n                    set [y speed v] to [11]\n                    broadcast (Play jump sound v)\n                end\n            else\n                set [spacepressedbeforecollision v] to [0]\n            end\n        else\n            if <([sin v] of (rot Y) ) > [0]> then\n                change [p x v] by ((Wall Run Speed) * (-1))\n                Collision (Cube)\n                if <(Collision \(Cube\) Result) = [1]> then\n                    set [iswallrunning v] to [0]\n                    change [p x v] by (Wall Run Speed)\n                end\n                if <(rot Y) > [90]> then\n                    if <(rot Y) > [92]> then\n                        change [rot y v] by (((90) - (rot Y)) * (0.2))\n                    end\n                else\n                    if <[88] > (rot Y)> then\n                        change [rot y v] by (((90) - (rot Y)) * (0.2))\n                    end\n                end\n            else\n                change [p x v] by (Wall Run Speed)\n                Collision (Cube)\n                if <(Collision \(Cube\) Result) = [1]> then\n                    set [iswallrunning v] to [0]\n                    change [p x v] by ((Wall Run Speed) * (-1))\n                end\n                if <(rot Y) > [270]> then\n                    if <(rot Y) > [272]> then\n                        change [rot y v] by (((270) - (rot Y)) * (0.2))\n                    end\n                else\n                    if <[268] > (rot Y)> then\n                        change [rot y v] by (((270) - (rot Y)) * (0.2))\n                    end\n                end\n            end\n            change [p z v] by ((Z speed) + (Z boost))\n            Collision (Cube)\n            change [p z v] by (((Z speed) + (Z boost)) * (-1))\n            if <(Collision \(Cube\) Result) = [0]> then\n                set [iswallrunning v] to [0]\n                set [z boost v] to ((([abs v] of ((Z speed) + (Z boost)) ) / ((Z speed) + (Z boost))) * (-20))\n                if <([sin v] of (rot Y) ) > [0]> then\n                    set [x boost v] to [-20]\n                else\n                    set [x boost v] to [20]\n                end\n                set [x speed v] to [0]\n                set [z speed v] to [0]\n                broadcast (Play jump sound v)\n            end\n            if <key (space v) pressed?> then\n                if <(SpacePressedBeforeCollision) = [0]> then\n                    set [iswallrunning v] to [0]\n                    set [z boost v] to ((([abs v] of ((Z speed) + (Z boost)) ) / ((Z speed) + (Z boost))) * (-40))\n                    if <([sin v] of (rot Y) ) > [0]> then\n                        set [x boost v] to [-20]\n                    else\n                        set [x boost v] to [20]\n                    end\n                    set [x speed v] to [0]\n                    set [z speed v] to [0]\n                    set [y speed v] to [11]\n                    broadcast (Play jump sound v)\n                end\n            else\n                set [spacepressedbeforecollision v] to [0]\n            end\n        end\n    end\nend\n\n\n\ndefine Draw line (x1) (y1) (z1) to (x2) (y2) (z2)\nSet point1 ((x1) - (Cam X)) ((y1) - (Cam Y)) ((z1) - (Cam Z))\nSet point2 ((x2) - (Cam X)) ((y2) - (Cam Y)) ((z2) - (Cam Z))\nSet point1 (((Z1) * (sin Y)) + ((X1) * (cos Y))) (Y1) (((Z1) * (cos Y)) - ((X1) * (sin Y)))\nSet point2 (((Z2) * (sin Y)) + ((X2) * (cos Y))) (Y2) (((Z2) * (cos Y)) - ((X2) * (sin Y)))\nSet point1 (X1) (((Y1) * (cos X)) - ((Z1) * (sin X))) (((Y1) * (sin X)) + ((Z1) * (cos X)))\nSet point2 (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 (Line)\n    Set screen point1 ((VF) * ((X1) / (Z1))) ((VF) * ((Y1) / (Z1)))\n    Set screen point2 ((VF) * ((X2) / (Z2))) ((VF) * ((Y2) / (Z2)))\n    if <[0] = [1]> then\n        XY Clipping(Line)\n    end\n    go to x: (X1) y: (Y1)\n    pen down\n    go to x: (X2) y: (Y2)\n    pen up\nend\n\ndefine Quick sort  for Cube (start) to (end)\nset [qs:pivot v] to (item (start) of [cube distance v])\nset [qs:f v] to (start)\nset [qs:l v] to (end)\nset [qs:finished v] to [0]\nrepeat until <(QS:Finished) = [1]>\n    repeat until <<not <(item (QS:F) of [cube distance v]) < (QS:Pivot)>> or <(QS:L) = ((QS:F) + (1))>>\n        change [qs:f v] by (1)\n    end\n    repeat until <<(item (QS:L) of [cube distance v]) < (QS:Pivot)> or <(QS:L) = ((QS:F) + (1))>>\n        change [qs:l v] by (-1)\n    end\n    if <(item (QS:L) of [cube distance v]) < (QS:Pivot)> then\n        set [qs:temp v] to (item (QS:F) of [cube distance v])\n        replace item (QS:F) of [cube distance v] with (item (QS:L) of [cube distance v])\n        replace item (QS:L) of [cube distance v] with (QS:Temp)\n        set [qs:temp v] to (item (QS:F) of [cube x v])\n        replace item (QS:F) of [cube x v] with (item (QS:L) of [cube x v])\n        replace item (QS:L) of [cube x v] with (QS:Temp)\n        set [qs:temp v] to (item (QS:F) of [cube y v])\n        replace item (QS:F) of [cube y v] with (item (QS:L) of [cube y v])\n        replace item (QS:L) of [cube y v] with (QS:Temp)\n        set [qs:temp v] to (item (QS:F) of [cube z v])\n        replace item (QS:F) of [cube z v] with (item (QS:L) of [cube z v])\n        replace item (QS:L) of [cube z v] with (QS:Temp)\n        set [qs:temp v] to (item (QS:F) of [cube size v])\n        replace item (QS:F) of [cube size v] with (item (QS:L) of [cube size v])\n        replace item (QS:L) of [cube size v] with (QS:Temp)\n        set [qs:temp v] to (item (QS:F) of [cube color type v])\n        replace item (QS:F) of [cube color type v] with (item (QS:L) of [cube color type v])\n        replace item (QS:L) of [cube color type v] with (QS:Temp)\n    end\n    if <(QS:L) = ((QS:F) + (1))> then\n        set [qs:finished v] to [1]\n    end\nend\nif <((QS:F) - (start)) > [0]> then\n    Quick sort  for Cube (start) to (QS:F)\nend\nif <((end) - (QS:L)) > [0]> then\n    Quick sort  for Cube (QS:L) to (end)\nend\n\ndefine Set screen point1 (x1) (y1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\n\ndefine Z Clipping (Line)\nset [percent v] to (((near plane) - (Z1)) / ((Z2) - (Z1)))\nif <(Z1) < (near plane)> then\n    Set point1 ((X1) + (((X2) - (X1)) * (percent))) ((Y1) + (((Y2) - (Y1)) * (percent))) (near plane)\nelse\n    if <(Z2) < (near plane)> then\n        Set point2 ((X1) + (((X2) - (X1)) * (percent))) ((Y1) + (((Y2) - (Y1)) * (percent))) (near plane)\n    end\nend\n\ndefine Culculate tring values\nset [sin x v] to ([sin v] of (rot X) )\nset [cos x v] to ([cos v] of (rot X) )\nset [sin y v] to ([sin v] of (rot Y) )\nset [cos y v] to ([cos v] of (rot Y) )\n\ndefine Make a Cube (x) (y) (z) size: (s) Color: (color)\nadd (x) to [cube x v]\nadd (y) to [cube y v]\nadd (z) to [cube z v]\nadd (s) to [cube size v]\nadd (color) to [cube color type v]\n\ndefine Set screen point2 (x2) (y2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\n\ndefine Set point3 (x3) (y3) (z3)\nset [x3 v] to (x3)\nset [y3 v] to (y3)\nset [z3 v] to (z3)\n\ndefine Set screen point3 (x3) (y3)\nset [x3 v] to (x3)\nset [y3 v] to (y3)\n\ndefine Set temp on screen (x) (y)\nset [tempx v] to (x)\nset [tempy v] to (y)\n\ndefine ARGB Alpha (number1) Red (number2) Green (number3) Blue (number4)\nset pen color to (((((number1) * (16777216)) + ((number2) * (65536))) + ((number3) * (256))) + (number4))\n\ndefine Set temp in 3D (x) (y) (z)\nset [tempx v] to (x)\nset [tempy v] to (y)\nset [tempz v] to (z)\n\ndefine XY Clipping(Line)\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        if <(temp) = [0]> then\n            Set screen point1 (240) ((Y1) + (((240) - (X1)) * (m)))\n        else\n            Set screen tempCrd (240) ((Y1) + (((240) - (X1)) * (m)))\n        end\n    end\nend\nif <(Y1) > [180]> then\n    if <(Y2) > [180]> then\n        stop [this script v]\n    else\n        if <(temp) = [0]> then\n            Set screen point1 ((X1) + (((180) - (Y1)) / (m))) (180)\n        else\n            Set screen tempCrd ((X1) + (((180) - (Y1)) / (m))) (180)\n        end\n    end\nend\nif <(X1) < [-240]> then\n    if <(X2) < [-240]> then\n        stop [this script v]\n    else\n        if <(temp) = [0]> then\n            Set screen point1 (-240) ((Y1) + (((-240) - (X1)) * (m)))\n        else\n            Set screen tempCrd (-240) ((Y1) + (((-240) - (X1)) * (m)))\n        end\n    end\nend\nif <(Y1) < [-180]> then\n    if <(Y2) < [-180]> then\n        stop [this script v]\n    else\n        if <(temp) = [0]> then\n            Set screen point1 ((X1) + (((-180) - (Y1)) / (m))) (-180)\n        else\n            Set screen tempCrd ((X1) + (((-180) - (Y1)) / (m))) (-180)\n        end\n    end\nend\nif <(X2) > [240]> then\n    if <(temp) = [0]> then\n        Set screen point2 (240) ((Y1) + (((240) - (X1)) * (m)))\n    else\n        Set temp on screen (240) ((Y1) + (((240) - (X1)) * (m)))\n    end\nend\nif <(Y2) > [180]> then\n    if <(temp) = [0]> then\n        Set screen point2 ((X1) + (((180) - (Y1)) / (m))) (180)\n    else\n        Set temp on screen ((X1) + (((180) - (Y1)) / (m))) (180)\n    end\nend\nif <(X2) < [-240]> then\n    if <(temp) = [0]> then\n        Set screen point2 (-240) ((Y1) + (((-240) - (X1)) * (m)))\n    else\n        Set temp on screen (-240) ((Y1) + (((-240) - (X1)) * (m)))\n    end\nend\nif <(Y2) < [-180]> then\n    if <(temp) = [0]> then\n        Set screen point2 ((X1) + (((-180) - (Y1)) / (m))) (-180)\n    else\n        Set temp on screen ((X1) + (((-180) - (Y1)) / (m))) (-180)\n    end\nend\n\ndefine Collision (Cube)\nset [collision \(cube\) result v] to [0]\nset [cnt v] to (length of [cube x v])\nrepeat (length of [cube x v])\n    if <<([abs v] of ((P X) - (item (cnt) of [cube x v])) ) < (((item (cnt) of [cube size v]) / (2)) + (50))> and <<([abs v] of ((P Z) - (item (cnt) of [cube z v])) ) < (((item (cnt) of [cube size v]) / (2)) + (50))> and <<<(item (cnt) of [cube y v]) < (P Y)> and <((P Y) - ((item (cnt) of [cube y v]) + ((item (cnt) of [cube size v]) / (2)))) < [0]>> or <<(P Y) < (item (cnt) of [cube y v])> and <((item (cnt) of [cube y v]) - ((item (cnt) of [cube size v]) / (2))) < ((P Y) + (180))>>>>> then\n        set [collision \(cube\) result v] to [1]\n        set [collision color result v] to (item (cnt) of [cube color type v])\n        if <(Collision Color Result) = [4]> then\n            broadcast (Next level v)\n        end\n        if <(Collision Color Result) = [2]> then\n            set [rot x v] to [0]\n            set [rot y v] to [0]\n            set [p x v] to [0]\n            set [p y v] to [100]\n            set [p z v] to [0]\n            set [z speed v] to [0]\n            set [x speed v] to [0]\n            set [y speed v] to [0]\n            set [x boost v] to [0]\n            set [z boost v] to [0]\n        end\n        stop [this script v]\n    end\n    change [cnt v] by (-1)\nend\n\nARGB Alpha (256) Red (255) Green (255) Blue (255)\n\nTriangle Filler X1 (-100) Y1 (-100) X2 (0) Y2 (100) X3 (100) Y3 (-100)\n\ndefine Draw triangle 3D (x1) (y1) (z1) , (x2) (y2) (z2) , (x3) (y3) (z3)\nSet point1 ((x1) - (Cam X)) ((y1) - (Cam Y)) ((z1) - (Cam Z))\nSet point2 ((x2) - (Cam X)) ((y2) - (Cam Y)) ((z2) - (Cam Z))\nSet point3 ((x3) - (Cam X)) ((y3) - (Cam Y)) ((z3) - (Cam Z))\nSet point1 (((Z1) * (sin Y)) + ((X1) * (cos Y))) (Y1) (((Z1) * (cos Y)) - ((X1) * (sin Y)))\nSet point2 (((Z2) * (sin Y)) + ((X2) * (cos Y))) (Y2) (((Z2) * (cos Y)) - ((X2) * (sin Y)))\nSet point3 (((Z3) * (sin Y)) + ((X3) * (cos Y))) (Y3) (((Z3) * (cos Y)) - ((X3) * (sin Y)))\nSet point1 (X1) (((Y1) * (cos X)) - ((Z1) * (sin X))) (((Y1) * (sin X)) + ((Z1) * (cos X)))\nSet point2 (X2) (((Y2) * (cos X)) - ((Z2) * (sin X))) (((Y2) * (sin X)) + ((Z2) * (cos X)))\nSet point3 (X3) (((Y3) * (cos X)) - ((Z3) * (sin X))) (((Y3) * (sin X)) + ((Z3) * (cos X)))\nif <<(Z1) < (near plane)> and <<(Z2) < (near plane)> and <(Z3) < (near plane)>>> then\n    stop [this script v]\nend\nif <<(near plane) < (Z1)> and <<(near plane) < (Z2)> and <(near plane) < (Z3)>>> then\n    Set screen point1 ((VF) * ((X1) / (Z1))) ((VF) * ((Y1) / (Z1)))\n    Set screen point2 ((VF) * ((X2) / (Z2))) ((VF) * ((Y2) / (Z2)))\n    Set screen point3 ((VF) * ((X3) / (Z3))) ((VF) * ((Y3) / (Z3)))\n    Triangle Filler X1 (X1) Y1 (Y1) X2 (X2) Y2 (Y2) X3 (X3) Y3 (Y3)\n    stop [this script v]\nend\ndelete all of [3d tri back x v]\ndelete all of [3d tri back y v]\ndelete all of [3d tri back z v]\ndelete all of [3d tri front x v]\ndelete all of [3d tri front y v]\ndelete all of [3d tri front z v]\nif <(Z1) < (near plane)> then\n    add (X1) to [3d tri back x v]\n    add (Y1) to [3d tri back y v]\n    add (Z1) to [3d tri back z v]\nelse\n    add (X1) to [3d tri front x v]\n    add (Y1) to [3d tri front y v]\n    add (Z1) to [3d tri front z v]\nend\nif <(Z2) < (near plane)> then\n    add (X2) to [3d tri back x v]\n    add (Y2) to [3d tri back y v]\n    add (Z2) to [3d tri back z v]\nelse\n    add (X2) to [3d tri front x v]\n    add (Y2) to [3d tri front y v]\n    add (Z2) to [3d tri front z v]\nend\nif <(Z3) < (near plane)> then\n    add (X3) to [3d tri back x v]\n    add (Y3) to [3d tri back y v]\n    add (Z3) to [3d tri back z v]\nelse\n    add (X3) to [3d tri front x v]\n    add (Y3) to [3d tri front y v]\n    add (Z3) to [3d tri front z v]\nend\nif <(length of [3d tri front x v]) = [1]> then\n    set [percent v] to (((near plane) - (item (1) of [3d tri front z v])) / ((item (1) of [3d tri back z v]) - (item (1) of [3d tri front z v])))\n    Set temp in 3D ((item (1) of [3d tri front x v]) + (((item (1) of [3d tri back x v]) - (item (1) of [3d tri front x v])) * (percent))) ((item (1) of [3d tri front y v]) + (((item (1) of [3d tri back y v]) - (item (1) of [3d tri front y v])) * (percent))) (near plane)\n    set [percent v] to (((near plane) - (item (1) of [3d tri front z v])) / ((item (2) of [3d tri back z v]) - (item (1) of [3d tri front z v])))\n    Set temp2 in 3D ((item (1) of [3d tri front x v]) + (((item (2) of [3d tri back x v]) - (item (1) of [3d tri front x v])) * (percent))) ((item (1) of [3d tri front y v]) + (((item (2) of [3d tri back y v]) - (item (1) of [3d tri front y v])) * (percent))) (near plane)\n    Set temp on screen ((VF) * ((tempX) / (tempZ))) ((VF) * ((tempY) / (tempZ)))\n    Set temp2 on screen ((VF) * ((tempX2) / (tempZ2))) ((VF) * ((tempY2) / (tempZ2)))\n    Set screen point1 ((VF) * ((item (1) of [3d tri front x v]) / (item (1) of [3d tri front z v]))) ((VF) * ((item (1) of [3d tri front y v]) / (item (1) of [3d tri front z v])))\n    Triangle Filler X1 (tempX) Y1 (tempY) X2 (tempX2) Y2 (tempY2) X3 (X1) Y3 (Y1)\nelse\n    set [percent v] to (((near plane) - (item (1) of [3d tri front z v])) / ((item (1) of [3d tri back z v]) - (item (1) of [3d tri front z v])))\n    Set temp in 3D ((item (1) of [3d tri front x v]) + (((item (1) of [3d tri back x v]) - (item (1) of [3d tri front x v])) * (percent))) ((item (1) of [3d tri front y v]) + (((item (1) of [3d tri back y v]) - (item (1) of [3d tri front y v])) * (percent))) (near plane)\n    set [percent v] to (((near plane) - (item (2) of [3d tri front z v])) / ((item (1) of [3d tri back z v]) - (item (2) of [3d tri front z v])))\n    Set temp2 in 3D ((item (2) of [3d tri front x v]) + (((item (1) of [3d tri back x v]) - (item (2) of [3d tri front x v])) * (percent))) ((item (2) of [3d tri front y v]) + (((item (1) of [3d tri back y v]) - (item (2) of [3d tri front y v])) * (percent))) (near plane)\n    Set temp on screen ((VF) * ((tempX) / (tempZ))) ((VF) * ((tempY) / (tempZ)))\n    Set temp2 on screen ((VF) * ((tempX2) / (tempZ2))) ((VF) * ((tempY2) / (tempZ2)))\n    Set screen point1 ((VF) * ((item (1) of [3d tri front x v]) / (item (1) of [3d tri front z v]))) ((VF) * ((item (1) of [3d tri front y v]) / (item (1) of [3d tri front z v])))\n    Set screen point2 ((VF) * ((item (2) of [3d tri front x v]) / (item (2) of [3d tri front z v]))) ((VF) * ((item (2) of [3d tri front y v]) / (item (2) of [3d tri front z v])))\n    Triangle Filler X1 (tempX2) Y1 (tempY2) X2 (tempX) Y2 (tempY) X3 (X2) Y3 (Y2)\n    Triangle Filler X1 (tempX) Y1 (tempY) X2 (X2) Y2 (Y2) X3 (X1) Y3 (Y1)\nend\n\nif <(Z1) < (near plane)> then\n    if <(Z2) < (near plane)> then\n        set [percent v] to (((near plane) - (Z2)) / ((Z3) - (Z2)))\n        Set temp in 3D ((X2) + (((X3) - (X2)) * (percent))) ((Y2) + (((Y3) - (Y2)) * (percent))) (near plane)\n        set [percent v] to (((near plane) - (Z1)) / ((Z3) - (Z1)))\n        Set temp2 in 3D ((X1) + (((X3) - (X1)) * (percent))) ((Y1) + (((Y3) - (Y1)) * (percent))) (near plane)\n        Set screen point3 ((VF) * ((X3) / (Z3))) ((VF) * ((Y3) / (Z3)))\n        Set temp on screen ((VF) * ((tempX) / (tempZ))) ((VF) * ((tempY) / (tempZ)))\n        Set temp2 on screen ((VF) * ((tempX2) / (tempZ2))) ((VF) * ((tempY2) / (tempZ2)))\n        Triangle Filler X1 (tempX2) Y1 (tempY2) X2 (tempX) Y2 (tempY) X3 (X3) Y3 (Y3)\n    else\n        if <(Z3) < (near plane)> then\n            set [percent v] to (((near plane) - (Z1)) / ((Z2) - (Z1)))\n            Set temp in 3D ((X1) + (((X2) - (X1)) * (percent))) ((Y1) + (((Y2) - (Y1)) * (percent))) (near plane)\n            set [percent v] to (((near plane) - (Z3)) / ((Z2) - (Z3)))\n            Set temp2 in 3D ((X3) + (((X2) - (X3)) * (percent))) ((Y3) + (((Y2) - (Y3)) * (percent))) (near plane)\n            Set temp on screen ((VF) * ((tempX) / (tempZ))) ((VF) * ((tempY) / (tempZ)))\n            Set screen point2 ((VF) * ((X2) / (Z2))) ((VF) * ((Y2) / (Z2)))\n            if <<([abs v] of (X2) ) < [240]> and <([abs v] of (Y2) ) < [180]>> then\n                Triangle Filler X1 (tempX2) Y1 (tempY2) X2 (tempX) Y2 (tempY) X3 (X2) Y3 (Y2)\n            end\n        else\n            set [percent v] to (((near plane) - (Z1)) / ((Z2) - (Z1)))\n            Set temp in 3D ((X1) + (((X2) - (X1)) * (percent))) ((Y1) + (((Y2) - (Y1)) * (percent))) (near plane)\n            set [percent v] to (((near plane) - (Z1)) / ((Z3) - (Z1)))\n            Set temp2 in 3D ((X1) + (((X3) - (X1)) * (percent))) ((Y1) + (((Y3) - (Y1)) * (percent))) (near plane)\n            Set screen point3 ((VF) * ((X3) / (Z3))) ((VF) * ((Y3) / (Z3)))\n            Set screen point2 ((VF) * ((X2) / (Z2))) ((VF) * ((Y2) / (Z2)))\n            Set temp on screen ((VF) * ((tempX) / (tempZ))) ((VF) * ((tempY) / (tempZ)))\n            Set temp2 on screen ((VF) * ((tempX2) / (tempZ2))) ((VF) * ((tempY2) / (tempZ2)))\n            Triangle Filler X1 (X2) Y1 (Y2) X2 (X3) Y2 (Y3) X3 (tempX) Y3 (tempY)\n            Triangle Filler X1 (tempX2) Y1 (tempY2) X2 (tempX) Y2 (tempY) X3 (X3) Y3 (Y3)\n        end\n    end\nelse\n    if <(Z2) < (near plane)> then\n        if <(Z3) < (near plane)> then\n            set [percent v] to (((near plane) - (Z2)) / ((Z1) - (Z2)))\n            Set temp in 3D ((X2) + (((X1) - (X2)) * (percent))) ((Y2) + (((Y1) - (Y2)) * (percent))) (near plane)\n            set [percent v] to (((near plane) - (Z3)) / ((Z1) - (Z3)))\n            Set temp2 in 3D ((X3) + (((X1) - (X3)) * (percent))) ((Y3) + (((Y1) - (Y3)) * (percent))) (near plane)\n            Set screen point1 ((VF) * ((X1) / (Z1))) ((VF) * ((Y1) / (Z1)))\n            Set temp on screen ((VF) * ((tempX) / (tempZ))) ((VF) * ((tempY) / (tempZ)))\n            Set temp2 on screen ((VF) * ((tempX2) / (tempZ2))) ((VF) * ((tempY2) / (tempZ2)))\n            Triangle Filler X1 (X1) Y1 (Y1) X2 (tempX) Y2 (tempY) X3 (tempX2) Y3 (tempY2)\n        else\n            set [percent v] to (((near plane) - (Z2)) / ((Z3) - (Z2)))\n            Set temp in 3D ((X2) + (((X3) - (X2)) * (percent))) ((Y2) + (((Y3) - (Y2)) * (percent))) (near plane)\n            set [percent v] to (((near plane) - (Z1)) / ((Z3) - (Z1)))\n            Set temp2 in 3D ((X1) + (((X3) - (X1)) * (percent))) ((Y1) + (((Y3) - (Y1)) * (percent))) (near plane)\n            Set screen point2 ((VF) * ((X2) / (Z2))) ((VF) * ((Y2) / (Z2)))\n            Set screen point1 ((VF) * ((X1) / (Z1))) ((VF) * ((Y1) / (Z1)))\n            Set temp on screen ((VF) * ((tempX) / (tempZ))) ((VF) * ((tempY) / (tempZ)))\n            Set temp2 on screen ((VF) * ((tempX2) / (tempZ2))) ((VF) * ((tempY2) / (tempZ2)))\n            Triangle Filler X1 (tempX2) Y1 (tempY2) X2 (tempX) Y2 (tempY) X3 (X3) Y3 (Y3)\n            Triangle Filler X1 (X1) Y1 (Y1) X2 (tempX) Y2 (tempY) X3 (tempX2) Y3 (tempY2)\n        end\n    else\n        if <(Z3) < (near plane)> then\n            set [percent v] to (((near plane) - (Z2)) / ((Z3) - (Z2)))\n            Set temp in 3D ((X2) + (((X3) - (X2)) * (percent))) ((Y2) + (((Y3) - (Y2)) * (percent))) (near plane)\n            set [percent v] to (((near plane) - (Z1)) / ((Z3) - (Z1)))\n            Set temp2 in 3D ((X1) + (((X3) - (X1)) * (percent))) ((Y1) + (((Y3) - (Y1)) * (percent))) (near plane)\n            Set screen point2 ((VF) * ((X2) / (Z2))) ((VF) * ((Y2) / (Z2)))\n            Set screen point1 ((VF) * ((X1) / (Z1))) ((VF) * ((Y1) / (Z1)))\n            Triangle Filler X1 (tempX2) Y1 (tempY2) X2 (tempX) Y2 (tempY) X3 (X1) Y3 (Y1)\n            Triangle Filler X1 (X2) Y1 (Y2) X2 (tempX) Y2 (tempY) X3 (X1) Y3 (Y1)\n        else\n            Set screen point1 ((VF) * ((X1) / (Z1))) ((VF) * ((Y1) / (Z1)))\n            Set screen point2 ((VF) * ((X2) / (Z2))) ((VF) * ((Y2) / (Z2)))\n            Set screen point3 ((VF) * ((X3) / (Z3))) ((VF) * ((Y3) / (Z3)))\n            Triangle Filler X1 (X1) Y1 (Y1) X2 (X2) Y2 (Y2) X3 (X3) Y3 (Y3)\n        end\n    end\nend\n\ndefine Project a vertex on screen (x) (y) (z)\nSet point1 ((x) - (Cam X)) ((y) - (Cam Y)) ((z) - (Cam Z))\nSet point1 (((Z1) * (sin Y)) + ((X1) * (cos Y))) (Y1) (((Z1) * (cos Y)) - ((X1) * (sin Y)))\nSet point1 (X1) (((Y1) * (cos X)) - ((Z1) * (sin X))) (((Y1) * (sin X)) + ((Z1) * (cos X)))\nSet screen point1 ((VF) * ((X1) / (Z1))) ((VF) * ((Y1) / (Z1)))\nadd (X1) to [cube vertices on screen x v]\nadd (Y1) to [cube vertices on screen y v]\n\ndefine Draw square (x1) (y1) (z1) , (x2) (y2) (z2) , (x3) (y3) (z3) , (x4) (y4) (z4)\nif <[0] < ((((Cam X) - (x1)) * ((((y2) - (y1)) * ((z3) - (z1))) - (((z2) - (z1)) * ((y3) - (y1))))) + ((((Cam Y) - (y1)) * ((((z2) - (z1)) * ((x3) - (x1))) - (((x2) - (x1)) * ((z3) - (z1))))) + (((Cam Z) - (z1)) * ((((x2) - (x1)) * ((y3) - (y1))) - (((y2) - (y1)) * ((x3) - (x1)))))))> then\n    Draw triangle 3D (x1) (y1) (z1) , (x2) (y2) (z2) , (x3) (y3) (z3)\n    Draw triangle 3D (x1) (y1) (z1) , (x3) (y3) (z3) , (x4) (y4) (z4)\nend\n\nset [near plane v] to [30]\n\ndefine Set temp2 in 3D (x) (y) (z)\nset [tempx2 v] to (x)\nset [tempy2 v] to (y)\nset [tempz2 v] to (z)\n\ndefine Set temp2 on screen (x) (y)\nset [tempx2 v] to (x)\nset [tempy2 v] to (y)\n\nSet screen point3 ((VF) * ((X3) / (Z3))) ((VF) * ((Y3) / (Z3)))\n\npen up\ngo to x: (x1) y: (y1)\npen down\ngo to x: (x2) y: (y2)\ngo to x: (x3) y: (y3)\ngo to x: (x1) y: (y1)\n\nSet screen point3 ((VF) * ((X3) / (Z3))) ((VF) * ((Y3) / (Z3)))\n\nSet temp on screen ((VF) * ((tempX) / (tempZ))) ((VF) * ((tempY) / (tempZ)))\nSet temp2 on screen ((VF) * ((tempX2) / (tempZ2))) ((VF) * ((tempY2) / (tempZ2)))\n\nif <<([abs v] of (X2) ) < [240]> and <([abs v] of (Y2) ) < [180]>> then\n\nset [percent v] to (((near plane) - (Z1)) / ((Z2) - (Z1)))\nif <(Z1) < (near plane)> then\n    Set point1 ((X1) + (((X2) - (X1)) * (percent))) ((Y1) + (((Y2) - (Y1)) * (percent))) (near plane)\nelse\n    if <(Z2) < (near plane)> then\n        Set point2 ((X1) + (((X2) - (X1)) * (percent))) ((Y1) + (((Y2) - (Y1)) * (percent))) (near plane)\n    end\nend\n\ndefine Set screen tempCrd (x) (y)\nset [tempx v] to (x)\nset [tempy v] to (y)\n\nset [filling quality v] to [30]\n\ndefine Go down\nrepeat until <(Collision \(Cube\) Result) = [0]>\n    Collision (Cube)\n    change [p y v] by (-1)\nend\n\nwhen flag clicked\nforever\n    set [test v] to ([cos v] of (rot Y) )\nend\n\nset [iswallrunning v] to [0]\n\nif <([abs v] of ([sin v] of (rot Y) ) ) < [1.41]> then\n\n\n\nchange [p x v] by ((X Speed) * (-1))\nif <(Collision \(Cube\) Result) = [0]> then\n    set [iswallrunning v] to [0]\n    set [x boost v] to ((([abs v] of (X Speed) ) / (X Speed)) * (-20))\nend\nchange [p x v] by (X Speed)\n\nset [test v] to [0]\n\nCollision (Cube)\nif <[] = [0]> then\n    set [iswallrunning v] to [0]\n    change [p z v] by (15)\nend\n\nCollision (Cube)\nif <(Collision \(Cube\) Result) = [0]> then\n    set [iswallrunning v] to [0]\n    change [p z v] by (-15)\nend\n\nif <[] = [red]> then\n    ARGB Alpha (256) Red (240) Green (0) Blue (0)\nelse\n    if <(item (cnt) of [cube color type v]) = [green]> then\n        ARGB Alpha (256) Red (0) Green (240) Blue (0)\n    else\n        ARGB Alpha (256) Red (0) Green (0) Blue (240)\n    end\nend\n\nif <(item (cnt) of [cube color type v]) = [red]> then\n    ARGB Alpha (256) Red (210) Green (0) Blue (0)\nelse\n    if <(item (cnt) of [cube color type v]) = [green]> then\n        ARGB Alpha (256) Red (0) Green (210) Blue (0)\n    else\n        ARGB Alpha (256) Red (0) Green (0) Blue (210)\n    end\nend\n\nif <(item (cnt) of [cube color type v]) = [red]> then\n    ARGB Alpha (256) Red (255) Green (60) Blue (60)\nelse\n    if <(item (cnt) of [cube color type v]) = [green]> then\n        ARGB Alpha (256) Red (60) Green (255) Blue (60)\n    else\n        ARGB Alpha (256) Red (60) Green (60) Blue (255)\n    end\nend\n\nwhen I receive [play jump sound v]\nplay sound [High Whoosh v] until done\n\n\n\nwhen I receive [next level v]\ndelete (all) of [cube x v]\ndelete (all) of [cube y v]\ndelete (all) of [cube z v]\ndelete (all) of [cube size v]\ndelete (all) of [cube color type v]\nchange [level v] by (1)\nset [rot x v] to [0]\nset [rot y v] to [0]\nset [p x v] to [0]\nset [p y v] to [100]\nset [p z v] to [0]\nset [z speed v] to [0]\nset [x speed v] to [0]\nset [y speed v] to [0]\nset [x boost v] to [0]\nset [z boost v] to [0]\nbroadcast (join [Make ] (Level))\n\nwhen I receive [make 2 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (0) (400) size: (200) Color: [1]\nMake a Cube (400) (200) (900) size: (400) Color: [1]\nMake a Cube (400) (200) (1300) size: (400) Color: [1]\nMake a Cube (0) (-200) (1800) size: (400) Color: [1]\nMake a Cube (0) (0) (2300) size: (200) Color: [4]\n\nMake a Cube (900) (200) (400) size: (400) Color: [red]\nMake a Cube (1300) (200) (400) size: (400) Color: [red]\nMake a Cube (1700) (200) (400) size: (400) Color: [red]\nMake a Cube (900) (200) (-400) size: (400) Color: [red]\nMake a Cube (1300) (200) (-400) size: (400) Color: [red]\nMake a Cube (1700) (200) (-400) size: (400) Color: [red]\nMake a Cube (2200) (0) (0) size: (200) Color: [green]\n\nMake a Cube (500) (0) (0) size: (200) Color: [green]\n\nMake a Cube (-400) (200) (900) size: (400) Color: [2]\nMake a Cube (-400) (200) (1300) size: (400) Color: [2]\nMake a Cube (-400) (200) (1700) size: (400) Color: [2]\nMake a Cube (0) (0) (2200) size: (200) Color: [4]\n\nwhen I receive [next level v]\n\nset [level v] to [13]\nbroadcast (Next level v)\n\nwhen I receive [make 3 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (0) (400) size: (200) Color: [1]\nMake a Cube (400) (200) (900) size: (400) Color: [1]\nMake a Cube (400) (200) (1300) size: (400) Color: [1]\nMake a Cube (400) (200) (1700) size: (400) Color: [1]\nMake a Cube (-400) (200) (1700) size: (400) Color: [1]\nMake a Cube (-400) (200) (2100) size: (400) Color: [1]\nMake a Cube (-400) (200) (2500) size: (400) Color: [1]\nMake a Cube (0) (-200) (2900) size: (400) Color: [1]\nMake a Cube (0) (-100) (3400) size: (200) Color: [4]\n\nwhen I receive [make 4 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (0) (500) size: (200) Color: [1]\nMake a Cube (400) (200) (900) size: (400) Color: [1]\nMake a Cube (-400) (200) (1300) size: (400) Color: [1]\nMake a Cube (400) (200) (1700) size: (400) Color: [1]\nMake a Cube (-400) (200) (2100) size: (400) Color: [1]\nMake a Cube (400) (200) (2500) size: (400) Color: [1]\nMake a Cube (0) (-200) (3000) size: (400) Color: [1]\nMake a Cube (0) (-200) (3500) size: (400) Color: [4]\n\nMake a Cube (0) (-100) (3400) size: (200) Color: [4]\n\nwhen I receive [make 5 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (0) (500) size: (200) Color: [3]\nMake a Cube (0) (600) (900) size: (200) Color: [1]\nMake a Cube (0) (600) (1300) size: (200) Color: [4]\n\nwhen I receive [make 6 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (0) (300) size: (200) Color: [2]\nMake a Cube (0) (0) (600) size: (200) Color: [1]\nMake a Cube (0) (0) (900) size: (200) Color: [2]\nMake a Cube (0) (0) (1200) size: (200) Color: [1]\nMake a Cube (0) (0) (1500) size: (200) Color: [4]\n\nMake a Cube (0) (600) (900) size: (200) Color: [1]\nMake a Cube (0) (600) (1300) size: (200) Color: [4]\n\nwhen I receive [make 7 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (0) (500) size: (200) Color: [3]\nMake a Cube (0) (1000) (900) size: (200) Color: [1]\nMake a Cube (200) (1000) (900) size: (200) Color: [1]\nMake a Cube (400) (1000) (900) size: (200) Color: [1]\nMake a Cube (600) (1000) (900) size: (200) Color: [1]\nMake a Cube (900) (700) (600) size: (200) Color: [1]\nMake a Cube (600) (1000) (1100) size: (200) Color: [1]\nMake a Cube (600) (1000) (1300) size: (200) Color: [1]\nMake a Cube (600) (1000) (1300) size: (200) Color: [1]\nMake a Cube (900) (300) (1600) size: (400) Color: [3]\nMake a Cube (-250) (1000) (900) size: (200) Color: [2]\nMake a Cube (-500) (1000) (900) size: (200) Color: [1]\nMake a Cube (-750) (1300) (900) size: (200) Color: [4]\n\nwhen I receive [make 8 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (0) (400) size: (200) Color: [1]\nMake a Cube (400) (200) (900) size: (400) Color: [1]\nMake a Cube (400) (200) (1300) size: (400) Color: [2]\nMake a Cube (400) (200) (1700) size: (400) Color: [1]\nMake a Cube (400) (200) (2100) size: (400) Color: [1]\nMake a Cube (400) (200) (2500) size: (400) Color: [1]\nMake a Cube (400) (200) (2900) size: (400) Color: [2]\nMake a Cube (400) (200) (3300) size: (400) Color: [1]\nMake a Cube (-400) (200) (900) size: (400) Color: [2]\nMake a Cube (-400) (200) (1300) size: (400) Color: [1]\nMake a Cube (-400) (200) (1700) size: (400) Color: [1]\nMake a Cube (-400) (200) (2100) size: (400) Color: [2]\nMake a Cube (-400) (200) (2500) size: (400) Color: [1]\nMake a Cube (-400) (200) (2900) size: (400) Color: [1]\nMake a Cube (-400) (200) (3300) size: (400) Color: [1]\nMake a Cube (0) (-200) (3800) size: (400) Color: [1]\nMake a Cube (0) (-200) (4500) size: (400) Color: [4]\n\nwhen I receive [fast render on v]\nset [filling quality v] to [3]\n\nwhen I receive [fast render off v]\nset [filling quality v] to [10]\n\nwhen I receive [play attach sound v]\nplay sound [Toy Zing v] until done\n\nwhen [p v] key pressed\nbroadcast (Next level v)\n\nwhen I receive [make 9 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (400) (200) (500) size: (400) Color: [1]\nMake a Cube (400) (200) (900) size: (400) Color: [1]\nMake a Cube (0) (200) (1300) size: (400) Color: [1]\nMake a Cube (-400) (200) (1300) size: (400) Color: [1]\nMake a Cube (-800) (200) (1300) size: (400) Color: [1]\nMake a Cube (-1200) (200) (1300) size: (400) Color: [1]\nMake a Cube (-1600) (200) (900) size: (400) Color: [1]\nMake a Cube (-1600) (200) (500) size: (400) Color: [1]\nMake a Cube (-1600) (200) (100) size: (400) Color: [4]\n\nwhen I receive [make 10 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (-200) (500) size: (400) Color: [3]\nMake a Cube (400) (1000) (900) size: (400) Color: [1]\nMake a Cube (400) (1000) (1300) size: (400) Color: [1]\nMake a Cube (400) (1000) (1700) size: (400) Color: [1]\nMake a Cube (0) (600) (2300) size: (400) Color: [3]\nMake a Cube (900) (1300) (300) size: (400) Color: [1]\nMake a Cube (0) (1300) (-200) size: (400) Color: [1]\nMake a Cube (900) (1300) (-700) size: (400) Color: [1]\nMake a Cube (0) (1300) (-1200) size: (400) Color: [4]\n\n\n\nwhen I receive [make 11 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (500) (0) (500) size: (400) Color: [1]\nMake a Cube (-500) (0) (1500) size: (400) Color: [1]\nMake a Cube (500) (0) (2500) size: (400) Color: [1]\nMake a Cube (-500) (0) (3500) size: (400) Color: [1]\nMake a Cube (500) (0) (4500) size: (400) Color: [1]\nMake a Cube (-500) (0) (5500) size: (400) Color: [1]\nMake a Cube (0) (-1000) (1000) size: (400) Color: [3]\nMake a Cube (0) (-1000) (2000) size: (400) Color: [3]\nMake a Cube (0) (-1000) (3000) size: (400) Color: [3]\nMake a Cube (0) (-1000) (4000) size: (400) Color: [3]\nMake a Cube (0) (-1000) (5000) size: (400) Color: [3]\nMake a Cube (0) (-1000) (6000) size: (400) Color: [4]\n\nwhen I receive [make 12 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (0) (-4000) (500) size: (200) Color: [4]\nMake a Cube (300) (-900) (400) size: (200) Color: [2]\nMake a Cube (-300) (-900) (100) size: (200) Color: [2]\nMake a Cube (0) (-2000) (400) size: (200) Color: [2]\nMake a Cube (0) (-3000) (0) size: (200) Color: [2]\n\nwhen I receive [play bounce sound v]\nplay sound [Teleport2 v] until done\n\nerase all\n\nwhen I receive [make 13 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (300) (300) (200) size: (200) Color: [1]\nMake a Cube (300) (300) (400) size: (200) Color: [1]\nMake a Cube (0) (0) (800) size: (200) Color: [3]\nMake a Cube (300) (1000) (200) size: (200) Color: [1]\nMake a Cube (300) (1000) (400) size: (200) Color: [1]\nMake a Cube (0) (700) (-200) size: (200) Color: [3]\nMake a Cube (300) (1700) (200) size: (200) Color: [1]\nMake a Cube (300) (1700) (400) size: (200) Color: [1]\nMake a Cube (0) (1400) (800) size: (200) Color: [3]\nMake a Cube (300) (2400) (200) size: (200) Color: [1]\nMake a Cube (300) (2400) (400) size: (200) Color: [1]\nMake a Cube (0) (2100) (-200) size: (200) Color: [4]\n\nMake a Cube (400) (300) (400) size: (400) Color: [1]\nMake a Cube (400) (400) (800) size: (400) Color: [1]\nMake a Cube (400) (500) (1200) size: (400) Color: [1]\nMake a Cube (400) (600) (1600) size: (400) Color: [1]\nMake a Cube (400) (700) (2000) size: (400) Color: [1]\nMake a Cube (-400) (300) (400) size: (400) Color: [1]\nMake a Cube (-400) (400) (800) size: (400) Color: [1]\nMake a Cube (-400) (500) (1200) size: (400) Color: [1]\nMake a Cube (-400) (600) (1600) size: (400) Color: [1]\nMake a Cube (-400) (700) (2000) size: (400) Color: [1]\n\nset [rot speed v] to [60]\n\nset [wall run speed v] to [25]\n\nwhen I receive [make 14 v]\nMake a Cube (0) (0) (0) size: (200) Color: [1]\nMake a Cube (-200) (200) (400) size: (200) Color: [1]\nMake a Cube (0) (200) (400) size: (200) Color: [1]\nMake a Cube (200) (200) (400) size: (200) Color: [1]\nMake a Cube (400) (200) (-200) size: (200) Color: [1]\nMake a Cube (400) (200) (0) size: (200) Color: [1]\nMake a Cube (400) (200) (200) size: (200) Color: [1]\nMake a Cube (-400) (200) (-200) size: (200) Color: [1]\nMake a Cube (-400) (200) (0) size: (200) Color: [1]\nMake a Cube (-400) (200) (200) size: (200) Color: [1]\nMake a Cube (200) (-600) (200) size: (200) Color: [3]\nMake a Cube (200) (-600) (-200) size: (200) Color: [3]\nMake a Cube (-200) (-600) (200) size: (200) Color: [3]\nMake a Cube (-200) (-600) (-200) size: (200) Color: [3]\n\nMake a Cube (0) (0) (800) size: (200) Color: [3]\n\nMake a Cube (300) (1000) (200) size: (200) Color: [1]\nMake a Cube (300) (1000) (400) size: (200) Color: [1]\nMake a Cube (0) (700) (-200) size: (200) Color: [3]\nMake a Cube (300) (1700) (200) size: (200) Color: [1]\nMake a Cube (300) (1700) (400) size: (200) Color: [1]\nMake a Cube (0) (1400) (800) size: (200) Color: [3]\nMake a Cube (300) (2400) (200) size: (200) Color: [1]\nMake a Cube (300) (2400) (400) size: (200) Color: [1]\nMake a Cube (0) (2100) (-200) size: (200) Color: [4]\n\nMake a Cube (300) (-900) (400) size: (200) Color: [2]\n\n@FPS\n\ndefine FPS\nif <[1] < (timer)> then\n    set [fps v] to (Count)\n    set [count v] to [0]\n    reset timer\nend\n\nwait (0) seconds\n\nwhen flag clicked\nshow variable [fps v]\nset [count v] to [0]\nreset timer\nforever\n    change [count v] by (1)\n    FPS\nend\n\n@スプライト1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (コスチューム1 v)\nset [istipshown v] to [1]\nset [tipnum v] to [1]\nshow\n\nwhen I receive [next level v]\nchange [tipnum v] by (1)\nswitch costume to (tipNum)\n\nwhen [h v] key pressed\nif <(isTipShown) = [1]> then\n    set [istipshown v] to [0]\n    switch costume to (コスチューム15 v)\nelse\n    switch costume to (tipNum)\n    set [istipshown v] to [1]\nend\n\n@スプライト2\n\nwhen this sprite clicked\nif <(costume [number v]) = [1]> then\n    broadcast (Fast render off v)\nend\nif <(costume [number v]) = [2]> then\n    broadcast (Fast render on v)\nend\nnext costume\n\nwhen flag clicked\nshow\nswitch costume to (off v)\n\nhide\n\nerase all\n\n@スプライト3\n\nwhen flag clicked\nhide\n\nshow\n\n
日本語の説明は下です。\nRuns a lot faster on Turbowarp.\nhttps://turbowarp.org/391677846\n\nWASD to move, arrow keys to look around and space to jump. P to skip a level if it's too hard.\nRun into walls to wallrun.\nPress space while wallrunning to jump off the wall.\nIf you have any suggestions, comment here or post in the topic. https://scratch.mit.edu/discuss/topic/403563/\n\nWASDで移動、矢印キーで見渡す。\nスペースでジャンプ。\n壁走り中にスペースを押すと壁を蹴って大きくジャンプできます。