Parkour Platformer - (100% Pen) - Part 2
@Stage\n\n@PEN\n\nwhen flag clicked\nhide\ncreate level\nget colors\nset [goal v] to [0]\nrepeat until <(goal) = [1]>\n    physics [8] <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <key (space v) pressed?>>> <<key (left arrow v) pressed?> or <key (a v) pressed?>> <<key (right arrow v) pressed?> or <key (d v) pressed?>>\n    set [camoffsetx v] to (((0.8) * (camOffsetX)) + ((0.2) * ((-3) * (velX))))\n    set [camoffsety v] to (((0.8) * (camOffsetY)) + ((0.2) * ((-3) * (velY))))\n    set [camx v] to ((playerX) + (camOffsetX))\n    set [camy v] to ((playerY) + (camOffsetY))\n    draw\n    if <<(death) = [1]> or <(playerY) < [-500]>> then\n        reset\n    end\nend\n\ndefine create level\nset [playerx v] to [0]\nset [playery v] to [0]\nset [camoffsetx v] to [0]\nset [camoffsety v] to [0]\nset [slopemove v] to [0]\nset [onground v] to [0]\nset [walljump v] to [0]\ndelete all of [linetype v]\ndelete all of [linex0 v]\ndelete all of [linex1 v]\ndelete all of [liney0 v]\ndelete all of [liney1 v]\nadd line | type [0] (X0, Y0) [-1700] [-50] (X1, Y1) [200] [-50]\nadd line | type [0] (X0, Y0) [200] [-50] (X1, Y1) [300] [150]\nadd line | type [0] (X0, Y0) [-100] [-50] (X1, Y1) [-100] [50]\nadd line | type [0] (X0, Y0) [-100] [50] (X1, Y1) [-200] [50]\nadd line | type [0] (X0, Y0) [-200] [50] (X1, Y1) [-200] [-50]\nadd line | type [0] (X0, Y0) [-300] [-50] (X1, Y1) [-300] [100]\nadd line | type [0] (X0, Y0) [-300] [100] (X1, Y1) [-400] [100]\nadd line | type [0] (X0, Y0) [-400] [100] (X1, Y1) [-400] [-50]\nadd line | type [0] (X0, Y0) [-500] [-50] (X1, Y1) [-500] [200]\nadd line | type [0] (X0, Y0) [-500] [200] (X1, Y1) [-600] [200]\nadd line | type [0] (X0, Y0) [-600] [200] (X1, Y1) [-600] [-50]\nadd line | type [0] (X0, Y0) [-700] [-50] (X1, Y1) [-700] [100]\nadd line | type [0] (X0, Y0) [-700] [100] (X1, Y1) [-800] [100]\nadd line | type [0] (X0, Y0) [-800] [100] (X1, Y1) [-800] [-50]\nadd line | type [3] (X0, Y0) [-1000] [-50] (X1, Y1) [-1050] [0]\nadd line | type [3] (X0, Y0) [-1050] [0] (X1, Y1) [-1100] [-50]\nadd line | type [3] (X0, Y0) [-1200] [-50] (X1, Y1) [-1250] [50]\nadd line | type [3] (X0, Y0) [-1250] [50] (X1, Y1) [-1300] [-50]\nadd line | type [1] (X0, Y0) [-1400] [-50] (X1, Y1) [-1450] [-50]\nadd line | type [3] (X0, Y0) [-1450] [-50] (X1, Y1) [-1500] [150]\nadd line | type [3] (X0, Y0) [-1550] [-50] (X1, Y1) [-1500] [150]\nadd line | type [0] (X0, Y0) [-1700] [-50] (X1, Y1) [-1700] [-450]\nadd line | type [0] (X0, Y0) [-1800] [-50] (X1, Y1) [-1800] [-500]\nadd line | type [0] (X0, Y0) [-1800] [-500] (X1, Y1) [-800] [-500]\nadd line | type [3] (X0, Y0) [-1600] [-500] (X1, Y1) [-1500] [-450]\nadd line | type [3] (X0, Y0) [-1400] [-500] (X1, Y1) [-1500] [-450]\nadd line | type [3] (X0, Y0) [-1200] [-500] (X1, Y1) [-1100] [-450]\nadd line | type [3] (X0, Y0) [-1000] [-500] (X1, Y1) [-1100] [-450]\nadd line | type [1] (X0, Y0) [-800] [-500] (X1, Y1) [-700] [-500]\nadd line | type [0] (X0, Y0) [-700] [-300] (X1, Y1) [-700] [-500]\nadd line | type [1] (X0, Y0) [-700] [-300] (X1, Y1) [-600] [-300]\nadd line | type [0] (X0, Y0) [-600] [-100] (X1, Y1) [-600] [-300]\nadd line | type [0] (X0, Y0) [-600] [-100] (X1, Y1) [-300] [-100]\nadd line | type [1] (X0, Y0) [-300] [-100] (X1, Y1) [200] [-100]\nadd line | type [0] (X0, Y0) [200] [-100] (X1, Y1) [400] [-100]\nadd line | type [0] (X0, Y0) [300] [-50] (X1, Y1) [300] [300]\nadd line | type [0] (X0, Y0) [400] [-100] (X1, Y1) [400] [300]\nadd line | type [1] (X0, Y0) [300] [500] (X1, Y1) [300] [300]\nadd line | type [0] (X0, Y0) [400] [300] (X1, Y1) [600] [300]\nadd line | type [0] (X0, Y0) [600] [400] (X1, Y1) [700] [400]\nadd line | type [0] (X0, Y0) [700] [500] (X1, Y1) [800] [500]\nadd line | type [0] (X0, Y0) [800] [600] (X1, Y1) [900] [600]\nadd line | type [0] (X0, Y0) [900] [600] (X1, Y1) [900] [1000]\nadd line | type [3] (X0, Y0) [800] [650] (X1, Y1) [800] [1000]\nadd line | type [3] (X0, Y0) [800] [1150] (X1, Y1) [1100] [1150]\nadd line | type [0] (X0, Y0) [900] [1000] (X1, Y1) [950] [1000]\nadd line | type [3] (X0, Y0) [950] [1050] (X1, Y1) [1000] [1050]\nadd line | type [0] (X0, Y0) [1000] [1000] (X1, Y1) [1050] [1000]\nadd line | type [0] (X0, Y0) [1050] [1050] (X1, Y1) [1100] [1050]\nadd line | type [0] (X0, Y0) [1100] [1050] (X1, Y1) [1300] [1050]\nadd line | type [0] (X0, Y0) [1100] [1000] (X1, Y1) [1150] [1000]\nadd line | type [0] (X0, Y0) [1200] [1000] (X1, Y1) [1350] [1000]\nadd line | type [3] (X0, Y0) [1300] [1050] (X1, Y1) [1300] [1300]\nadd line | type [1] (X0, Y0) [1350] [1000] (X1, Y1) [1450] [1000]\nadd line | type [1] (X0, Y0) [1450] [1200] (X1, Y1) [1550] [1200]\nadd line | type [1] (X0, Y0) [1550] [1300] (X1, Y1) [1650] [1300]\nadd line | type [1] (X0, Y0) [1650] [1500] (X1, Y1) [1750] [1500]\nadd line | type [0] (X0, Y0) [1850] [1500] (X1, Y1) [1750] [1500]\nadd line | type [0] (X0, Y0) [1850] [1500] (X1, Y1) [1850] [0]\nadd line | type [0] (X0, Y0) [1950] [1750] (X1, Y1) [1950] [0]\nadd line | type [3] (X0, Y0) [1750] [0] (X1, Y1) [1950] [0]\nadd line | type [0] (X0, Y0) [1950] [1750] (X1, Y1) [2050] [1750]\nadd line | type [1] (X0, Y0) [2250] [1750] (X1, Y1) [2050] [1750]\nadd line | type [2] (X0, Y0) [2350] [1750] (X1, Y1) [2250] [1750]\nadd line | type [3] (X0, Y0) [1950] [2050] (X1, Y1) [3000] [2050]\n\ndefine physics (steps) <up> <left> <right>\nget physics platforms ((playerX) - (80)) ((playerX) + (80)) ((playerY) - (80)) ((playerY) + (80))\nset [death v] to [0]\nchange [walljump v] by (-1)\nrepeat (steps)\n    change [onground v] by ((-1) / (steps))\n    if <up> then\n        if <(onground) > [0]> then\n            set [vely v] to [22]\n            set [onground v] to [0]\n            set [slopemove v] to [0]\n        else\n            if <(walljump) > [0]> then\n                if <<(walldir) = [right]> and <left>> then\n                    set [vely v] to [15]\n                    set [velx v] to [-12]\n                else\n                    if <<(walldir) = [left]> and <right>> then\n                        set [vely v] to [15]\n                        set [velx v] to [12]\n                    end\n                end\n            end\n        end\n    end\n    if <left> then\n        change [velx v] by ((-3) / (steps))\n    end\n    if <right> then\n        change [velx v] by ((3) / (steps))\n    end\n    if <(slopemove) > [0]> then\n        set [vely v] to ((steps) * (slopemove))\n    else\n        change [vely v] by ((-1.5) / (steps))\n    end\n    if <(velY) > [65]> then\n        set [vely v] to [65]\n    else\n        if <(velY) < [-65]> then\n            set [vely v] to [-65]\n        end\n    end\n    move Y ((velY) / (steps)) (playerY) ((playerX) - (10)) ((playerX) + (10)) ((playerY) - (10)) ((playerY) + (10))\n    if <(death) = [1]> then\n        set [goal v] to [0]\n        stop [this script v]\n    end\n    if <(goal) = [1]> then\n        stop [this script v]\n    end\n    if <not <(slopemove) = [0]>> then\n        set [velx v] to ((steps) * (slopemove))\n    end\n    if <(velX) > [65]> then\n        set [velx v] to [65]\n    else\n        if <(velX) < [-65]> then\n            set [velx v] to [-65]\n        end\n    end\n    move X ((velX) / (steps)) (playerX) ((playerX) - (10)) ((playerX) + (10)) ((playerY) - (10)) ((playerY) + (10))\n    if <(death) = [1]> then\n        set [goal v] to [0]\n        stop [this script v]\n    end\n    if <(goal) = [1]> then\n        stop [this script v]\n    end\nend\nset [velx v] to ((0.8) * (velX))\nif <([abs v] of (velX) ) < [0.5]> then\n    set [velx v] to [0]\nend\nset [vely v] to ((0.96) * (velY))\nif <([abs v] of (velY) ) < [0.5]> then\n    set [vely v] to [0]\nend\n\ndefine draw\nget draw lines\npen up\nerase all\nset pen color to ((1) * (16777215))\nset pen size to (200)\ngo to x: (-250) y: (-90)\npen down\nset x to (250)\nset y to (90)\nset x to (-250)\nset y to (-90)\npen up\nset pen size to (6)\nset [_i0 v] to [0]\nrepeat (4)\n    set pen color to (item ((_i0) + (1)) of [colors v])\n    set [_i1 v] to [1]\n    repeat ((length of [drawlines v]) / (5))\n        if <(item (_i1) of [drawlines v]) = (_i0)> then\n            go to x: (item ((_i1) + (1)) of [drawlines v]) y: (item ((_i1) + (2)) of [drawlines v])\n            pen down\n            go to x: (item ((_i1) + (3)) of [drawlines v]) y: (item ((_i1) + (4)) of [drawlines v])\n            pen up\n        end\n        change [_i1 v] by (5)\n    end\n    change [_i0 v] by (1)\nend\ndraw player ((playerX) - (camX)) ((playerY) - (camY))\n\ndefine reset\nset [playerx v] to [0]\nset [playery v] to [0]\nset [velx v] to [0]\nset [vely v] to [0]\nset [camoffsetx v] to (camX)\nset [camoffsety v] to (camY)\nset [slopemove v] to [0]\nset [onground v] to [0]\nset [walljump v] to [0]\n\ndefine add line | type (type) (X0, Y0) (x0) (y0) (X1, Y1) (x1) (y1)\nadd (type) to [linetype v]\nadd (x0) to [linex0 v]\nadd (y0) to [liney0 v]\nadd (x1) to [linex1 v]\nadd (y1) to [liney1 v]\n\ndefine get draw lines\ndelete all of [drawlines v]\nset [_i0 v] to [1]\nrepeat (length of [linetype v])\n    add draw line (item (_i0) of [linetype v]) ((item (_i0) of [linex0 v]) - (camX)) ((item (_i0) of [liney0 v]) - (camY)) ((item (_i0) of [linex1 v]) - (camX)) ((item (_i0) of [liney1 v]) - (camY))\n    change [_i0 v] by (1)\nend\n\ndefine add draw line (type) (x0) (y0) (x1) (y1)\nif <(x0) < (x1)> then\n    set [_x0 v] to (x0)\n    set [_y0 v] to (y0)\n    set [_x1 v] to (x1)\n    set [_y1 v] to (y1)\nelse\n    set [_x0 v] to (x1)\n    set [_y0 v] to (y1)\n    set [_x1 v] to (x0)\n    set [_y1 v] to (y0)\nend\nif <<(_x1) < [-250]> or <(_x0) > [250]>> then\n    stop [this script v]\nend\nif <(_y0) < (_y1)> then\n    if <<(_y1) < [-190]> or <(_y0) > [190]>> then\n        stop [this script v]\n    end\nelse\n    if <<(_y0) < [-190]> or <(_y1) > [190]>> then\n        stop [this script v]\n    end\nend\nif <(_x0) < [-250]> then\n    set [_y0 v] to ((_y0) + (((_y1) - (_y0)) * (((-250) - (_x0)) / ((_x1) - (_x0)))))\n    set [_x0 v] to [-250]\nend\nif <(_y0) < [-190]> then\n    set [_x0 v] to ((_x0) + (((_x1) - (_x0)) * (((-190) - (_y0)) / ((_y1) - (_y0)))))\n    set [_y0 v] to [-190]\nelse\n    if <(_y0) > [190]> then\n        set [_x0 v] to ((_x0) + (((_x1) - (_x0)) * (((190) - (_y0)) / ((_y1) - (_y0)))))\n        set [_y0 v] to [190]\n    end\nend\nif <(_x0) < [-250]> then\n    stop [this script v]\nend\nif <(_x1) > [250]> then\n    set [_y1 v] to ((_y0) + (((_y1) - (_y0)) * (((250) - (_x0)) / ((_x1) - (_x0)))))\n    set [_x1 v] to [250]\nend\nif <(_y1) < [-190]> then\n    set [_x1 v] to ((_x0) + (((_x1) - (_x0)) * (((-190) - (_y0)) / ((_y1) - (_y0)))))\n    set [_y1 v] to [-190]\nelse\n    if <(_y1) > [190]> then\n        set [_x1 v] to ((_x0) + (((_x1) - (_x0)) * (((190) - (_y0)) / ((_y1) - (_y0)))))\n        set [_y1 v] to [190]\n    end\nend\nif <(_x1) > [250]> then\n    stop [this script v]\nend\nadd (type) to [drawlines v]\nadd (_x0) to [drawlines v]\nadd (_y0) to [drawlines v]\nadd (_x1) to [drawlines v]\nadd (_y1) to [drawlines v]\n\ndefine get colors\ndelete all of [colors v]\nadd ((((65536) * (0)) + ((256) * (0))) + (0)) to [colors v]\nadd ((((65536) * (255)) + ((256) * (63))) + (247)) to [colors v]\nadd ((((65536) * (63)) + ((256) * (247))) + (63)) to [colors v]\nadd ((((65536) * (255)) + ((256) * (95))) + (63)) to [colors v]\nadd ((((65536) * (0)) + ((256) * (127))) + (255)) to [colors v]\n\ndefine draw player (x) (y)\nset pen size to (4)\nset pen color to (item (5) of [colors v])\nset pen color to (#ff0000)\ngo to x: ((x) - (8)) y: ((y) - (8))\npen down\nchange x by (16)\nchange y by (16)\nchange x by (-16)\nchange y by (-16)\npen up\n\ndefine get physics platforms (xmin) (xmax) (ymin) (ymax)\ndelete all of [physicsplats v]\nset [_i0 v] to [1]\nrepeat (length of [linetype v])\n    set [_i1 v] to [1]\n    if <(item (_i0) of [linex0 v]) < (item (_i0) of [linex1 v])> then\n        if <<(item (_i0) of [linex1 v]) < (xmin)> or <(item (_i0) of [linex0 v]) > (xmax)>> then\n            set [_i1 v] to [0]\n        end\n    else\n        if <<(item (_i0) of [linex0 v]) < (xmin)> or <(item (_i0) of [linex1 v]) > (xmax)>> then\n            set [_i1 v] to [0]\n        end\n    end\n    if <(item (_i0) of [liney0 v]) < (item (_i0) of [liney1 v])> then\n        if <<(item (_i0) of [liney1 v]) < (ymin)> or <(item (_i0) of [liney0 v]) > (ymax)>> then\n            set [_i1 v] to [0]\n        end\n    else\n        if <<(item (_i0) of [liney0 v]) < (ymin)> or <(item (_i0) of [liney1 v]) > (ymax)>> then\n            set [_i1 v] to [0]\n        end\n    end\n    if <(_i1) = [1]> then\n        add (_i0) to [physicsplats v]\n    end\n    change [_i0 v] by (1)\nend\n\ndefine move Y (vel) (cy) (xmin) (xmax) (ymin) (ymax)\nset [slopemove v] to [0]\nif <(vel) = [0]> then\n    stop [this script v]\nend\nset [_highid v] to [none]\nset [_hightype v] to [-1]\nset [_lowid v] to [none]\nset [_lowtype v] to [-1]\nif <(vel) > [0]> then\n    set [_highpos v] to ((ymax) + (vel))\n    set [_lowpos v] to (cy)\nelse\n    set [_highpos v] to (cy)\n    set [_lowpos v] to ((ymin) + (vel))\nend\nset [_i0 v] to [1]\nrepeat (length of [physicsplats v])\n    set [_i1 v] to (item (_i0) of [physicsplats v])\n    set [_i2 v] to [1]\n    if <(item (_i1) of [linex0 v]) < (item (_i1) of [linex1 v])> then\n        if <not <<(item (_i1) of [linex1 v]) > (xmin)> and <(item (_i1) of [linex0 v]) < (xmax)>>> then\n            set [_i2 v] to [0]\n        end\n    else\n        if <not <<(item (_i1) of [linex0 v]) > (xmin)> and <(item (_i1) of [linex1 v]) < (xmax)>>> then\n            set [_i2 v] to [0]\n        end\n    end\n    if <(_i2) = [1]> then\n        platform collision (item (_i1) of [liney0 v]) (item (_i1) of [linex0 v]) (item (_i1) of [liney1 v]) (item (_i1) of [linex1 v]) (cy) (xmin) (xmax)\n    end\n    change [_i0 v] by (1)\nend\nif <(vel) > [0]> then\n    change [playery v] by ((_highPos) - (ymax))\n    set [_i0 v] to (_highType)\n    set [_i1 v] to (_highID)\nelse\n    change [playery v] by ((_lowPos) - (ymin))\n    set [_i0 v] to (_lowType)\n    set [_i1 v] to (_lowID)\nend\nif <(_i0) = [3]> then\n    set [death v] to [1]\nelse\n    if <(_i0) = [2]> then\n        set [goal v] to [1]\n    else\n        if <(_i0) = [1]> then\n            set [vely v] to ((-40) * ((velY) / ([abs v] of (velY) )))\n        else\n            if <(_i0) = [0]> then\n                if <(vel) < [0]> then\n                    set [_i2 v] to [0]\n                    if <(item (_i1) of [liney0 v]) < (item (_i1) of [liney1 v])> then\n                        if <(item (_i1) of [liney1 v]) > (ymin)> then\n                            set [_i2 v] to [1]\n                        end\n                    else\n                        if <(item (_i1) of [liney0 v]) > (ymin)> then\n                            set [_i2 v] to [1]\n                        end\n                    end\n                    if <(_i2) = [1]> then\n                        set [_i2 v] to (((item (_i1) of [linex1 v]) - (item (_i1) of [linex0 v])) / ((item (_i1) of [liney1 v]) - (item (_i1) of [liney0 v])))\n                        if <([abs v] of (_i2) ) < [1]> then\n                            set [slopemove v] to ((_i2) * (vel))\n                            set [onground v] to [0]\n                        end\n                    end\n                end\n                if <(slopemove) = [0]> then\n                    set [vely v] to [0]\n                    if <(vel) < [0]> then\n                        set [onground v] to [4]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine move X (vel) (cx) (xmin) (xmax) (ymin) (ymax)\nset [slopemove v] to [0]\nif <(vel) = [0]> then\n    stop [this script v]\nend\nset [_highid v] to [none]\nset [_hightype v] to [-1]\nset [_lowid v] to [none]\nset [_lowtype v] to [-1]\nif <(vel) > [0]> then\n    set [_highpos v] to ((xmax) + (vel))\n    set [_lowpos v] to (cx)\nelse\n    set [_highpos v] to (cx)\n    set [_lowpos v] to ((xmin) + (vel))\nend\nset [_i0 v] to [1]\nrepeat (length of [physicsplats v])\n    set [_i1 v] to (item (_i0) of [physicsplats v])\n    set [_i2 v] to [1]\n    if <(item (_i1) of [liney0 v]) < (item (_i1) of [liney1 v])> then\n        if <not <<(item (_i1) of [liney1 v]) > (ymin)> and <(item (_i1) of [liney0 v]) < (ymax)>>> then\n            set [_i2 v] to [0]\n        end\n    else\n        if <not <<(item (_i1) of [liney0 v]) > (ymin)> and <(item (_i1) of [liney1 v]) < (ymax)>>> then\n            set [_i2 v] to [0]\n        end\n    end\n    if <(_i2) = [1]> then\n        platform collision (item (_i1) of [linex0 v]) (item (_i1) of [liney0 v]) (item (_i1) of [linex1 v]) (item (_i1) of [liney1 v]) (cx) (ymin) (ymax)\n    end\n    change [_i0 v] by (1)\nend\nif <(vel) > [0]> then\n    change [playerx v] by ((_highPos) - (xmax))\n    set [_i0 v] to (_highType)\n    set [_i1 v] to (_highID)\nelse\n    change [playerx v] by ((_lowPos) - (xmin))\n    set [_i0 v] to (_lowType)\n    set [_i1 v] to (_lowID)\nend\nif <(_i0) = [3]> then\n    set [death v] to [1]\nelse\n    if <(_i0) = [2]> then\n        set [goal v] to [1]\n    else\n        if <(_i0) = [1]> then\n            set [velx v] to ((-40) * ((velX) / ([abs v] of (velX) )))\n        else\n            if <(_i0) = [0]> then\n                set [_i2 v] to (((item (_i1) of [liney1 v]) - (item (_i1) of [liney0 v])) / ((item (_i1) of [linex1 v]) - (item (_i1) of [linex0 v])))\n                if <<<(vel) > [0]> and <<(_i2) < [1]> and <(_i2) > [0]>>> or <<(vel) < [0]> and <<(_i2) > [-1]> and <(_i2) < [0]>>>> then\n                    set [slopemove v] to ([abs v] of ((_i2) * (vel)) )\n                    set [onground v] to [3]\n                end\n                if <(slopemove) = [0]> then\n                    set [velx v] to [0]\n                    if <(item (_i1) of [linex0 v]) = (item (_i1) of [linex1 v])> then\n                        if <(vel) > [0]> then\n                            set [walldir v] to [right]\n                        else\n                            set [walldir v] to [left]\n                        end\n                        set [walljump v] to [8]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine platform collision (x0) (y0) (x1) (y1) (cx) (ymin) (ymax)\nset [_i2 v] to (item (_i1) of [linetype v])\nif <(y0) < (ymin)> then\n    set [_x0 v] to ((x0) + (((x1) - (x0)) * (((ymin) - (y0)) / ((y1) - (y0)))))\nelse\n    if <(y0) > (ymax)> then\n        set [_x0 v] to ((x0) + (((x1) - (x0)) * (((ymax) - (y0)) / ((y1) - (y0)))))\n    else\n        set [_x0 v] to (x0)\n    end\nend\nif <(_x0) > (cx)> then\n    if <<(_x0) < (_highPos)> or <<(_i2) > (_highType)> and <(_x0) = (_highPos)>>> then\n        set [_highid v] to (_i1)\n        set [_hightype v] to (_i2)\n        set [_highpos v] to (_x0)\n    end\nelse\n    if <(_x0) < (cx)> then\n        if <<(_x0) > (_lowPos)> or <<(_i2) > (_lowType)> and <(_x0) = (_lowPos)>>> then\n            set [_lowid v] to (_i1)\n            set [_lowtype v] to (_i2)\n            set [_lowpos v] to (_x0)\n        end\n    end\nend\nif <(y1) < (ymin)> then\n    set [_x0 v] to ((x0) + (((x1) - (x0)) * (((ymin) - (y0)) / ((y1) - (y0)))))\nelse\n    if <(y1) > (ymax)> then\n        set [_x0 v] to ((x0) + (((x1) - (x0)) * (((ymax) - (y0)) / ((y1) - (y0)))))\n    else\n        set [_x0 v] to (x1)\n    end\nend\nif <(_x0) > (cx)> then\n    if <<(_x0) < (_highPos)> or <<(_i2) > (_highType)> and <(_x0) = (_highPos)>>> then\n        set [_highid v] to (_i1)\n        set [_hightype v] to (_i2)\n        set [_highpos v] to (_x0)\n    end\nelse\n    if <(_x0) < (cx)> then\n        if <<(_x0) > (_lowPos)> or <<(_i2) > (_lowType)> and <(_x0) = (_lowPos)>>> then\n            set [_lowid v] to (_i1)\n            set [_lowtype v] to (_i2)\n            set [_lowpos v] to (_x0)\n        end\n    end\nend\n\n@thumbnail\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nwait (3) seconds\nhide\n\n
Use arrow keys to move. To Wall Jump, Hold the up arrow and switch between the left and right keys.\nRed kills you.\nPink is bouncy.\nThe green line is the last part.\nEnjoy!\n