Sketchbook - 100% Pen Platformer

Instructions: Arrow keys/WASD/Mobile to move\nAvoid red\nJump on top of bouncies to use them\nGet to the end of the screen\nIt's called sketchbook because it's pen and u use pens in sketchbooks. GeT iT?1?!!1?\nPretty generic but it's 100% pen without any hitboxes\nAlso no wall jumping because I'm too lazy to add it

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nplay sound [TheFatRat - Epic v] until done\n\n@pen\n\nwhen flag clicked\nerase all\npen up\nset [level v] to [1]\nbroadcast (reset v) and wait\nforever\n    erase all\n    draw background\n    draw horizontal lines (horizontal lines)\n    draw vertical lines (vertical lines)\n    player\nend\n\ndefine draw line from x: (x) y: (y) to x: (x2) y: (y2)\npen up\ngo to x: (x) y: (y)\npen down\ngo to x: (x2) y: (y2)\npen up\n\ndefine player\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x)>>> then\n    change [xv v] by (.9)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x)>>> then\n    change [xv v] by (-.9)\nend\nset [xv v] to ((Xv) * (.9))\nchange [x v] by (Xv)\nvertical collisions\nif <(vertical touching?) = [1]> then\n    change [x v] by ((Xv) * (-1))\n    set [xv v] to [0]\nend\nif <(Yv) > [-15]> then\n    change [yv v] by (-1)\nend\nchange [y v] by (Yv)\nhorizontal collisions\nif <(horizontal touching?) = [1]> then\n    change [y v] by ((Yv) * (-1))\n    set [yv v] to [0]\nend\nif <(touching bounce?) = [1]> then\n    set [yv v] to [22]\n    set [touching bounce? v] to [0]\nend\nchange [y v] by (-1)\nhorizontal collisions\nif <(horizontal touching?) = [1]> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y) + (20))>>> then\n        set [yv v] to [15]\n    end\nend\nchange [y v] by (1)\ndraw player size: [10]\nif <(x) > [240]> then\n    change [level v] by (1)\n    broadcast (reset v)\nend\nif <[-260] > (x)> then\n    set [x v] to [-260]\nend\n\ndefine draw player size: (size)\nset pen size to (5)\nset pen color to (#005dff)\nset [size for collisions v] to (size)\npen up\ngo to x: ((x) - (size)) y: ((y) + (size))\npen down\ngo to x: ((x) + (size)) y: ((y) + (size))\ngo to x: ((x) + (size)) y: ((y) - (size))\ngo to x: ((x) - (size)) y: ((y) - (size))\ngo to x: ((x) - (size)) y: ((y) + (size))\n\ndefine add horizontal (x) (y) (x2) (y2) (type)\nadd ((x) - (20)) to [line point x horizontal v]\nadd (y) to [line point y horizontal v]\nadd ((x2) + (20)) to [line point x2 horizontal v]\nadd (y2) to [line point y2 horizontal v]\nadd (type) to [horizontal type v]\nchange [horizontal lines v] by (1)\n\ndefine horizontal collisions\nset [# for player collisions v] to [1]\nrepeat (length of [line point x horizontal v])\n    if <<<(item (# for player collisions) of [line point x horizontal v]) < ((x) - (size for collisions))> and <(item (# for player collisions) of [line point x2 horizontal v]) > ((x) + (size for collisions))>> and <<((y) - (size for collisions)) < (item (# for player collisions) of [line point y horizontal v])> and <((y) + (size for collisions)) > (item (# for player collisions) of [line point y2 horizontal v])>>> then\n        if <(item (# for player collisions) of [horizontal type v]) = [1]> then\n            set [horizontal touching? v] to [1]\n            stop [this script v]\n        end\n        if <(item (# for player collisions) of [horizontal type v]) = [2]> then\n            broadcast (reset v)\n        end\n        if <(item (# for player collisions) of [horizontal type v]) = [3]> then\n            set [touching bounce? v] to [1]\n        end\n    else\n        set [horizontal touching? v] to [0]\n    end\n    change [# for player collisions v] by (1)\nend\n\ndefine draw horizontal lines (amount)\nset [# for line points v] to [1]\nrepeat (amount)\n    if <(item (# for line points) of [horizontal type v]) = [1]> then\n        set pen color to (#000000)\n        set pen size to (5)\n    end\n    if <(item (# for line points) of [horizontal type v]) = [2]> then\n        set pen color to (#ff0000)\n        set pen size to (6)\n    end\n    if <(item (# for line points) of [horizontal type v]) = [3]> then\n        set pen color to (#ffc300)\n        set pen size to (6)\n    end\n    draw line from x: ((item (# for line points) of [line point x horizontal v]) + (20)) y: (item (# for line points) of [line point y horizontal v]) to x: ((item (# for line points) of [line point x2 horizontal v]) - (20)) y: (item (# for line points) of [line point y2 horizontal v])\n    change [# for line points v] by (1)\nend\n\ndefine add vertical (x) (y) (x2) (y2) (type)\nadd (x) to [line point x vertical v]\nadd ((y) - (20)) to [line point y vertical v]\nadd (x2) to [line point x2 vertical v]\nadd ((y2) + (20)) to [line point y2 vertical v]\nadd (type) to [vertical type v]\nchange [vertical lines v] by (1)\n\ndefine draw vertical lines (amount)\nset [# for line points v] to [1]\nrepeat (amount)\n    if <(item (# for line points) of [vertical type v]) = [1]> then\n        set pen color to (#000000)\n        set pen size to (5)\n    end\n    if <(item (# for line points) of [vertical type v]) = [2]> then\n        set pen color to (#ff0000)\n        set pen size to (6)\n    end\n    if <(item (# for line points) of [vertical type v]) = [3]> then\n        set pen color to (#ffc300)\n        set pen size to (6)\n    end\n    draw line from x: (item (# for line points) of [line point x vertical v]) y: ((item (# for line points) of [line point y vertical v]) + (20)) to x: (item (# for line points) of [line point x2 vertical v]) y: ((item (# for line points) of [line point y2 vertical v]) - (20))\n    change [# for line points v] by (1)\nend\n\nwhen I receive [reset v]\ndelete all of [line point x horizontal v]\ndelete all of [line point y horizontal v]\ndelete all of [line point x2 horizontal v]\ndelete all of [line point y2 horizontal v]\ndelete all of [line point y vertical v]\ndelete all of [line point x vertical v]\ndelete all of [line point y2 vertical v]\ndelete all of [line point x2 vertical v]\ndelete all of [horizontal type v]\ndelete all of [vertical type v]\nset [horizontal lines v] to [0]\nset [vertical lines v] to [0]\nset [horizontal touching? v] to [0]\nset [vertical touching? v] to [0]\nset [touching bounce? v] to [0]\nset [x v] to [-180]\nset [y v] to [-50]\nset [xv v] to [0]\nset [yv v] to [0]\nif <(level) = [1]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\nend\nif <(level) = [2]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add vertical [75] [-120] [75] [120] [1]\n    add vertical [-75] [-80] [-75] [300] [1]\n    add horizontal [-75] [-80] [-75] [-80] [1]\n    add horizontal [45] [-36] [71] [-36] [1]\n    add vertical [45] [-36] [45] [-36] [1]\n    add horizontal [-72] [29] [-40] [29] [1]\n    add vertical [-40] [29] [-40] [29] [1]\n    add horizontal [45] [95] [72] [95] [1]\n    add vertical [45] [95] [45] [95] [1]\n    add horizontal [75] [120] [75] [120] [1]\nend\nif <(level) = [3]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add horizontal [-100] [-115] [-50] [-115] [2]\n    add vertical [-100] [-115] [-100] [-115] [2]\n    add vertical [-50] [-115] [-50] [-115] [2]\n    add horizontal [50] [-115] [100] [-115] [2]\n    add vertical [50] [-115] [50] [-115] [2]\n    add vertical [100] [-115] [100] [-115] [2]\nend\nif <(level) = [4]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add horizontal [-110] [-115] [-60] [-115] [3]\n    add vertical [-50] [-120] [-50] [75] [1]\n    add horizontal [-50] [75] [-50] [75] [1]\n    add horizontal [70] [-115] [120] [-115] [2]\n    add vertical [70] [-115] [70] [-115] [2]\n    add vertical [120] [-115] [120] [-115] [2]\nend\nif <(level) = [5]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add horizontal [-110] [-115] [-60] [-115] [3]\n    add vertical [-50] [-115] [-50] [75] [2]\n    add horizontal [-50] [75] [-50] [75] [2]\n    add horizontal [70] [0] [120] [0] [1]\n    add vertical [70] [0] [70] [0] [1]\n    add vertical [120] [0] [120] [0] [1]\n    add horizontal [-50] [-115] [300] [-115] [2]\nend\nif <(level) = [6]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add vertical [75] [-120] [75] [120] [1]\n    add vertical [-75] [-80] [-75] [300] [1]\n    add horizontal [-75] [-80] [-75] [-80] [1]\n    add horizontal [75] [120] [75] [120] [1]\n    add horizontal [-72] [50] [-40] [50] [1]\n    add vertical [-40] [50] [-40] [50] [1]\n    add horizontal [20] [-115] [70] [-115] [3]\n    add horizontal [75] [-115] [300] [-115] [2]\nend\nif <(level) = [7]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add vertical [0] [-120] [0] [120] [1]\n    add horizontal [0] [120] [0] [120] [1]\n    add horizontal [-35] [-50] [0] [-50] [1]\n    add horizontal [-35] [50] [0] [50] [1]\n    add vertical [-35] [-50] [-35] [-50] [1]\n    add vertical [-35] [50] [-35] [50] [1]\n    add vertical [50] [-80] [50] [300] [2]\nend\nif <(level) = [8]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add horizontal [-140] [-115] [300] [-115] [3]\n    add horizontal [-100] [-110] [-60] [-110] [2]\n    add vertical [-100] [-110] [-100] [-110] [2]\n    add vertical [-60] [-110] [-60] [-110] [2]\n    add horizontal [0] [-110] [40] [-110] [2]\n    add vertical [0] [-110] [0] [-110] [2]\n    add vertical [40] [-110] [40] [-110] [2]\n    add horizontal [100] [-110] [140] [-110] [2]\n    add vertical [100] [-110] [100] [-110] [2]\n    add vertical [140] [-110] [140] [-110] [2]\n    add vertical [190] [-120] [190] [80] [2]\nend\nif <(level) = [9]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add horizontal [-150] [-115] [300] [-115] [2]\n    add vertical [-150] [-115] [-150] [-115] [2]\n    add horizontal [-100] [-40] [-60] [-40] [1]\n    add vertical [-100] [-40] [-100] [-40] [1]\n    add vertical [-60] [-40] [-60] [-40] [1]\n    add horizontal [50] [30] [90] [30] [1]\n    add vertical [50] [30] [50] [30] [1]\n    add vertical [90] [30] [90] [30] [1]\nend\nif <(level) = [10]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add vertical [-120] [-120] [-120] [100] [1]\n    add horizontal [-120] [100] [-120] [100] [1]\n    add horizontal [-300] [60] [-180] [60] [1]\n    add vertical [-180] [60] [-180] [60] [1]\n    add horizontal [-160] [-115] [-120] [-115] [3]\n    add vertical [-80] [-80] [-80] [300] [2]\n    add horizontal [0] [-115] [50] [-115] [3]\n    add horizontal [50] [-115] [300] [-115] [2]\nend\nif <(level) = [11]> then\n    add horizontal [-300] [-120] [300] [-120] [1]\n    add vertical [200] [-120] [200] [300] [1]\nend\n\ndefine draw background\nset pen color to (#71d8eb)\nset pen size to (2)\npen up\ngo to x: (-300) y: (160)\npen down\ngo to x: (300) y: (160)\npen up\ngo to x: (-300) y: (130)\npen down\ngo to x: (300) y: (130)\npen up\ngo to x: (-300) y: (100)\npen down\ngo to x: (300) y: (100)\npen up\ngo to x: (-300) y: (70)\npen down\ngo to x: (300) y: (70)\npen up\ngo to x: (-300) y: (40)\npen down\ngo to x: (300) y: (40)\npen up\ngo to x: (-300) y: (10)\npen down\ngo to x: (300) y: (10)\npen up\ngo to x: (-300) y: (-20)\npen down\ngo to x: (300) y: (-20)\npen up\ngo to x: (-300) y: (-50)\npen down\ngo to x: (300) y: (-50)\npen up\ngo to x: (-300) y: (-80)\npen down\ngo to x: (300) y: (-80)\npen up\ngo to x: (-300) y: (-110)\npen down\ngo to x: (300) y: (-110)\npen up\ngo to x: (-300) y: (-140)\npen down\ngo to x: (300) y: (-140)\npen up\ngo to x: (-300) y: (-170)\npen down\ngo to x: (300) y: (-170)\npen up\n\ndefine vertical collisions\nset [# for player collisions v] to [1]\nrepeat (length of [line point x vertical v])\n    if <<<((x) - (size for collisions)) < (item (# for player collisions) of [line point x vertical v])> and <((x) + (size for collisions)) > (item (# for player collisions) of [line point x2 vertical v])>> and <<(item (# for player collisions) of [line point y vertical v]) < ((y) - (size for collisions))> and <(item (# for player collisions) of [line point y2 vertical v]) > ((y) + (size for collisions))>>> then\n        if <(item (# for player collisions) of [vertical type v]) = [1]> then\n            set [vertical touching? v] to [1]\n            stop [this script v]\n        end\n        if <(item (# for player collisions) of [vertical type v]) = [2]> then\n            broadcast (reset v)\n        end\n        if <(item (# for player collisions) of [vertical type v]) = [3]> then\n            set [touching bounce? v] to [1]\n        end\n    else\n        set [vertical touching? v] to [0]\n    end\n    change [# for player collisions v] by (1)\nend\n\n