Parkour Platformer - (100% PEN) - Part 1

Instructions: 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

@Stage\n\n@Game\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) [-100] [50] (X1, Y1) [0] [100]\nadd line | type [0] (X0, Y0) [-200] [-50] (X1, Y1) [200] [-50]\nadd line | type [0] (X0, Y0) [-200] [-50] (X1, Y1) [-300] [150]\nadd line | type [0] (X0, Y0) [200] [-50] (X1, Y1) [400] [50]\nadd line | type [0] (X0, Y0) [400] [50] (X1, Y1) [600] [0]\nadd line | type [0] (X0, Y0) [600] [0] (X1, Y1) [1200] [0]\nadd line | type [3] (X0, Y0) [800] [0] (X1, Y1) [900] [100]\nadd line | type [3] (X0, Y0) [1000] [0] (X1, Y1) [900] [100]\nadd line | type [1] (X0, Y0) [1200] [0] (X1, Y1) [1300] [-100]\nadd line | type [1] (X0, Y0) [1450] [-100] (X1, Y1) [1300] [-100]\nadd line | type [0] (X0, Y0) [1450] [200] (X1, Y1) [1950] [200]\nadd line | type [0] (X0, Y0) [1800] [300] (X1, Y1) [1800] [700]\nadd line | type [0] (X0, Y0) [1950] [200] (X1, Y1) [1950] [700]\nadd line | type [0] (X0, Y0) [1800] [700] (X1, Y1) [1600] [700]\nadd line | type [0] (X0, Y0) [1950] [700] (X1, Y1) [2300] [700]\nadd line | type [0] (X0, Y0) [2200] [700] (X1, Y1) [2200] [900]\nadd line | type [0] (X0, Y0) [1800] [300] (X1, Y1) [1850] [300]\nadd line | type [0] (X0, Y0) [1900] [400] (X1, Y1) [1950] [400]\nadd line | type [0] (X0, Y0) [1800] [500] (X1, Y1) [1850] [500]\nadd line | type [0] (X0, Y0) [1900] [600] (X1, Y1) [1950] [600]\nadd line | type [0] (X0, Y0) [1800] [700] (X1, Y1) [1850] [700]\nadd line | type [0] (X0, Y0) [2200] [700] (X1, Y1) [2400] [700]\nadd line | type [1] (X0, Y0) [2400] [700] (X1, Y1) [2450] [700]\nadd line | type [1] (X0, Y0) [2400] [900] (X1, Y1) [2450] [900]\nadd line | type [1] (X0, Y0) [2400] [1100] (X1, Y1) [2450] [1100]\nadd line | type [1] (X0, Y0) [2400] [1300] (X1, Y1) [2450] [1300]\nadd line | type [0] (X0, Y0) [1000] [1500] (X1, Y1) [2450] [1500]\nadd line | type [3] (X0, Y0) [2300] [1600] (X1, Y1) [2200] [1500]\nadd line | type [3] (X0, Y0) [2300] [1600] (X1, Y1) [2400] [1500]\nadd line | type [3] (X0, Y0) [2000] [1600] (X1, Y1) [1900] [1500]\nadd line | type [3] (X0, Y0) [2000] [1600] (X1, Y1) [2100] [1500]\nadd line | type [1] (X0, Y0) [1700] [1500] (X1, Y1) [1800] [1500]\nadd line | type [1] (X0, Y0) [1600] [1700] (X1, Y1) [1700] [1700]\nadd line | type [1] (X0, Y0) [1700] [1900] (X1, Y1) [1800] [1900]\nadd line | type [1] (X0, Y0) [1600] [2100] (X1, Y1) [1700] [2100]\nadd line | type [1] (X0, Y0) [1700] [2300] (X1, Y1) [1800] [2300]\nadd line | type [1] (X0, Y0) [1600] [2500] (X1, Y1) [1700] [2500]\nadd line | type [1] (X0, Y0) [1700] [2700] (X1, Y1) [1800] [2700]\nadd line | type [1] (X0, Y0) [1600] [2900] (X1, Y1) [1700] [2900]\nadd line | type [0] (X0, Y0) [1700] [3100] (X1, Y1) [1800] [3100]\nadd line | type [0] (X0, Y0) [1900] [3100] (X1, Y1) [2000] [3100]\nadd line | type [0] (X0, Y0) [2100] [3100] (X1, Y1) [2150] [3100]\nadd line | type [0] (X0, Y0) [2100] [3100] (X1, Y1) [2200] [3100]\nadd line | type [3] (X0, Y0) [2200] [3100] (X1, Y1) [2300] [3100]\nadd line | type [0] (X0, Y0) [2300] [3100] (X1, Y1) [2400] [3100]\nadd line | type [3] (X0, Y0) [2400] [3100] (X1, Y1) [2500] [3100]\nadd line | type [0] (X0, Y0) [2500] [3100] (X1, Y1) [2600] [3100]\nadd line | type [3] (X0, Y0) [2600] [3100] (X1, Y1) [2700] [3100]\nadd line | type [0] (X0, Y0) [2700] [3100] (X1, Y1) [2800] [3100]\nadd line | type [3] (X0, Y0) [2800] [3100] (X1, Y1) [2900] [3100]\nadd line | type [0] (X0, Y0) [2900] [3100] (X1, Y1) [3100] [3100]\nadd line | type [1] (X0, Y0) [3100] [3100] (X1, Y1) [3700] [3100]\nadd line | type [1] (X0, Y0) [3100] [3300] (X1, Y1) [3700] [3300]\nadd line | type [1] (X0, Y0) [3700] [3300] (X1, Y1) [3700] [3100]\nadd line | type [0] (X0, Y0) [3100] [3600] (X1, Y1) [3700] [3600]\nadd line | type [0] (X0, Y0) [3700] [3600] (X1, Y1) [3700] [4000]\nadd line | type [0] (X0, Y0) [3700] [4000] (X1, Y1) [3800] [4000]\nadd line | type [0] (X0, Y0) [3800] [4000] (X1, Y1) [3800] [4500]\nadd line | type [0] (X0, Y0) [3800] [4500] (X1, Y1) [3900] [4500]\nadd line | type [0] (X0, Y0) [3900] [4500] (X1, Y1) [3900] [5000]\nadd line | type [0] (X0, Y0) [3900] [5000] (X1, Y1) [4200] [5100]\nadd line | type [0] (X0, Y0) [3900] [5100] (X1, Y1) [3700] [5100]\nadd line | type [0] (X0, Y0) [3700] [5200] (X1, Y1) [3500] [5200]\nadd line | type [0] (X0, Y0) [3900] [5300] (X1, Y1) [3700] [5300]\nadd line | type [0] (X0, Y0) [3700] [5400] (X1, Y1) [3500] [5400]\nadd line | type [0] (X0, Y0) [3500] [5400] (X1, Y1) [3500] [5500]\nadd line | type [0] (X0, Y0) [3400] [5500] (X1, Y1) [3500] [5500]\nadd line | type [0] (X0, Y0) [3400] [5500] (X1, Y1) [3400] [5600]\nadd line | type [0] (X0, Y0) [3300] [5600] (X1, Y1) [3400] [5600]\nadd line | type [0] (X0, Y0) [3300] [5600] (X1, Y1) [3300] [5700]\nadd line | type [0] (X0, Y0) [3200] [5700] (X1, Y1) [3300] [5700]\nadd line | type [0] (X0, Y0) [3200] [5700] (X1, Y1) [3200] [5800]\nadd line | type [0] (X0, Y0) [3100] [5800] (X1, Y1) [3200] [5800]\nadd line | type [1] (X0, Y0) [3100] [5800] (X1, Y1) [2900] [5800]\nadd line | type [3] (X0, Y0) [2900] [5800] (X1, Y1) [2800] [5800]\nadd line | type [1] (X0, Y0) [2800] [5800] (X1, Y1) [2600] [5800]\nadd line | type [3] (X0, Y0) [2600] [5800] (X1, Y1) [2500] [5800]\nadd line | type [1] (X0, Y0) [2500] [5800] (X1, Y1) [2300] [5800]\nadd line | type [3] (X0, Y0) [2300] [5800] (X1, Y1) [2200] [5800]\nadd line | type [1] (X0, Y0) [2200] [5800] (X1, Y1) [2000] [5800]\nadd line | type [3] (X0, Y0) [2000] [5800] (X1, Y1) [1900] [5800]\nadd line | type [1] (X0, Y0) [1900] [5800] (X1, Y1) [1700] [5800]\nadd line | type [0] (X0, Y0) [1700] [5800] (X1, Y1) [1600] [5800]\nadd line | type [2] (X0, Y0) [1600] [6000] (X1, Y1) [1600] [5800]\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])\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