[OUTDATED]GravityV's Scrolling Platformer Engine

Instructions: [OUTDATED]Scrolling Platformer Engine 100% by me\nThis is a platformer engine. But actually I have an upgrade version of this in which I used it in my PAPERFORMER. But whatever, enjoy and use this in your projects!\nSPEEDRUN:\n(There is a timer shown after you reached the exit. Comment down your result!)

@Stage\n\n@Player\n\ndefine init\nhide\nset [xv v] to [0]\nset [yv v] to [0]\nset [playerx v] to [0]\nset [playery v] to [0]\nset [scrollx v] to ((playerX) + (300))\nset [scrolly v] to (playerY)\nposition\nbroadcast (set up lev v) and wait\nbroadcast (position v) and wait\nshow\n\nwhen flag clicked\nset size to (100) %\ninit\nforever\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [xv v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n        change [xv v] by (1)\n    end\n    change [playerx v] by (round (Xv))\n    position\n    if <touching (level v)?> then\n        change [playerx v] by ((Xv) * (-1))\n        set [xv v] to [0]\n        position\n    else\n        set [xv v] to ((Xv) * (0.8))\n    end\n    change [playery v] by (round (Yv))\n    position\n    if <touching (level v)?> then\n        change [playery v] by ((Yv) * (-1))\n        set [yv v] to [0]\n        position\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            if <(lock) = [0]> then\n                set [yv v] to [15]\n                set [lock v] to [1]\n            end\n        end\n    else\n        change [yv v] by (-1)\n        set [lock v] to [0]\n    end\n    change [scrollx v] by (round (((playerX) - (SCROLLX)) / (5)))\n    change [scrolly v] by (round (((playerY) - (SCROLLY)) / (5)))\n    position\n    broadcast (position v)\n    Check Die\nend\n\ndefine position\nposition ((playerX) - (SCROLLX)) ((playerY) - (SCROLLY))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>> then\n    show\nelse\n    hide\nend\n\ndefine Check Die\nif <(playerY) < [-220]> then\n    repeat (15)\n        change [ghost v] effect by (10)\n        change size by (-5)\n    end\n    init\n    set [ghost v] effect to (0)\n    set size to (100) %\n    position\nend\n\n@level\n\nwhen I receive [position v]\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\nwhen I receive [set up lev v]\nset up\n\ndefine create level clone at (x) (y)\nset [x v] to (x)\nset [y v] to (y)\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\ncreate clone of (_myself_ v)\nnext costume\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [del clones v]\ndelete this clone\n\ndefine set up\nbroadcast (DEL CLONES v)\nswitch costume to (costume1 v)\ncreate level clone at [0] [0]\nrepeat (6)\n    create level clone at ((x) + (560)) [0]\nend\ncreate level clone at [-99999999999999999999999999999999999999999999] [0]\n\n@end\n\nwhen I receive [position v]\nif <(costume [number v]) = [1]> then\n    position ((3496) - (SCROLLX)) ((180) - (SCROLLY))\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nshow variable [☁ highscore v]\nhide variable [time v]\nwait until <<key (any v) pressed?> or <mouse down?>>\nreset timer\nrepeat until <touching (player v)?>\n    set [time v] to (timer)\nend\nbroadcast (end v)\n\nwhen I receive [end v]\nshow variable [time v]\nif <(TIME) < (☁ HIGHSCORE)> then\n    set [☁ highscore v] to (TIME)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nset [☁ highscore v] to [1000000000000000]\n\nset [☁ highscore v] to [26.334]\n\nhide variable [time v]\nhide variable [☁ highscore v]\n\n@extensions\n\nif <touching (level v)?> then\n    change [playerx v] by ((Xv) * (-1))\n    position\n    if <key (up arrow v) pressed?> then\n        if <(Xv) < [0]> then\n            set [xv v] to [10]\n            set [yv v] to [10]\n        else\n            set [xv v] to [-10]\n            set [yv v] to [10]\n        end\n    else\n        set [xv v] to [0]\n    end\nelse\n    set [xv v] to ((Xv) * (0.8))\nend\n\n@BG\n\nwhen flag clicked\nshow\ngo to [back v] layer\nzoom [150]\nforever\n    go to x: ((join [-] ([playerx v] of [player v])) * (0.05)) y: ((join [-] ([playery v] of [player v])) * (0.05))\nend\n\nhide\n\ndefine zoom (%)\nswitch costume to (dot v)\nset size to (%) %\nswitch costume to (costume1 v)\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n