Monochrome: Scrolling Pen Platformer


@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\nswitch backdrop to (backdrop1 v)\n\n@pen\n\nwhen flag clicked\nset [x v] to [-5]\nset [y v] to [25]\nset pen size to (7)\npen down\nset [speed v] to [5]\nset [scrollx v] to [140]\nset [scrolly v] to [80]\nset pen color to (#d8d8d8)\nforever\n    broadcast (tick v)\n    erase all\n    change [scrolly v] by (5)\n    change [scrollx v] by (Xv)\n    set [xv v] to ((Xv) * (0.9))\nend\n\nerase all\n\nwhen I receive [tick v]\ngo to x: (x) y: (y)\npen down\nchange x by (30)\nchange y by (-30)\nchange x by (-30)\nchange y by (30)\npen up\nif <key (right arrow v) pressed?> then\n    change [xv v] by (-1)\nend\nif <key (left arrow v) pressed?> then\n    change [xv v] by (1)\nend\n\n@levelpen\n\ndefine draw line from x1 (x1) y1 (y1) to x2 (x2) y2 (y2)\nset pen size to (20)\ngo to x: ((x1) + (scrollx)) y: ((y1) + (scrolly))\npen down\ngo to x: ((x2) + (scrollx)) y: ((y2) + (scrolly))\npen up\n\nwhen flag clicked\n\nchange [level v] by (1)\n\nset [level v] to [8]\n\nset [level v] to [6]\n\nwhen I receive [tick v]\nset pen color to (#000000)\ndraw line from x1 [-200] y1 [-100] to x2 [400] y2 [-100]\ndraw line from x1 [500] y1 [-100] to x2 [625] y2 [-100]\ndraw line from x1 [750] y1 [-200] to x2 [800] y2 [-200]\ndraw line from x1 [1100] y1 [-275] to x2 [1200] y2 [-275]\nset pen color to (#ffffff)\ndraw line from x1 [200] y1 [-100] to x2 [200] y2 [-75]\ndraw line from x1 [-200] y1 [-100] to x2 [-200] y2 []\ndraw line from x1 [-200] y1 [-115] to x2 [650] y2 [-115]\ndraw line from x1 [650] y1 [-115] to x2 [650] y2 [-300]\ndraw line from x1 [650] y1 [-300] to x2 [900] y2 [-300]\ndraw line from x1 [1000] y1 [-300] to x2 [1200] y2 [-300]\ndraw line from x1 [800] y1 [0] to x2 [850] y2 [-100]\ndraw line from x1 [1000] y1 [-300] to x2 [1600] y2 [-300]\ndraw line from x1 [1850] y1 [-295] to x2 [1850] y2 [-270]\ndraw line from x1 [2050] y1 [-295] to x2 [2050] y2 [-270]\ndraw line from x1 [2500] y1 [-295] to x2 [2500] y2 [100]\nset pen color to (#000000)\ndraw line from x1 [900] y1 [-300] to x2 [1000] y2 [-300]\ndraw line from x1 [1500] y1 [-295] to x2 [1600] y2 [-295]\ndraw line from x1 [1500] y1 [-295] to x2 [1600] y2 [-295]\ndraw line from x1 [1800] y1 [-295] to x2 [1900] y2 [-295]\ndraw line from x1 [2000] y1 [-295] to x2 [2100] y2 [-295]\ndraw line from x1 [2200] y1 [-295] to x2 [2500] y2 [-295]\n\n@Collison\n\nwhen flag clicked\nforever\n    go to (pen v)\n    if <touching color (#535353)?> then\n        change [scrolly v] by (1)\n    end\n    if <touching color (#000000)?> then\n        set [yv v] to [0]\n        change [scrolly v] by (-5)\n        if <key (up arrow v) pressed?> then\n            change [yv v] by (-15)\n        end\n    end\n    change [scrolly v] by (Yv)\n    set [yv v] to ((Yv) * (0.89))\n    if <touching color (#ffffff)?> then\n        set [scrollx v] to [140]\n        set [scrolly v] to [80]\n    end\n    if <(scrollx) < [-2400]> then\n        broadcast (win v)\n    end\n    if <[400] < (scrolly)> then\n        set [scrollx v] to [140]\n        set [scrolly v] to [80]\n    end\nend\n\nchange [scrolly v] by (5)\n\nset [yv v] to [0]\n\nrepeat (5)\n\nbroadcast (win v)\n\n@border\n\n@THumb\n\nwhen flag clicked\nclear graphic effects\nset [time v] to [0]\nhide variable [☁ best time v]\nswitch costume to (costume1 v)\nhide variable [time v]\nset [ghost v] effect to (100)\nforever\n    wait (1) seconds\n    change [time v] by (1)\nend\n\nwhen I receive [win v]\nadd (☁ Best Time) to [cloud v]\nstop [other scripts in sprite v]\nswitch costume to (costume2 v)\nif <(Time) < (☁ Best Time)> then\n    set [☁ best time v] to (Time)\nend\nclear graphic effects\nshow variable [☁ best time v]\nshow variable [time v]\n\nwhen I receive [tick v]\n\nwait (1) seconds\n\nif <(username) = [-SimpleGames-]> then\n    show\n    clear graphic effects\nend\n\n