New Year Platformer 100% pen

Instructions: wad, arrows, touch the screen - move\nlove and fav - invisible iPhone infinity(in real life)\n

@Stage\n\n@Спрайт 1\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (костюм 2 v)\nset size to ((1) / ()) %\nswitch costume to (костюм 1 v)\nsetup level\nforever\n    draw\nend\n\ndefine draw filled block (x1) (y1) (x2) (y2)\nadd (x1) to [blocks v]\nadd (x2) to [blocks v]\nadd (y1) to [blocks v]\nadd (y2) to [blocks v]\nset pen size to (10)\npen up\nset pen color to (#6f3400)\ngo to x: ((x1) - (camera x)) y: ((y1) - (camera y))\npen down\nrepeat (((x2) - (x1)) / (5))\n    pen down\n    set y to ((y2) - (camera y))\n    set y to ((y1) - (camera y))\n    pen up\n    change x by (5)\nend\nset pen color to (#4e2e10)\ngo to x: ((x1) - (camera x)) y: ((y1) - (camera y))\npen down\ngo to x: ((x2) - (camera x)) y: ((y1) - (camera y))\ngo to x: ((x2) - (camera x)) y: ((y2) - (camera y))\ngo to x: ((x1) - (camera x)) y: ((y2) - (camera y))\ngo to x: ((x1) - (camera x)) y: ((y1) - (camera y))\npen up\ndraw line (x1) (y2) (x2) (y2)\n\ndefine draw line (x1q) (y1q) (x2q) (y2q)\nset pen color to (#ffffff)\nset pen (transparency v) to (0)\nset [loop v] to [0]\nset pen size to (20)\nrepeat (3)\n    pen up\n    go to x: ((x1q) - (camera x)) y: (((y1q) - (camera y)) + (loop))\n    pen down\n    go to x: (((x2q) - (camera x)) - (5)) y: (((y2q) - (camera y)) + (loop))\n    change [loop v] by (5)\n    change pen (transparency v) by (33)\nend\n\ndefine draw tree (x) (y)\nset pen size to (30)\nset pen color to (#3e1d00)\npen up\ngo to x: ((x) - (camera x)) y: ((y) - (camera y))\npen down\nchange y by (200)\npen up\nset pen color to (#007910)\npen down\ngo to x: (((x) - (camera x)) - (40)) y: (((y) - (camera y)) - (-50))\ngo to x: (((x) - (camera x)) - (-40)) y: (((y) - (camera y)) - (-50))\ngo to x: ((x) - (camera x)) y: (((y) - (camera y)) + (200))\ngo to x: ((x) - (camera x)) y: (((y) - (camera y)) + (50))\ngo to x: (((x) - (camera x)) - (10)) y: (((y) - (camera y)) + (71))\ngo to x: (((x) - (camera x)) - (-10)) y: (((y) - (camera y)) + (71))\npen up\nset pen color to (#fff600)\nset pen size to (40)\ngo to x: (((x) - (camera x)) - (0)) y: (((y) - (camera y)) + (200))\nset [loop v] to [4]\nset pen size to (1)\nrepeat (10)\n    pen down\n    pen up\n    change pen size by (10)\n    change pen (transparency v) by (loop)\n    change [loop v] by (1)\nend\n\ndefine draw\nchange [camera x v] by (((x) - (camera x)) / (5))\nchange [camera y v] by (((y) - (camera y)) / (5))\nerase all\ndelete all of [blocks v]\ncreate clone of (_myself_ v)\nif <(level) = [1]> then\n    draw tree [0] [110]\n    draw tree [220] [110]\n    draw tree [1000] [110]\n    draw gift [330] [110] [40] (join (#ff3f00) []) (join (#faff00) [])\n    draw gift [632] [110] [70] (join (#5900ff) []) (join (#10ff00) [])\n    draw gift [100] [110] [90] (join (#00b6ff) []) (join (#ffa100) [])\n    draw gift [1400] [410] [30] (join (#ffffff) []) (join (#ff0000) [])\n    draw gift [1740] [410] [80] (join (#ff0000) []) (join (#003bff) [])\n    draw gift [2350] [60] [40] (join (#ffbb00) []) (join (#00cbff) [])\n    draw filled block [-200] [-100] [-100] [2000]\n    draw filled block [-100] [-100] [400] [100]\n    draw filled block [500] [-100] [700] [100]\n    draw filled block [900] [-100] [1100] [100]\n    draw filled block [1100] [-100] [1200] [200]\n    draw filled block [1200] [-100] [1300] [300]\n    draw filled block [1300] [-100] [1500] [400]\n    draw filled block [1650] [200] [1800] [400]\n    draw filled block [1950] [200] [2100] [400]\n    draw filled block [2250] [200] [2475] [300]\n    draw filled block [2475] [50] [2590] [100]\n    draw filled block [2300] [0] [2400] [50]\n    win block [2310] [160]\nend\nif <(level) = [2]> then\n    draw gift [0] [110] [40] (join (#00ff43) []) (join (#0090ff) [])\n    draw gift [725] [315] [70] (join (#af00b3) []) (join (#00ff6a) [])\n    draw gift [230] [115] [70] (join (#ffffff) []) (join (#000000) [])\n    draw tree [40] [110]\n    draw filled block [-200] [-100] [-100] [2000]\n    draw filled block [-100] [-100] [400] [100]\n    draw filled block [451] [100] [599] [200]\n    draw filled block [650] [200] [799] [300]\n    draw filled block [0] [390] [600] [400]\n    draw filled block [0] [460] [20] [500]\n    draw filled block [100] [480] [120] [520]\n    draw filled block [200] [500] [220] [540]\n    draw filled block [400] [500] [420] [540]\n    win block [500] [700]\nend\nif <(level) = [3]> then\n    draw tree [230] [110]\n    draw tree [550] [110]\n    draw tree [750] [110]\n    draw tree [950] [110]\n    draw tree [1150] [110]\n    draw tree [1150] [110]\n    draw tree [1350] [110]\n    draw gift [200] [110] [130] (join (#d0ff00) []) (join (#00ff08) [])\n    draw gift [60] [110] [100] (join (#54ff00) []) (join (#00ffff) [])\n    draw gift [-60] [110] [40] (join (#00ff43) []) (join (#0090ff) [])\n    draw gift [0] [110] [80] (join (#1000ff) []) (join (#ff0000) [])\n    draw gift [40] [110] [40] (join (#ff0000) []) (join (#ffae00) [])\n    draw gift [100] [110] [70] (join (#1500ff) []) (join (#99ff00) [])\n    draw gift [200] [110] [40] (join (#61ff00) []) (join (#ffd800) [])\n    draw gift [100] [110] [100] (join (#1500ff) []) (join (#99ff00) [])\n    draw gift [-50] [110] [40] (join (#ff0000) []) (join (#ffae00) [])\n    draw gift [3400] [110] [170] (join (#009dff) []) (join (#0021ff) [])\n    draw gift [2300] [310] [100] (join (#1dff00) []) (join (#0021ff) [])\n    draw tree [3100] [210]\n    draw tree [2000] [310]\n    draw tree [2200] [310]\n    draw tree [2400] [310]\n    draw filled block [-200] [-100] [-100] [2000]\n    draw filled block [-100] [-100] [400] [100]\n    draw filled block [500] [-100] [600] [100]\n    draw filled block [700] [-100] [800] [100]\n    draw filled block [900] [-100] [1000] [100]\n    draw filled block [1100] [-100] [1200] [100]\n    draw filled block [1300] [-100] [1400] [100]\n    draw filled block [1900] [-100] [2500] [300]\n    draw filled block [1800] [-100] [2000] [200]\n    draw filled block [1650] [-100] [2000] [100]\n    draw filled block [2750] [-100] [3000] [300]\n    draw filled block [3000] [-100] [3250] [200]\n    draw filled block [3250] [-100] [3500] [100]\n    draw filled block [3600] [180] [3601] [180]\n    win block [3600] [300]\nend\nif <(level) = [4]> then\n    draw gift [100] [110] [100] (join (#1dff00) []) (join (#0021ff) [])\n    draw tree [230] [110]\n    draw tree [300] [480]\n    draw filled block [-200] [-100] [-100] [2000]\n    draw filled block [-100] [-100] [400] [100]\n    draw filled block [300] [170] [400] [190]\n    draw filled block [300] [250] [600] [270]\n    draw filled block [400] [350] [600] [370]\n    draw filled block [230] [450] [600] [470]\n    draw filled block [20] [450] [100] [470]\n    set [counter v] to [4]\n    repeat (16)\n        draw filled block [-100] (((counter) * (100)) + (50)) [-60] (((counter) * (100)) + (70))\n        change [counter v] by (1)\n    end\n    draw filled block [-400] [1800] [-300] [2000]\n    win block [-450] [2100]\nend\nif <(level) = [5]> then\n    draw gift [30] [110] [40] (join (#00e9ff) []) (join (#ff8300) [])\n    draw tree [230] [110]\n    draw filled block [-200] [-100] [-100] [2000]\n    draw filled block [-100] [-100] [400] [100]\n    set [counter v] to [5]\n    repeat (30)\n        draw filled block ((counter) * (100)) [-100] (((counter) * (100)) + (100)) [100]\n        change [counter v] by (2)\n    end\n    win block ((counter) * (100)) [150]\nend\nplayer\n\nwhen I start as a clone\nset [loop v] to (pick random (1) to (2))\nif <(loop) = [1]> then\n    set [x v] to ((250) + (camera x))\n    set [y v] to ((pick random (-100) to (190)) + (camera y))\nelse\n    set [x v] to ((pick random (-230) to (250)) + (camera x))\n    set [y v] to ((190) + (camera y))\nend\nforever\n    change [x v] by (-3)\n    change [y v] by (-6)\n    go to x: ((x) - (camera x)) y: ((y) - (camera y))\n    if <<(x position) < [-250]> or <(y position) < [-180]>> then\n        delete this clone\n    end\n    set pen color to (#e8fbff)\n    set pen (transparency v) to (30)\n    set pen size to (10)\n    pen up\n    pen down\n    pen up\nend\n\ndefine player\nchange [speed x v] by ((<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > [30]>>> - <<<mouse down?> and <[-30] > (mouse x)>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>) * (2))\nset [speed x v] to ((speed x) * (0.8))\nchange [x v] by (speed x)\nblock hitbox\nif <(loop) = [collision]> then\n    repeat until <not <(loop) = [collision]>>\n        if <(speed x) > [0]> then\n            change [x v] by (-1)\n            block hitbox\n        else\n            change [x v] by (1)\n            block hitbox\n        end\n    end\n    set [speed x v] to []\nend\nchange [speed y v] by (-1)\nchange [y v] by (speed y)\nblock hitbox\nchange [fall v] by (1)\nif <(loop) = [collision]> then\n    repeat until <not <(loop) = [collision]>>\n        if <(speed y) > [0]> then\n            change [y v] by (-1)\n            block hitbox\n        else\n            set [fall v] to [0]\n            change [y v] by (1)\n            block hitbox\n        end\n    end\n    set [speed y v] to [0]\nend\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> and <(fall) < [3]>> then\n    set [speed y v] to [13]\n    if <(username) = [Andy2Ray]> then\n        set [speed y v] to [40]\n    end\nend\nif <(y) < [-200]> then\n    setup level\n    if <(level) = [5]> then\n        change [level v] by (1)\n    end\nend\nset pen (transparency v) to (0)\nset pen color to (#868686)\nset pen size to (20)\npen up\ngo to x: (((x) - (camera x)) - (10)) y: (((y) - (camera y)) - (10))\npen down\ngo to x: (((x) - (camera x)) - (-10)) y: (((y) - (camera y)) - (10))\ngo to x: (((x) - (camera x)) - (-10)) y: (((y) - (camera y)) - (-10))\ngo to x: (((x) - (camera x)) - (10)) y: (((y) - (camera y)) - (-10))\ngo to x: (((x) - (camera x)) - (10)) y: (((y) - (camera y)) - (10))\npen up\nset pen size to (10)\nset pen color to (#ffffff)\ngo to x: (((x) - (camera x)) - (16)) y: (((y) - (camera y)) - (-15))\npen down\ngo to x: (((x) - (camera x)) - (-16)) y: (((y) - (camera y)) - (-15))\npen up\nset pen color to (#ff0000)\ngo to x: (((x) - (camera x)) - (-13)) y: (((y) - (camera y)) - (-19))\npen down\ngo to x: (((x) - (camera x)) - (4)) y: (((y) - (camera y)) - (-50))\ngo to x: (((x) - (camera x)) - (13)) y: (((y) - (camera y)) - (-19))\ngo to x: (((x) - (camera x)) - (-13)) y: (((y) - (camera y)) - (-19))\ngo to x: (((x) - (camera x)) - (0)) y: (((y) - (camera y)) - (-29))\nset pen size to (20)\npen up\npen down\npen up\nset pen color to (#ffffff)\ngo to x: (((x) - (camera x)) - (4)) y: (((y) - (camera y)) - (-50))\nset pen size to (15)\npen down\npen up\ngo to x: ((x) - (camera x)) y: ((y) - (camera y))\nset pen size to (20)\npen down\npen up\nset pen color to (#000000)\ngo to x: (((x) - (camera x)) + ((speed x) / (3))) y: (((y) - (camera y)) + ((speed y) / (3)))\nset pen size to (10)\npen down\npen up\n\ndefine block hitbox\nset [loop v] to [0]\nrepeat ((length of [blocks v]) / (4))\n    if <<((25) + (x)) > (item ((loop) + (1)) of [blocks v])> and <(item ((loop) + (2)) of [blocks v]) > ((-25) + (x))>> then\n        if <<((20) + (y)) > (item ((loop) + (3)) of [blocks v])> and <(item ((loop) + (4)) of [blocks v]) > ((-30) + (y))>> then\n            set [loop v] to [collision]\n            stop [this script v]\n        end\n    end\n    change [loop v] by (4)\nend\n\ndefine setup level\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [x v] to [0]\nset [y v] to [200]\nset [camera x v] to (x)\nset [camera y v] to (y)\n\ndefine draw gift (x) (y) (size) (color) (color2)\nset pen size to (10)\nset pen color to (color)\npen up\ngo to x: (((x) - ((size) / (2))) - (camera x)) y: ((y) - (camera y))\nrepeat (((size) / (5)) + (1))\n    pen down\n    set y to ((y) - (camera y))\n    set y to (((y) + (size)) - (camera y))\n    pen up\n    change x by (5)\nend\ngo to x: ((x) - (camera x)) y: ((y) - (camera y))\nset pen color to (color2)\nset pen size to (10)\npen down\ngo to x: ((x) - (camera x)) y: (((y) + (size)) - (camera y))\npen up\ngo to x: ((((x) - ((size) / (2))) - (camera x)) + (0)) y: (((y) + ((size) / (2))) - (camera y))\npen down\ngo to x: ((((x) - ((size) / (-2))) - (camera x)) + (0)) y: (((y) + ((size) / (2))) - (camera y))\npen up\ngo to x: ((x) - (camera x)) y: (((y) + (size)) - (camera y))\npen down\ngo to x: (((x) - (camera x)) + ((size) / (4))) y: (((y) + ((size) * (1.3))) - (camera y))\npen up\ngo to x: ((x) - (camera x)) y: (((y) + (size)) - (camera y))\npen down\ngo to x: (((x) - (camera x)) + ((size) / (-4))) y: (((y) + ((size) * (1.3))) - (camera y))\npen up\n\ndefine win block (x) (y)\nset [x of end v] to (x)\nset [y of end v] to (y)\nset pen color to (#ffdada)\nchange [color of win v] by (1)\nset pen size to (40)\nset pen (color v) to (color of win)\npen up\ngo to x: ((x) - (camera x)) y: ((y) - (camera y))\npen down\npen up\nchange pen (transparency v) by (30)\nchange pen (color v) by (10)\nchange pen size by (20)\npen down\npen up\nif <<([abs v] of ((x of end) - (x)) ) < [30]> and <([abs v] of ((y of end) - (y)) ) < [30]>> then\n    change [level v] by (1)\n    setup level\nend\n\nwhen flag clicked\nforever\n    play sound [jingle bell v] until done\nend\n\nforever\n    set [counter v] to (join ((mouse x) + (camera x)) (join [/] ((mouse y) + (camera y))))\nend\n\nwhen flag clicked\nforever\n    if <(level) = [6]> then\n        switch costume to (костюм 2 v)\n        set size to (100) %\n        go to x: (0) y: (0)\n        switch costume to (костюм 4 v)\n        stop [all v]\n    end\nend\n\n