Grass-A 3D Platformer #all #games 


@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [start v]\nswitch backdrop to (backdrop2 v)\nforever\n    if <(Music on?) = [yes]> then\n        play sound [Music! v] until done\n    end\nend\n\n@Sprite3\n\nhide\n\nwhen I receive [device? v]\ngo to x: (0) y: (100)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-10)\n        repeat until <(size) > [110]>\n            change size by (3)\n        end\n    else\n        set [brightness v] effect to (10)\n        repeat until <[101] > (size)>\n            change size by (-3)\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (hide v)\nwait (0.1) seconds\nbroadcast (Instructions v)\n\nwhen I receive [hide v]\nstart sound [Jump v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop all sounds\nhide\nset [ghost v] effect to (0)\n\nset [explode second 1 v] to [3]\n\nset [__current end z__ v] to [0]\n\ngo to [back v] layer\n\nwhen I receive [menu v]\nbroadcast (Device? v)\n\n@Sprite2\n\nwhen flag clicked\nset [info? v] to [0]\nswitch costume to (player left v)\nbroadcast (Menu v)\nhide\n\nhide\n\nwhen I receive [instructions v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nforever\n\nif <touching (mouse-pointer v)?> then\n    set [brightness v] effect to (-10)\n    repeat until <(size) > [110]>\n        change size by (3)\n    end\nelse\n    set [brightness v] effect to (10)\n    repeat until <[101] > (size)>\n        change size by (-3)\n    end\nend\n\nwhen this sprite clicked\n\nbroadcast (hide v)\nwait (0.1) seconds\n\nwhen I receive [instructions v]\nwait until <key (z v) pressed?>\ngo to [back v] layer\nstart sound [Jump v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop all sounds\nhide\nset [ghost v] effect to (0)\nbroadcast (Start v)\n\nwait (1) seconds\nnext costume\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait until <key (z v) pressed?>\ngo to [back v] layer\nstart sound [Jump v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop all sounds\nhide\nset [ghost v] effect to (0)\n\nset [explode second 1 v] to [3]\n\nset [__current end z__ v] to [0]\n\nwait (1) seconds\nnext costume\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [info v]\nset [info? v] to [1]\nnext costume\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait until <key (z v) pressed?>\ngo to [back v] layer\nstart sound [Jump v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop all sounds\nhide\nset [ghost v] effect to (0)\nset [info? v] to [0]\n\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [instructions v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@Sprite4\n\nwhen flag clicked\n\nbroadcast (Device? v)\n\nhide\n\nwhen I receive [device? v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-10)\n        repeat until <(size) > [110]>\n            change size by (3)\n        end\n    else\n        set [brightness v] effect to (10)\n        repeat until <[101] > (size)>\n            change size by (-3)\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (hide v)\nwait (0.1) seconds\nbroadcast (Options v)\n\nwhen I receive [hide v]\nstart sound [Jump v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop all sounds\nhide\nset [ghost v] effect to (0)\n\nset [explode second 1 v] to [3]\n\nset [__current end z__ v] to [0]\n\ngo to [back v] layer\n\nwhen I receive [menu v]\nbroadcast (Device? v)\n\n@Sprite5\n\nwhen flag clicked\n\nhide\n\nwhen I receive [device? v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-10)\n        repeat until <(size) > [110]>\n            change size by (3)\n        end\n    else\n        set [brightness v] effect to (10)\n        repeat until <[101] > (size)>\n            change size by (-3)\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (hide v)\nwait (0.1) seconds\nbroadcast (Credit v)\n\nwhen I receive [hide v]\nstart sound [Jump v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop all sounds\nhide\nset [ghost v] effect to (0)\n\nset [explode second 1 v] to [3]\n\nset [__current end z__ v] to [0]\n\ngo to [back v] layer\n\nwhen I receive [menu v]\nbroadcast (Device? v)\n\n@3D engine\n\ndefine Turn and Move\nchange [rot x v] by ((<key (left arrow v) pressed?> - <key (right arrow v) pressed?>) * (Rotation Speed))\nchange [rot y v] by ((<key (up arrow v) pressed?> - <key (down arrow v) pressed?>) * (Rotation Speed))\nif <[90] < (rot Y)> then\n    set [rot y v] to [89]\nend\nif <(rot Y) < [-90]> then\n    set [rot y v] to [-89]\nend\nCalculate Trig Values (rot X) (rot Y)\nchange [zvel v] by (((<key (w v) pressed?> - <key (s v) pressed?>) * (cos Y)) * (Speed))\nchange [xvel v] by (((<key (s v) pressed?> - <key (w v) pressed?>) * (sin Y)) * (Speed))\nchange [zvel v] by (((<key (d v) pressed?> - <key (a v) pressed?>) * (sin Y)) * (Speed))\nchange [xvel v] by (((<key (d v) pressed?> - <key (a v) pressed?>) * (cos Y)) * (Speed))\nPhysics\n\nset [speed v] to [3]\n\nwhen flag clicked\n\ndefine Draw square| Insert the 2 corners (x1) (y1) (z1) (x2) (y2) (z2)\nFill 3D Tri (x1) (y1) (z1) (x2) (y2) (z2) (x2) (y1) (z2)\nFill 3D Tri (x1) (y1) (z1) (x2) (y2) (z2) (x1) (y2) (z1)\n\ndefine Wire Frame\nset pen size to (20)\nchange pen (brightness v) by (-10)\ngo to x: ((FOV) * ((x1) / (z1))) y: ((FOV) * ((y1) / (z1)))\npen down\ngo to x: ((FOV) * ((x2) / (z2))) y: ((FOV) * ((y2) / (z2)))\ngo to x: ((FOV) * ((X3) / (Z3))) y: ((FOV) * ((Y3) / (Z3)))\ngo to x: ((FOV) * ((x1) / (z1))) y: ((FOV) * ((y1) / (z1)))\npen up\n\nLevel design [X] [Y] [Z] [Type]\n\nMoving platform [X1] [Y1] [Z1] to [X2] [Y2] [Z2] Speed [Speed] Platform type [Type]\n\nwhen I receive [start v]\nswitch costume to (costume2 v)\nset size to (Infinity) %\nswitch costume to (costume1 v)\nReset\nset [level v] to [1]\nforever\n    if <not <(Level) = [7]>> then\n        erase all\n        Level\n        Turn and Move\n        if <(touching end) = [yes]> then\n            change [level v] by (1)\n        end\n    end\nend\n\nwhen flag clicked\nerase all\nset [rot x v] to [-1080]\nset [rot y v] to [-24]\n\ndefine fill (ax) (ay) (bx) (by) (cx) (cy) resolution: (res)\nset [lena v] to ([sqrt v] of ((((bx) - (cx)) * ((bx) - (cx))) + (((by) - (cy)) * ((by) - (cy)))) )\nset [lenb v] to ([sqrt v] of ((((ax) - (cx)) * ((ax) - (cx))) + (((ay) - (cy)) * ((ay) - (cy)))) )\nset [lenc v] to ([sqrt v] of ((((ax) - (bx)) * ((ax) - (bx))) + (((ay) - (by)) * ((ay) - (by)))) )\nset [peri v] to ((1) / (((lena) + (lenb)) + (lenc)))\nset [incx v] to (((((lena) * (ax)) + ((lenb) * (bx))) + ((lenc) * (cx))) * (peri))\nset [incy v] to (((((lena) * (ay)) + ((lenb) * (by))) + ((lenc) * (cy))) * (peri))\nset [ind v] to ([sqrt v] of ((((((lenb) + (lenc)) - (lena)) * (((lenc) + (lena)) - (lenb))) * (((lena) + (lenb)) - (lenc))) * (peri)) )\nset [aox v] to ((incx) - (ax))\nset [aoy v] to ((incy) - (ay))\nset [box v] to ((incx) - (bx))\nset [boy v] to ((incy) - (by))\nset [cox v] to ((incx) - (cx))\nset [coy v] to ((incy) - (cy))\nif <<(lena) < (lenb)> and <(lena) < (lenc)>> then\n    set [td v] to ([sqrt v] of (((Aox) * (Aox)) + ((Aoy) * (Aoy))) )\nelse\n    if <<(lenb) > (lena)> or <(lenb) > (lenc)>> then\n        set [td v] to ([sqrt v] of (((Cox) * (Cox)) + ((Coy) * (Coy))) )\n    else\n        set [td v] to ([sqrt v] of (((Box) * (Box)) + ((Boy) * (Boy))) )\n    end\nend\nset [rate v] to ((((td) * (2)) - (ind)) / ((td) * (4)))\nset [td v] to ((1) + (0))\ngo to x: (round (incx)) y: (round (incy))\nset pen size to (ind)\npen down\nrepeat ([ceiling v] of (([log v] of ((res) / (ind)) ) / ([log v] of (rate) )) )\n    set [td v] to ((td) * (rate))\n    set pen size to ((ind) * (td))\n    go to x: (((Aox) * (td)) + (ax)) y: (((Aoy) * (td)) + (ay))\n    go to x: (((Box) * (td)) + (bx)) y: (((Boy) * (td)) + (by))\n    go to x: (((Cox) * (td)) + (cx)) y: (((Coy) * (td)) + (cy))\n    go to x: (((Aox) * (td)) + (ax)) y: (((Aoy) * (td)) + (ay))\nend\npen up\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 Calculate Trig Values (x) (y)\nset [sin x v] to ([sin v] of (y) )\nset [cos x v] to ([cos v] of (y) )\nset [sin y v] to ([sin v] of (x) )\nset [cos y v] to ([cos v] of (x) )\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 <(Player y) < ((item (i) of [cube y pos v]) - (90))>> and <not <(Player y) > ((item (i) of [cube y pos v]) + (130))>>> and <<<not <(Player Z) < ((item (i) of [cube z pos v]) - (100))>> and <not <(Player Z) > ((item (i) of [cube z pos v]) + (100))>>> and <<not <(Player x) < ((item (i) of [cube x pos v]) - (100))>> and <not <(Player x) > ((item (i) of [cube x pos v]) + (100))>>>>> then\n        if <not <(item (i) of [platform type v]) = [Player]>> then\n            if <(item (i) of [platform type v]) = [Platform]> then\n                set [touching platform? v] to [yes]\n            else\n                if <(item (i) of [platform type v]) = [Lava]> then\n                    Reset\n                else\n                    if <(item (i) of [platform type v]) = [Bounce]> then\n                        set [y vel v] to [30]\n                    else\n                        if <(item (i) of [platform type v]) = [Water]> then\n                            set [y vel v] to ((Y vel) * (0.9))\n                            set [xvel v] to ((Xvel) * (0.5))\n                            set [zvel v] to ((Zvel) * (0.5))\n                            set [falling? v] to [0]\n                        else\n                            if <(item (i) of [platform type v]) = [dirt]> then\n                                set [touching platform? v] to [yes]\n                            else\n                                if <(item (i) of [platform type v]) = [Something]> then\n                                    set [touching platform? v] to [yes]\n                                    if <(info 1) = [0]> then\n                                        broadcast (info v)\n                                        set [info 1 v] to [1]\n                                    end\n                                else\n                                    if <(item (i) of [platform type v]) = [Down]> then\n                                        set [y vel v] to [-20]\n                                    else\n                                        if <(item (i) of [platform type v]) = [End]> then\n                                            set [touching end v] to [yes]\n                                            change [level v] by (1)\n                                            Reset\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\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 [player y v] by (Y vel)\nCollisions!\nif <(Touching platform?) = [yes]> then\n    Y collision (Y vel)\nend\nchange [player z v] by (Zvel)\nCollisions!\nif <(Touching platform?) = [yes]> then\n    Z Collision (Zvel)\nend\nchange [player 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 <(cam y) < [-500]> then\n    Reset\nend\nif <(Person view) = [3]> then\n    Set up 3rd person view cam (Player x) (Player y) (Player Z) [200] [200]\n    Level design ((Player x) / (100)) (((Player y) - (10)) / (100)) ((Player Z) / (100)) [Player]\nelse\n    Set Up First person view\nend\nRender\n\ndefine Y collision (y)\nrepeat until <not <(Touching platform?) = [yes]>>\n    if <(y) > [0]> then\n        change [player y v] by (-1)\n    else\n        change [player 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 [player z v] by (-1)\n    else\n        change [player 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 [player x v] by (-1)\n    else\n        change [player x v] by (1)\n    end\n    set [xvel v] to [0]\n    Collisions!\nend\n\ndefine Reset\nset [player x v] to [0]\nset [player y v] to [150]\nset [player z v] to [0]\nset [y vel v] to [0]\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] [Platform]\n    Level design [0] [0] [-1] [Platform]\n    Level design [0] [0] [1] [Platform]\n    Level design [0] [0] [2] [Bounce]\n    Level design [0] [-1] [2] [Bounce]\n    Create a cube at x [0] y [4] z [5] Type [Platform]\n    Level design [0] [4] [8] [Bounce]\n    Level design [0] [4] [12] [Bounce]\n    Level design [0] [4] [16] [Bounce]\n    Level design [0] [4] [20] [Platform]\n    Level design [0] [4] [25] [End]\n    Level design [0] [3] [20] [dirt]\n    Create a cube at x [0] y [3] z [5] Type [dirt]\n    Level design [0] [-1] [0] [dirt]\n    Level design [0] [-1] [-1] [dirt]\n    Level design [0] [-1] [1] [dirt]\nelse\n    if <(Level) = [2]> then\n        Level design [0] [0] [0] [Platform]\n        Level design [0] [-1] [0] [dirt]\n        Level design [0] [0] [1] [lava]\n        Level design [0] [0] [2] [lava]\n        Level design [0] [0] [3] [lava]\n        Level design [0] [0] [4] [Bounce]\n        Level design [0] [5] [8] [water]\n        Level design [0] [5] [9] [water]\n        Level design [0] [5] [10] [water]\n        Level design [0] [5] [13] [End]\n        Level design [0] [-1] [1] [lava]\n        Level design [0] [-1] [2] [lava]\n        Level design [0] [-1] [3] [lava]\n        Level design [0] [-1] [4] [Bounce]\n        Level design [0] [4] [8] [water]\n        Level design [0] [4] [9] [water]\n        Level design [0] [4] [10] [water]\n    end\n    if <(Level) = [3]> then\n        Level design [0] [0] [0] [Platform]\n        Level design [0] [-1] [0] [dirt]\n        Level design [0] (moving Platformer y) [4] [Platform]\n        Level design [0] ((moving Platformer y) - (1)) [4] [dirt]\n        Level design [0] [0] [8] [Platform]\n        Level design [0] [-1] [8] [dirt]\n        Level design [0] [0] [9] [Down]\n        Level design [0] [-3] [9] [Lava]\n        Level design [0] [3] [10.2] [Platform]\n        Level design [0] [2] [10.2] [Platform]\n        Level design [0] [1] [10.2] [Platform]\n        Level design [0] [-3] [8] [dirt]\n        Level design [0] [-2] [8] [dirt]\n        Level design [0] [-3] [10] [Platform]\n        Level design [0] [-4] [8] [dirt]\n        Level design [0] [0] [12] [Platform]\n        Level design [0] [-3] [11] [Platform]\n        Level design [0] [-3] [12] [End]\n        Level design [0] [-4] [10] [dirt]\n        Level design [0] [-4] [11] [dirt]\n        Level design [0] [-4] [9] [Lava]\n        Level design [0] [0] [11] [Platform]\n    end\n    if <(Level) = [4]> then\n        Create a cube at x [0] y [0] z [0] Type [Platform]\n        Create a cube at x [0] y [-1] z [0] Type [dirt]\n        Level design [0] [0] [5] [bounce]\n        Level design [0] [0] [8] [lava]\n        Level design [0] [0] [11] [bounce]\n        Level design [0] [0] [14] [lava]\n        Level design [0] [0] [18] [Bounce]\n        Level design [0] [0] [21] [lava]\n        Level design [0] [0] [24] [End]\n    end\n    if <(Level) = [4]> then\n        Create a cube at x [0] y [0] z [0] Type [Platform]\n        Create a cube at x [0] y [-1] z [0] Type [dirt]\n        Level design [0] [0] [5] [bounce]\n        Level design [0] [0] [8] [lava]\n        Level design [0] [0] [11] [bounce]\n        Level design [0] [0] [14] [lava]\n        Level design [0] [0] [18] [Bounce]\n        Level design [0] [0] [21] [lava]\n        Level design [0] [0] [24] [End]\n    end\n    if <(Level) = [5]> then\n        Create a cube at x [0] y [0] z [0] Type [Platform]\n        Create a cube at x [0] y [-1] z [0] Type [dirt]\n        Level design [0] [1] [4] [Platform]\n        Level design [0] [2] [7] [Platform]\n        Level design [0] [3] [10] [Platform]\n        Level design [0] [3] [10] [Platform]\n        Level design [0] [3] [11] [End]\n        Level design [0] [0] [4] [dirt]\n        Level design [0] [1] [7] [dirt]\n        Level design [0] [2] [10] [dirt]\n    end\n    if <(Level) = [6]> then\n        Level design [0] [0] [0] [Platform]\n        Level design [0] [-1] [0] [dirt]\n        Create a cube at x (moving Platformer y) y [0] z [4] Type [Platform]\n        Create a cube at x (moving Platformer y) y [-1] z [4] Type [Dirt]\n        Level design [-5] [0] [8] [Platform]\n        Level design [-5] [-1] [8] [dirt]\n        Level design [-5] [-4] [13] [Bounce]\n        Level design [-5] [0] [16] [Platform]\n        Level design [-5] [-1] [16] [dirt]\n        Level design [-5] [0] [17] [End]\n    end\n    if <(Level) = [7]> then\n        erase all\n    end\nend\n\nLevel design [-1] [0] [0] [Platform]\nLevel design [0] [0] [0] [Platform]\nLevel design [1] [0] [1] [Platform]\nLevel design [-1] [0] [1] [Platform]\nLevel design [0] [0] [1] [Platform]\nLevel design [1] [0] [-1] [Platform]\nLevel design [-1] [0] [-1] [Platform]\nLevel design [0] [0] [-1] [Platform]\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    if <(item (ii) of [block distances v]) < [1100]> then\n        Select color (item (ii) of [platform type v])\n        Draw Filled Cube At (item (ii) of [cube x pos v]) (item (ii) of [cube y pos v]) (item (ii) of [cube z pos v])\n    end\nend\nDraw Crosshair\n\nwhen flag clicked\n\ndefine Select color (current platform type)\nif <(current platform type) = [Platform]> then\n    set pen color to (#19da00)\nelse\n    if <(current platform type) = [Lava]> then\n        set pen color to (#ff3434)\n    else\n        if <(current platform type) = [Water]> then\n            set pen color to (#207cff)\n        else\n            if <(current platform type) = [Bounce]> then\n                set pen color to (#ffec20)\n            else\n                if <(current platform type) = [End]> then\n                    set pen color to (#d2ffd1)\n                else\n                    if <<(current platform type) = [Something]> and <(info 1) = [0]>> then\n                        set pen color to (#ffd000)\n                    else\n                        if <<(current platform type) = [Something]> and <(info 1) = [1]>> then\n                            set pen color to (#ff6e00)\n                        else\n                            if <(current platform type) = [dirt]> then\n                                set pen color to (#ff8800)\n                            else\n                                if <(current platform type) = [down]> then\n                                    set pen color to (#b200ff)\n                                else\n                                    if <(current platform type) = [Player]> then\n                                        set pen color to (#ff9e30)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Level design (x) (y) (z) (type)\nadd ((x) * (100)) to [cube x pos v]\nadd ((y) * (100)) to [cube y pos v]\nadd ((z) * (100)) to [cube z pos v]\nadd (type) to [platform type v]\n\ndefine Moving platform (x1) (y1) (z1) to (x2) (y2) (z2) Speed (speed) Platform type (type)\nset [speed sin v] to (([sin v] of ((timer) * (speed)) ) + (1))\nLevel design (((((x2) - (x1)) / (2)) * (speed Sin)) + (x1)) (((((y2) - (y1)) / (2)) * (speed Sin)) + (y1)) (((((z2) - (z1)) / (2)) * (speed Sin)) + (z1)) (type)\n\ndefine Set up 3rd person view cam (player x) (player y) (player z) (distance) (height)\nset [cam x v] to ((player x) + (((distance) * (sin Y)) * (cos X)))\nset [cam z v] to ((player z) + ((((distance) * (-1)) * (cos Y)) * (cos X)))\nset [cam y v] to ((player y) + ((distance) * ((sin X) * (-1))))\n\ndefine Draw Filled Cube At (x) (y) (z)\nif <(cam z) < ((z) - (50))> then\n    Draw square| Insert the 2 corners ((x) + (-50)) ((y) + (-50)) ((z) + (-50)) ((x) + (50)) ((y) + (50)) ((z) + (-50))\nend\nif <(cam z) > ((z) + (50))> then\n    Draw square| Insert the 2 corners ((x) + (-50)) ((y) + (-50)) ((z) + (50)) ((x) + (50)) ((y) + (50)) ((z) + (50))\nend\nif <(cam x) > ((x) + (50))> then\n    Draw square| Insert the 2 corners ((x) + (50)) ((y) + (50)) ((z) + (50)) ((x) + (50)) ((y) + (-50)) ((z) + (-50))\nend\nif <(cam x) < ((x) - (50))> then\n    Draw square| Insert the 2 corners ((x) + (-50)) ((y) + (50)) ((z) + (50)) ((x) + (-50)) ((y) + (-50)) ((z) + (-50))\nend\nif <(cam y) > ((y) + (50))> then\n    Fill 3D Tri ((x) + (50)) ((y) + (50)) ((z) + (-50)) ((x) + (-50)) ((y) + (50)) ((z) + (-50)) ((x) + (-50)) ((y) + (50)) ((z) + (50))\n    Fill 3D Tri ((x) + (-50)) ((y) + (50)) ((z) + (50)) ((x) + (50)) ((y) + (50)) ((z) + (50)) ((x) + (50)) ((y) + (50)) ((z) + (-50))\nend\nif <(cam y) < ((y) - (50))> then\n    Fill 3D Tri ((x) + (50)) ((y) + (-50)) ((z) + (-50)) ((x) + (-50)) ((y) + (-50)) ((z) + (-50)) ((x) + (-50)) ((y) + (-50)) ((z) + (50))\n    Fill 3D Tri ((x) + (-50)) ((y) + (-50)) ((z) + (50)) ((x) + (50)) ((y) + (-50)) ((z) + (50)) ((x) + (50)) ((y) + (-50)) ((z) + (-50))\nend\n\ndefine Fill 3D Tri (x1) (y1) (z1) (x2) (y2) (z2) (x3) (y3) (z3)\nX Y Z Setup (x1) (y1) (z1)\nset [x1 v] to (X3)\nset [y1 v] to (Y3)\nset [z1 v] to (Z3)\nX Y Z Setup (x2) (y2) (z2)\nset [x2 v] to (X3)\nset [y2 v] to (Y3)\nset [z2 v] to (Z3)\nX Y Z Setup (x3) (y3) (z3)\nif <not <<(z1) < [1]> and <<(z2) < [1]> and <(Z3) < [1]>>>> then\n    Z Clip\n    set pen (brightness v) to (((1000) - (item (ii) of [block distances v])) / (6))\n    Wire Frame\n    change pen (brightness v) by (10)\n    fill ((FOV) * ((x1) / (z1))) ((FOV) * ((y1) / (z1))) ((FOV) * ((x2) / (z2))) ((FOV) * ((y2) / (z2))) ((FOV) * ((X3) / (Z3))) ((FOV) * ((Y3) / (Z3))) resolution: (1)\nend\n\ndefine Set Point (x) (y) (z)\nset [x3 v] to (x)\nset [y3 v] to (y)\nset [z3 v] to (z)\n\ndefine X Y Z Setup (x) (y) (z)\nSet Point ((x) - (cam x)) [] ((z) - (cam z))\nSet Point (((Z3) * (sin Y)) + ((X3) * (cos Y))) ((y) - (cam y)) (((Z3) * (cos Y)) - ((X3) * (sin Y)))\nSet Point (X3) (((Y3) * (cos X)) - ((Z3) * (sin X))) (((Y3) * (sin X)) + ((Z3) * (cos X)))\n\ndefine Z Clip\nif <(z1) < [1]> then\n    set [z1 v] to [1]\nend\nif <(z2) < [1]> then\n    set [z2 v] to [1]\nend\nif <(Z3) < [1]> then\n    set [z3 v] to [1]\nend\n\ndefine Set Up First person view\nset [cam x v] to (Player x)\nset [cam z v] to (Player Z)\nset [cam y v] to (Player y)\n\nwhen [1 v] key pressed\nset [person view v] to [1]\n\nwhen [2 v] key pressed\nset [person view v] to [3]\n\ndefine Draw Crosshair\n\nset pen size to (2)\nset pen color to (#ffffff)\ngo to x: (-10) y: (0)\npen down\ngo to x: (10) y: (0)\ngo to x: (0) y: (0)\ngo to x: (0) y: (-10)\ngo to x: (0) y: (10)\npen up\n\nLevel design [1] [0] [0] [Platform]\nLevel design [-1] [0] [0] [Platform]\nLevel design [0] [0] [0] [Platform]\nLevel design [1] [0] [1] [Platform]\nLevel design [-1] [0] [1] [Platform]\nLevel design [0] [0] [1] [Platform]\nLevel design [1] [0] [-1] [Platform]\nLevel design [-1] [0] [-1] [Platform]\nLevel design [0] [0] [-1] [Platform]\n\nwhen I receive [start v]\nforever\n    if <(info?) = [0]> then\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\n    end\nend\n\nchange [cos y2 v] by (0.7)\n\nchange [xvel v] by (((<key (s v) pressed?> - <key (w v) pressed?>) * (sin Y2)) * (Speed))\nchange [zvel v] by (((<key (d v) pressed?> - <key (a v) pressed?>) * (sin Y2)) * (Speed))\nchange [xvel v] by (((<key (d v) pressed?> - <key (a v) pressed?>) * (cos Y2)) * (Speed))\nPhysics\n\nset [falling? v] to [0]\nset [y vel v] to ((Y vel) * (0.9))\nset [xvel v] to ((Xvel) * (0.5))\nset [zvel v] to ((Zvel) * (0.5))\n\ndefine Create a cube at x (x) y (y) z (z) Type (type)\nLevel design ((x) + (1)) (y) (z) (type)\nLevel design ((x) - (1)) (y) (z) (type)\nLevel design (x) (y) (z) (type)\nLevel design ((x) + (1)) (y) ((z) + (1)) (type)\nLevel design ((x) - (1)) (y) ((z) + (1)) (type)\nLevel design (x) (y) ((z) + (1)) (type)\nLevel design ((x) + (1)) (y) ((z) - (1)) (type)\nLevel design ((x) - (1)) (y) ((z) - (1)) (type)\nLevel design (x) (y) ((z) - (1)) (type)\n\nCreate a cube at x [0] y [0] z [0] Type [Platform]\n\nCreate a cube at x [0] y [-1] z [0] Type [dirt]\nCreate a cube at x [0] y [-1] z [1] Type [dirt]\nCreate a cube at x [-1] y [-1] z [0] Type [dirt]\nCreate a cube at x [-1] y [-1] z [3] Type [dirt]\nCreate a cube at x [1] y [-1] z [0] Type [dirt]\nCreate a cube at x [1] y [-1] z [3] Type [dirt]\nLevel design [0] [3] [2] [Something]\nLevel design [1] [3] [2] [dirt]\nLevel design [-1] [3] [2] [dirt]\n\nLevel design [0] [3] [2] [Something]\n\nwhen flag clicked\nset [info 1 v] to [0]\n\nif <(current platform type) = [Something]> then\n    set pen color to (#ffd000)\nelse\n    if <(current platform type) = [dirt]> then\n        set pen color to (#ff8800)\n    else\n        if <(current platform type) = [Player]> then\n            set pen color to (#ff9e30)\n        end\n    end\nend\n\nset pen color to (#ff9400)\n\nLevel design [0] [0] [0] [Platform]\nLevel design [0] [0] [-1] [Platform]\nLevel design [0] [0] [1] [Platform]\nLevel design [0] [0] [2] [Bounce]\nCreate a cube at x [0] y [4] z [5] Type [Platform]\nLevel design [0] [4] [8] [Bounce]\nLevel design [0] [4] [12] [Bounce]\nLevel design [0] [4] [16] [Bounce]\nLevel design [0] [4] [20] [Platform]\nLevel design [0] [4] [25] [End]\nLevel design [0] [3] [20] [dirt]\nCreate a cube at x [0] y [3] z [5] Type [dirt]\nLevel design [0] [-1] [0] [dirt]\nLevel design [0] [-1] [-1] [dirt]\nLevel design [0] [-1] [1] [dirt]\n\nLevel design [0] [-1] [0] [dirt]\n\nset [info 1 v] to [1]\n\nwhen I receive [change level v]\n\nwait (0.5) seconds\n\nwhen flag clicked\nset [moving platformer y v] to [0]\nforever\n    repeat (15)\n        change [moving platformer y v] by (-0.25)\n    end\n    wait (1) seconds\n    repeat (15)\n        change [moving platformer y v] by (0.25)\n    end\n    wait (1) seconds\nend\n\nwhen flag clicked\nset [rotation speed v] to [4]\n\nLevel design [0] [0] [8] [lava]\nLevel design [0] [0] [11] [bounce]\nLevel design [0] [0] [14] [lava]\nLevel design [0] [0] [18] [Bounce]\nLevel design [0] [0] [21] [lava]\nLevel design [0] [0] [24] [End]\n\nLevel design [0] [0] [4] [Platform]\nLevel design (moving Platformer y) [-1] [4] [dirt]\n\nLevel design [0] [0] [0] [Platform]\nLevel design [0] [-1] [0] [dirt]\nCreate a cube at x (moving Platformer y) y [0] z [4] Type [Platform]\nCreate a cube at x (moving Platformer y) y [-1] z [4] Type [Dirt]\nLevel design [-5] [0] [8] [Platform]\nLevel design [-5] [-1] [8] [dirt]\nLevel design [-5] [-4] [13] [Bounce]\nLevel design [-5] [0] [16] [Platform]\nLevel design [-5] [-1] [16] [dirt]\nLevel design [-5] [0] [17] [End]\n\nwhen flag clicked\nforever\n    if <(Level) = [7]> then\n        erase all\n    end\nend\n\nwhen I receive [reset v]\nReset\n\n\n\nCreate a cube at x [0] y [0] z [1] Type [Platform]\nCreate a cube at x [-1] y [0] z [0] Type [Platform]\nCreate a cube at x [-1] y [0] z [3] Type [Platform]\nCreate a cube at x [1] y [0] z [0] Type [Platform]\nCreate a cube at x [1] y [0] z [3] Type [Platform]\nLevel design [X] [Y] [Z] [Platform]\nLevel design [X] [Y] [Z] [Lava]\nLevel design [X] [Y] [Z] [Bounce]\n\n@Sprite1\n\nwhen I receive [options v]\ngo to x: (0) y: (50)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\nswitch costume to (costume2 v)\n\nbroadcast (Credit v)\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        set [music on? v] to [yes]\n    else\n        set [music on? v] to [no]\n    end\nend\n\nwhen this sprite clicked\nstart sound [Coin v]\nif <(costume [number v]) = [2]> then\n    switch costume to (costume1 v)\nelse\n    switch costume to (costume2 v)\nend\n\nforever\n\nset [music on? v] to [yes]\n\nset [music on? v] to [no]\n\nwhen I receive [menu v]\nhide\n\nwait (1) seconds\n\nif  then\n    set [music on? v] to [yes]\nend\nif <(costume [number v]) = [1]> then\n    set [music on? v] to [no]\nend\n\nforever\nend\n\nset [music on? v] to [yes]\n\nset [music on? v] to [yes]\n\n@Sprite6\n\nwhen I receive [options v]\nshow variable [rotation speed v]\ngo to x: (0) y: (-30)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\nswitch costume to (costume2 v)\n\nbroadcast (Credit v)\n\nforever\n\nset [music on? v] to [yes]\n\nset [music on? v] to [no]\n\nwhen I receive [menu v]\nhide variable [speed v]\nhide\n\n@Sprite7\n\nwhen flag clicked\nhide\n\nbroadcast (Device? v)\n\nwhen I receive [options v]\ngo to x: (5) y: (-150)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-10)\n        repeat until <(size) > [110]>\n            change size by (3)\n        end\n    else\n        set [brightness v] effect to (10)\n        repeat until <[101] > (size)>\n            change size by (-3)\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Menu v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [hide v]\n\nset [explode second 1 v] to [3]\n\nset [__current end z__ v] to [0]\n\ngo to [back v] layer\n\nwhen I receive [menu v]\n\nbroadcast (Device? v)\n\nstart sound [Jump v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop all sounds\nhide\nset [ghost v] effect to (0)\n\nbroadcast (hide v)\nwait (0.1) seconds\n\nwhen I receive [credit v]\ngo to x: (5) y: (-150)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-10)\n        repeat until <(size) > [110]>\n            change size by (3)\n        end\n    else\n        set [brightness v] effect to (10)\n        repeat until <[101] > (size)>\n            change size by (-3)\n        end\n    end\nend\n\n@Sprite8\n\nwhen I receive [credit v]\ngo to x: (0) y: (-30)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\nswitch costume to (costume2 v)\n\nbroadcast (Credit v)\n\nwhen flag clicked\nforever\n\nwhen this sprite clicked\n\nif <(costume [number v]) = [2]> then\n    switch costume to (costume1 v)\nelse\n    switch costume to (costume2 v)\nend\n\nforever\n\nset [music on? v] to [yes]\n\nset [music on? v] to [no]\n\nwhen I receive [menu v]\nhide variable [rotation speed v]\nhide\n\nshow variable [speed v]\n\n@Sprite9\n\nwhen flag clicked\nerase all\nset [level v] to [1]\nrepeat until <(Level) = [7]>\n    hide\nend\nset size to (1) %\nshow\nrepeat (100)\n    change size by (1)\nend\n\nforever\n    \nend\n\n@Sprite10\n\nwhen flag clicked\nhide\n\nbroadcast (Device? v)\n\nwhen I receive [start v]\ngo to x: (170) y: (-140)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-10)\n        repeat until <(size) > [110]>\n            change size by (3)\n        end\n    else\n        set [brightness v] effect to (10)\n        repeat until <[101] > (size)>\n            change size by (-3)\n        end\n    end\n    if <(Level) = [7]> then\n        hide\n    end\nend\n\nwhen this sprite clicked\nif <not <(Level) = [7]>> then\n    set [touching end v] to [yes]\n    change [level v] by (1)\n    broadcast (reset v)\n    wait (0.7) seconds\nend\n\nwhen I receive [skip v]\n\nset [explode second 1 v] to [3]\n\nset [__current end z__ v] to [0]\n\ngo to [back v] layer\n\nwhen I receive [menu v]\n\nbroadcast (Device? v)\n\nwhen I receive [credit v]\n\nwhen I receive [credit v]\ngo to x: (5) y: (-150)\n\nthink [Hmm...] for (2) seconds\n\n@Sprite11\n\nforever\n    \nend\n\nwhen flag clicked\nhide\n\n