99%/100% Pen platformer

Instructions: This is the pen platformer for @GeniusApple's contest! ( \nyay!First!)\n\nI know, there are some glitches... but be kind and love, fave and follow me for more!

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\n@Player\n\nwhen flag clicked\ngo to x: (100) y: (-50)\nset [ghost v] effect to (100)\n\nwhen I receive [message1 v]\nswitch costume to (costume1 v)\nforever\n    go [backward v] (1) layers\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    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <<touching color (#2ca5e2)?> or <touching color (#00ffcb)?>> then\n        change y by (1)\n        if <<touching color (#2ca5e2)?> or <touching color (#00ffcb)?>> then\n            change y by (1)\n            if <<touching color (#2ca5e2)?> or <touching color (#00ffcb)?>> then\n                change y by (1)\n                if <<touching color (#2ca5e2)?> or <touching color (#00ffcb)?>> then\n                    change y by (1)\n                    if <<touching color (#2ca5e2)?> or <touching color (#00ffcb)?>> then\n                        change y by (1)\n                        if <<touching color (#2ca5e2)?> or <touching color (#00ffcb)?>> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <<touching color (#2ca5e2)?> or <touching color (#00ffcb)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#2ca5e2)?> or <touching color (#00ffcb)?>> then\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching color (#72ff00)?> then\n        change [level v] by (1)\n        go to x: (-146) y: (-117)\n    end\n    if <<touching color (#ff0000)?> or <touching color (#e81717)?>> then\n        go to x: (-146) y: (-117)\n    end\nend\n\nwhen I receive [level1 v]\ngo to x: (-146) y: (-117)\n\n@Rendering_pen\n\ndefine Rf\npen up\nset pen color to (#2ca5e2)\ngo to x: (223) y: (-150)\npen down\ngo to x: (-223) y: (-150)\npen up\n\ndefine Render all\nerase all\nRf\nP\nRw (-223) , (-150) , (200)\nRw (223) , (-150) , (200)\nif <(Level) = [1]> then\n    Ds (-100) , (48)\n    Ds (-50) , (0)\n    Ds (126) , (-70)\n    Rpo (-180) , (100)\nelse\n    if <(Level) = [2]> then\n        Rs (28) , (-150)\n        Rs [-60] , [-150]\n        Rs [65] , [-150]\n        Rs [100] , [-150]\n        Rs [135] , [-150]\n        Rs [170] , [-150]\n        Ds (126) , (-70)\n        Rpo (120) , (22)\n    else\n        if <(Level) = [3]> then\n            Rs (-115) , (-145)\n            Rs (-80) , (-145)\n            Ds (1) , (-100)\n            Ds (170) , (-40)\n            Ds (1) , (30)\n            Rpo (-70) , (80)\n            REM\n        else\n            if <(Level) = [4]> then\n                Rs (-100) , (-145)\n                Rs (-65) , (-145)\n                Rs (-30) , (-145)\n                Rs (5) , (-145)\n                Rs (40) , (-145)\n                Rpo (150) , (-50)\n            else\n                if <(Level) = [5]> then\n                    Ds (-123) , (-70)\n                    Ds (1) , (1)\n                    Ds (123) , (1)\n                    Rs (139) , (16)\n                    Ds (1) , (100)\n                    Rpo (-140) , (150)\n                    Rs (-100) , (-150)\n                    Rs (-60) , (-150)\n                    Rs (-20) , (-150)\n                    Rs (20) , (-150)\n                    Rs (60) , (-150)\n                    Rs (100) , (-150)\n                else\n                    switch backdrop to (backdrop2 v)\n                end\n            end\n        end\n    end\nend\n\ndefine Dp\npen up\nchange y by (20)\npen down\nchange x by (-10)\nchange y by (-20)\nchange x by (20)\nchange y by (20)\nchange x by (-10)\npen up\n\ndefine P\nset pen color to (#faff00)\ngo to (player v)\nDp\n\ndefine Ds (x) , (y)\nset pen color to (#2ca5e2)\npen up\ngo to x: (x) y: (y)\nchange y by (10)\npen down\nchange x by (-30)\nchange x by (60)\nchange y by (-20)\nchange x by (-60)\nchange y by (20)\npen up\n\ndefine .\nwait (0.5) seconds\nbroadcast (message1 v)\n\ndefine Rw (x1) , (y1) , (y2)\ngo to x: (x1) y: (y1)\npen down\nset pen color to (#2ca5e2)\ngo to x: (x1) y: (y2)\npen up\n\ndefine Rpo (x) , (y)\npen up\nset pen color to (#72ff00)\nset pen size to (7)\ngo to x: (x) y: (y)\npen down\nchange y by (-20)\nchange y by (20)\nchange x by (-20)\nchange y by (-20)\nchange x by (20)\npen up\n\ndefine Rs (x) , (y)\npen up\nset pen color to (#ff0000)\ngo to x: (x) y: (y)\nchange x by (-15)\npen down\nchange x by (30)\ngo to x: ((x position) - (15)) y: ((y position) + (30))\ngo to x: ((x position) - (15)) y: ((y position) - (30))\npen up\n\ndefine Reset\nbroadcast (level1 v) and wait\n\ndefine Re (x) , (y)\npen up\nchange y by (20)\npen down\nchange x by (-10)\nchange y by (-20)\nchange x by (20)\nchange y by (20)\nchange x by (-10)\npen up\n\ndefine REM\nset pen color to (#e81818)\ngo to (enemy v)\nRe (0) , (0)\n\nwhen flag clicked\nerase all\n\nwhen flag clicked\nset pen size to (7)\n.\nhide variable [level v]\nset [level v] to [1]\nbroadcast (level1 v)\nforever\n    Render all\n    if <key (r v) pressed?> then\n        Reset\n    end\nend\n\n@Enemy\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [3]> then\n        glide (2) secs to x: (108) y: (-140)\n        glide (2) secs to x: (198) y: (-141)\n    end\nend\n\n@Tb\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    show\nend\n\n