Toxic Zone | A Platformer


@Stage\n\nwhen flag clicked\nforever\n    set [fps v] to ((frame) - (1))\n    set [frame v] to [0]\n    reset timer\n    repeat until <(timer) > [1]>\n        change [frame v] by (1)\n    end\nend\n\n@game\n\ndefine Set Point 1: (x1) (y1) (z1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\nset [z1 v] to (z1)\n\ndefine Set Point 2: (x2) (y2) (z2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nset [z2 v] to (z2)\n\ndefine Draw Line (x1) (y1) (z1) to (x2) (y2) (z2)\nSet Point 1: ((x1) - (cam x)) ((y1) - (cam y)) ((z1) - (cam z))\nSet Point 2: ((x2) - (cam x)) ((y2) - (cam y)) ((z2) - (cam z))\nSet Point 1: (((z1) * (sin Y)) + ((x1) * (cos Y))) (y1) (((z1) * (cos Y)) - ((x1) * (sin Y)))\nSet Point 2: (((z2) * (sin Y)) + ((x2) * (cos Y))) (y2) (((z2) * (cos Y)) - ((x2) * (sin Y)))\nSet Point 1: (x1) (((y1) * (cos X)) - ((z1) * (sin X))) (((y1) * (sin X)) + ((z1) * (cos X)))\nSet Point 2: (x2) (((y2) * (cos X)) - ((z2) * (sin X))) (((y2) * (sin X)) + ((z2) * (cos X)))\nif <not <<(z1) < (near plane)> and <(z2) < (near plane)>>> then\n    Z Clipping\n    Set Screen Point 1: ((view factor) * ((x1) / (z1))) ((view factor) * ((y1) / (z1)))\n    Set Screen Point 2: ((view factor) * ((x2) / (z2))) ((view factor) * ((y2) / (z2)))\n    if <(resolution) > [2]> then\n        XY Clipping\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 Set Screen Point 1: (x1) (y1)\nset [x1 v] to (x1)\nset [y1 v] to (y1)\n\ndefine Set Screen Point 2: (x2) (y2)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\n\ndefine --- (label)\n\ndefine Calculate Trig 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 Z Clipping\nif <<(z1) < (near plane)> or <(z2) < (near plane)>> then\n    set [m v] to (((near plane) - (z1)) / ((z2) - (z1)))\n    if <(z1) < (near plane)> then\n        Set Point 1: ((x1) + (((x2) - (x1)) * (m))) ((y1) + (((y2) - (y1)) * (m))) (near plane)\n    else\n        if <(z2) < (near plane)> then\n            Set Point 2: ((x1) + (((x2) - (x1)) * (m))) ((y1) + (((y2) - (y1)) * (m))) (near plane)\n        end\n    end\nend\n\ndefine XY Clipping\nset [m v] to (((y2) - (y1)) / ((x2) - (x1)))\nif <(x1) > [240]> then\n    if <(x2) > [240]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: (240) ((y1) + (((240) - (x1)) * (m)))\n    end\nend\nif <(y1) > [180]> then\n    if <(y2) > [180]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: ((x1) + (((180) - (y1)) / (m))) (180)\n    end\nend\nif <(x1) < [-240]> then\n    if <(x2) < [-240]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: (-240) ((y1) + (((-240) - (x1)) * (m)))\n    end\nend\nif <(y1) < [-180]> then\n    if <(y2) < [-180]> then\n        stop [this script v]\n    else\n        Set Screen Point 1: ((x1) + (((-180) - (y1)) / (m))) (-180)\n    end\nend\nif <(x2) > [240]> then\n    Set Screen Point 2: (240) ((y1) + (((240) - (x1)) * (m)))\nend\nif <(y2) > [180]> then\n    Set Screen Point 2: ((x1) + (((180) - (y1)) / (m))) (180)\nend\nif <(x2) < [-240]> then\n    Set Screen Point 2: (-240) ((y1) + (((-240) - (x1)) * (m)))\nend\nif <(y2) < [-180]> then\n    Set Screen Point 2: ((x1) + (((-180) - (y1)) / (m))) (-180)\nend\n\nwhen flag clicked\nset [level v] to [1]\ngame reset\nforever\n    tick\n    erase all\n    render\n    level (level)\nend\n\ndefine tick\nif <key (w v) pressed?> then\n    change [cam x vel v] by ((() - ([sin v] of (rot Y) )) * (3))\n    change [cam z vel v] by (([cos v] of (rot Y) ) * (3))\nend\nif <key (s v) pressed?> then\n    change [cam x vel v] by (([sin v] of (rot Y) ) * (3))\n    change [cam z vel v] by ((() - ([cos v] of (rot Y) )) * (3))\nend\nif <key (d v) pressed?> then\n    change [cam x vel v] by (([sin v] of ((rot Y) + (90)) ) * (3))\n    change [cam z vel v] by (([cos v] of ((rot Y) + (-90)) ) * (3))\nend\nif <key (a v) pressed?> then\n    change [cam x vel v] by (([sin v] of ((rot Y) + (-90)) ) * (3))\n    change [cam z vel v] by (([cos v] of ((rot Y) + (90)) ) * (3))\nend\nif <<key (space v) pressed?> and <[4] > (falling?)>> then\n    if <(level) = [3]> then\n        set [cam y vel v] to [18.5]\n    else\n        set [cam y vel v] to [16]\n    end\nend\nif <key (up arrow v) pressed?> then\n    change [rot x vel v] by (2)\nend\nif <key (down arrow v) pressed?> then\n    change [rot x vel v] by (-2)\nend\nif <key (right arrow v) pressed?> then\n    change [rot y vel v] by (-2)\nend\nif <key (left arrow v) pressed?> then\n    change [rot y vel v] by (2)\nend\nchange [falling? v] by (1)\nchange [cam y vel v] by (-0.9)\nchange y by ([floor v] of (cam y vel) )\nset [rot x vel v] to ((rot x vel) * (0.7))\nset [rot y vel v] to ((rot y vel) * (0.7))\nchange [rot x v] by (rot x vel)\nchange [rot y v] by (rot y vel)\nif <(rot X) > [90]> then\n    set [rot x v] to [90]\nend\nif <[-90] > (rot X)> then\n    set [rot x v] to [-90]\nend\nif <(rot Y) > [180]> then\n    set [rot y v] to [-180]\nend\nif <[-180] > (rot Y)> then\n    set [rot y v] to [180]\nend\nif <[-1700] > (cam y y)> then\n    game reset\nend\nset [cam x vel v] to ((cam x vel) * (0.7))\nset [cam z vel v] to ((cam z vel) * (0.7))\nchange x by (cam x vel)\nchange z by (cam z vel)\nset [cam y v] to ((cam y y) + (100))\nset [cam x v] to (cam x x)\nset [cam z v] to (cam z z)\n\ndefine render\nCalculate Trig Values\nset [letter v] to [0]\nset pen color to (#006aff)\nset pen size to (5)\nrepeat (length of [level blocks v])\n    change [letter v] by (1)\n    calculate cube location [1]\n    draw cube at (x cube) (y cube) (z cube)\nend\nset [letter v] to [0]\nset pen color to (#ff0000)\nset pen size to (5)\nrepeat (length of [level danger v])\n    change [letter v] by (1)\n    calculate cube location [2]\n    draw cube at (x cube) (y cube) (z cube)\nend\nset [letter v] to [0]\nset pen color to (#19ff00)\nset pen size to (5)\nrepeat (length of [level end v])\n    change [letter v] by (1)\n    calculate cube location [3]\n    draw cube at (x cube) (y cube) (z cube)\nend\nset [letter v] to [0]\nset pen color to (#eeff00)\nset pen size to (5)\nrepeat (length of [level bouncers v])\n    change [letter v] by (1)\n    calculate cube location [4]\n    draw cube at (x cube) (y cube) (z cube)\nend\n\ndefine add block at (x) (y) (z) (t)\nif <(t) = [1]> then\n    add (join ((x) + (45)) (join ((y) + (45)) ((z) + (45)))) to [level blocks v]\nelse\n    if <(t) = [2]> then\n        add (join ((x) + (45)) (join ((y) + (45)) ((z) + (45)))) to [level danger v]\n    else\n        if <(t) = [3]> then\n            add (join ((x) + (45)) (join ((y) + (45)) ((z) + (45)))) to [level end v]\n        else\n            if <(t) = [4]> then\n                add (join ((x) + (45)) (join ((y) + (45)) ((z) + (45)))) to [level bouncers v]\n            end\n        end\n    end\nend\n\ndefine level (l)\ndelete all of [level blocks v]\ndelete all of [level danger v]\ndelete all of [level end v]\ndelete all of [level bouncers v]\nif <(l) = [1]> then\n    add block at [0] [-1] [0] [1]\n    add block at [2] [0] [0] [1]\n    add block at [4] [1] [0] [1]\n    add block at [4] [2] [-2] [1]\n    add block at [4] [3] [-4] [3]\nelse\n    if <(l) = [2]> then\n        add block at [0] [-1] [0] [1]\n        add block at [1] [-1] [0] [1]\n        add block at [2] [0] [0] [2]\n        add block at [2] [-1] [0] [1]\n        add block at [3] [-1] [0] [1]\n        add block at [4] [-1] [0] [1]\n        add block at [5] [-1] [0] [1]\n        add block at [5] [0] [0] [2]\n        add block at [6] [-1] [0] [1]\n        add block at [7] [-1] [0] [1]\n        add block at [10] [1] [0] [3]\n    else\n        if <(l) = [3]> then\n            add block at [0] [-1] [0] [1]\n            add block at [1] [0] [0] [2]\n            add block at [2] [1] [0] [1]\n            add block at [3] [2] [0] [2]\n            add block at [4] [3] [0] [1]\n            add block at [8] [-5] [0] [3]\n            add block at [10] [2] [0] [2]\n            add block at [10] [3] [0] [2]\n            add block at [10] [4] [0] [2]\n            add block at [10] [5] [0] [2]\n            add block at [10] [6] [0] [2]\n            add block at [10] [3] [1] [2]\n            add block at [10] [3] [-1] [2]\n            add block at [10] [4] [2] [2]\n            add block at [10] [4] [-2] [2]\n        else\n            if <(l) = [4]> then\n                add block at [0] [-1] [0] [1]\n                add block at [1] [-1] [0] [1]\n                add block at [1] [0] [0] [4]\n                add block at [3] [4] [0] [4]\n                add block at [5] [8] [0] [4]\n                add block at [7] [12] [0] [1]\n                add block at [8] [12] [0] [1]\n                add block at [8] [13] [0] [3]\n            else\n                if <(l) = [5]> then\n                    add block at [0] [-1] [0] [1]\n                    add block at [2] [-3] [-1] [2]\n                    add block at [1] [-5] [2] [2]\n                    add block at [1] [-8] [0] [2]\n                    add block at [3] [-9] [2] [2]\n                    add block at [2] [-14] [4] [2]\n                    add block at [2] [-17] [-2] [2]\n                    add block at [2] [-17] [0] [3]\n                else\n                    if <(l) = [6]> then\n                        add block at [0] [-1] [0] [1]\n                        add block at [1] [-1] [0] [1]\n                        add block at [1] [0] [0] [4]\n                        add block at [1] [4] [0] [1]\n                        add block at [4] [4] [0] [1]\n                        add block at [5] [4] [0] [1]\n                        add block at [5] [5] [0] [1]\n                        add block at [6] [5] [0] [1]\n                        add block at [6] [6] [0] [1]\n                        add block at [7] [6] [0] [1]\n                        add block at [7] [6] [-1] [1]\n                        add block at [7] [6] [-4] [1]\n                        add block at [7] [6] [-7] [1]\n                        add block at [7] [6] [-10] [3]\n                    else\n                        if <(l) = [7]> then\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine draw cube at (x) (y) (z)\nif <[3] = (resolution)> then\n    --- [up cube]\n    Draw Line ((x) + (-50)) ((y) + (50)) ((z) + (-50)) to ((x) + (50)) ((y) + (50)) ((z) + (-50))\n    Draw Line ((x) + (50)) ((y) + (50)) ((z) + (-50)) to ((x) + (50)) ((y) + (50)) ((z) + (50))\n    Draw Line ((x) + (50)) ((y) + (50)) ((z) + (50)) to ((x) + (-50)) ((y) + (50)) ((z) + (50))\n    Draw Line ((x) + (-50)) ((y) + (50)) ((z) + (50)) to ((x) + (-50)) ((y) + (50)) ((z) + (-50))\n    --- [down cube]\n    Draw Line ((x) + (-50)) ((y) + (-50)) ((z) + (-50)) to ((x) + (50)) ((y) + (-50)) ((z) + (-50))\n    Draw Line ((x) + (50)) ((y) + (-50)) ((z) + (-50)) to ((x) + (50)) ((y) + (-50)) ((z) + (50))\n    Draw Line ((x) + (50)) ((y) + (-50)) ((z) + (50)) to ((x) + (-50)) ((y) + (-50)) ((z) + (50))\n    Draw Line ((x) + (-50)) ((y) + (-50)) ((z) + (50)) to ((x) + (-50)) ((y) + (-50)) ((z) + (-50))\n    --- [edge cube]\n    Draw Line ((x) + (-50)) ((y) + (-50)) ((z) + (-50)) to ((x) + (-50)) ((y) + (50)) ((z) + (-50))\n    Draw Line ((x) + (50)) ((y) + (-50)) ((z) + (-50)) to ((x) + (50)) ((y) + (50)) ((z) + (-50))\n    Draw Line ((x) + (50)) ((y) + (-50)) ((z) + (50)) to ((x) + (50)) ((y) + (50)) ((z) + (50))\n    Draw Line ((x) + (-50)) ((y) + (-50)) ((z) + (50)) to ((x) + (-50)) ((y) + (50)) ((z) + (50))\nelse\n    if <[2] = (resolution)> then\n        --- [up cube]\n        Draw Line ((x) + (-50)) ((y) + (50)) ((z) + (-50)) to ((x) + (50)) ((y) + (50)) ((z) + (-50))\n        Draw Line ((x) + (50)) ((y) + (50)) ((z) + (-50)) to ((x) + (50)) ((y) + (50)) ((z) + (50))\n        Draw Line ((x) + (50)) ((y) + (50)) ((z) + (50)) to ((x) + (-50)) ((y) + (50)) ((z) + (50))\n        Draw Line ((x) + (-50)) ((y) + (50)) ((z) + (50)) to ((x) + (-50)) ((y) + (50)) ((z) + (-50))\n        --- [down cube]\n        Draw Line ((x) + (-50)) ((y) + (-50)) ((z) + (-50)) to ((x) + (50)) ((y) + (-50)) ((z) + (-50))\n        Draw Line ((x) + (50)) ((y) + (-50)) ((z) + (-50)) to ((x) + (50)) ((y) + (-50)) ((z) + (50))\n        Draw Line ((x) + (50)) ((y) + (-50)) ((z) + (50)) to ((x) + (-50)) ((y) + (-50)) ((z) + (50))\n        Draw Line ((x) + (-50)) ((y) + (-50)) ((z) + (50)) to ((x) + (-50)) ((y) + (-50)) ((z) + (-50))\n        --- [edge cube]\n        Draw Line ((x) + (-50)) ((y) + (-50)) ((z) + (-50)) to ((x) + (-50)) ((y) + (50)) ((z) + (-50))\n        Draw Line ((x) + (50)) ((y) + (-50)) ((z) + (-50)) to ((x) + (50)) ((y) + (50)) ((z) + (-50))\n        Draw Line ((x) + (50)) ((y) + (-50)) ((z) + (50)) to ((x) + (50)) ((y) + (50)) ((z) + (50))\n        Draw Line ((x) + (-50)) ((y) + (-50)) ((z) + (50)) to ((x) + (-50)) ((y) + (50)) ((z) + (50))\n    else\n        if <[1] = ((resolution) mod (4))> then\n            --- [up cube]\n            Draw Line ((x) + (-50)) ((y) + (50)) ((z) + (-50)) to ((x) + (50)) ((y) + (50)) ((z) + (-50))\n            Draw Line ((x) + (50)) ((y) + (50)) ((z) + (-50)) to ((x) + (50)) ((y) + (50)) ((z) + (50))\n            Draw Line ((x) + (50)) ((y) + (50)) ((z) + (50)) to ((x) + (-50)) ((y) + (50)) ((z) + (50))\n            Draw Line ((x) + (-50)) ((y) + (50)) ((z) + (50)) to ((x) + (-50)) ((y) + (50)) ((z) + (-50))\n        end\n    end\nend\n\ndefine calculate cube location (i)\nif <(i) = [1]> then\n    set [x cube v] to (((join (letter (1) of (item (letter) of [level blocks v])) (letter (2) of (item (letter) of [level blocks v]))) - (45)) * (100))\n    set [y cube v] to (((join (letter (3) of (item (letter) of [level blocks v])) (letter (4) of (item (letter) of [level blocks v]))) - (45)) * (100))\n    set [z cube v] to (((join (letter (5) of (item (letter) of [level blocks v])) (letter (6) of (item (letter) of [level blocks v]))) - (45)) * (100))\nelse\n    if <(i) = [2]> then\n        set [x cube v] to (((join (letter (1) of (item (letter) of [level danger v])) (letter (2) of (item (letter) of [level danger v]))) - (45)) * (100))\n        set [y cube v] to (((join (letter (3) of (item (letter) of [level danger v])) (letter (4) of (item (letter) of [level danger v]))) - (45)) * (100))\n        set [z cube v] to (((join (letter (5) of (item (letter) of [level danger v])) (letter (6) of (item (letter) of [level danger v]))) - (45)) * (100))\n    else\n        if <(i) = [3]> then\n            set [x cube v] to (((join (letter (1) of (item (letter) of [level end v])) (letter (2) of (item (letter) of [level end v]))) - (45)) * (100))\n            set [y cube v] to (((join (letter (3) of (item (letter) of [level end v])) (letter (4) of (item (letter) of [level end v]))) - (45)) * (100))\n            set [z cube v] to (((join (letter (5) of (item (letter) of [level end v])) (letter (6) of (item (letter) of [level end v]))) - (45)) * (100))\n        else\n            if <(i) = [4]> then\n                set [x cube v] to (((join (letter (1) of (item (letter) of [level bouncers v])) (letter (2) of (item (letter) of [level bouncers v]))) - (45)) * (100))\n                set [y cube v] to (((join (letter (3) of (item (letter) of [level bouncers v])) (letter (4) of (item (letter) of [level bouncers v]))) - (45)) * (100))\n                set [z cube v] to (((join (letter (5) of (item (letter) of [level bouncers v])) (letter (6) of (item (letter) of [level bouncers v]))) - (45)) * (100))\n            end\n        end\n    end\nend\n\ndefine change x by (xs)\nchange [cam x x v] by (xs)\nrepeat until <<not <[level blocks v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (100)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>> and <not <[level bouncers v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (160)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>>>\n    if <(xs) > [0]> then\n        change [cam x x v] by (-1)\n    else\n        change [cam x x v] by (1)\n    end\n    set [cam z vel v] to [0]\n    set [cam x vel v] to [0]\nend\nif <[level danger v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (100)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    game reset\nend\nif <[level end v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (100)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    change [level v] by (1)\n    game reset\nend\nrepeat until <<not <[level blocks v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>> and <not <[level bouncers v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>>>\n    if <(xs) > [0]> then\n        change [cam x x v] by (-1)\n    else\n        change [cam x x v] by (1)\n    end\n    set [cam z vel v] to [0]\n    set [cam x vel v] to [0]\nend\nif <[level danger v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    game reset\nend\nif <[level end v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    change [level v] by (1)\n    game reset\nend\n\ndefine change z by (zs)\nchange [cam z z v] by (zs)\nrepeat until <<not <[level blocks v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (100)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>> and <not <[level bouncers v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (160)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>>>\n    if <(zs) > [0]> then\n        change [cam z z v] by (-1)\n    else\n        change [cam z z v] by (1)\n    end\n    set [cam z vel v] to [0]\n    set [cam x vel v] to [0]\nend\nif <[level danger v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (100)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    game reset\nend\nif <[level end v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (100)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    change [level v] by (1)\n    game reset\nend\nrepeat until <<not <[level blocks v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>> and <not <[level bouncers v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>>>\n    if <(zs) > [0]> then\n        change [cam z z v] by (-1)\n    else\n        change [cam z z v] by (1)\n    end\n    set [cam z vel v] to [0]\n    set [cam x vel v] to [0]\nend\nif <[level danger v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    game reset\nend\nif <[level end v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    change [level v] by (1)\n    game reset\nend\n\ndefine change y by (ys)\nchange [cam y y v] by (ys)\nrepeat until <not <[level blocks v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (100)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>>\n    if <(ys) > [0]> then\n        change [cam y y v] by (-1)\n    else\n        change [cam y y v] by (1)\n        set [falling? v] to [0]\n    end\n    set [cam y vel v] to [0]\nend\nif <[level danger v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (100)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    game reset\nend\nif <[level end v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round (((cam y y) + (100)) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    change [level v] by (1)\n    game reset\nend\nrepeat until <not <[level blocks v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>>\n    if <(ys) > [0]> then\n        change [cam y y v] by (-1)\n    else\n        change [cam y y v] by (1)\n        set [falling? v] to [0]\n    end\n    set [cam y vel v] to [0]\nend\nif <[level danger v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    game reset\nend\nif <[level end v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?> then\n    change [level v] by (1)\n    game reset\nend\nrepeat until <not <[level bouncers v] contains (join ((round ((cam x x) / (100))) + (45)) (join ((round ((cam y y) / (100))) + (45)) ((round ((cam z z) / (100))) + (45))))?>>\n    if <(ys) > [0]> then\n        change [cam y y v] by (-1)\n        set [cam y vel v] to [0]\n    else\n        change [cam y y v] by (1)\n        set [cam y vel v] to [30]\n    end\nend\n\ndefine game reset\nset [falling? v] to [666]\nset [rot x v] to [0]\nset [rot y v] to [-90]\nset [cam x x v] to [0]\nset [cam x vel v] to [0]\nset [cam y y v] to [0]\nset [cam y vel v] to [0]\nset [cam z z v] to [0]\nset [cam z vel v] to [0]\nlevel (level)\n\nchange [level v] by (1)\n\nadd block at [0] [-1] [0] [1]\n\n@resolution\n\nwhen flag clicked\nset [resolution v] to [3]\nforever\n    switch costume to ((resolution) mod (3))\nend\n\nwhen this sprite clicked\nchange [resolution v] by (1)\nif <(resolution) > [3]> then\n    set [resolution v] to [1]\nend\n\n@the end\n\nwhen flag clicked\nforever\n    if <(level) = [7]> then\n        show\n        set [x v] to (pick random (-10) to (10))\n        set [y v] to (pick random (-10) to (10))\n        set [size v] to (pick random (90) to (120))\n        repeat (10)\n            change x by (((x) - (x position)) / (pick random (3) to (10)))\n            change y by (((y) - (y position)) / (pick random (3) to (10)))\n            change size by (((size) - (size)) / (pick random (3) to (10)))\n        end\n    else\n        hide\n    end\nend\n\n@thumbnail\n\nwhen flag clicked\nhide\nshow variable [fps v]\n\n