Cave  a Mobile Platformer

Instructions: Cave a Platformer:\nStory:\nA player is stuck in a cave tunnel where he needs to escape before the dangerous monsters come and stop him to ascend further.\nInstructions:\n1.Use arrow keys or W,A,D or tap to move (only for mobile users in scratch)\n2.use R key  in case you get stuck.\n3.Do not touch the red enemy.\n4.Touch the check point to go next level\n\n\n\nCan you make it?

@Stage\n\nwhen flag clicked\nswitch backdrop to (level1 v)\n\n@enemy\n\nwhen backdrop switches to [level1 v]\nhide\n\nwhen backdrop switches to [level2 v]\nshow\nswitch costume to (costume1 v)\n\nwhen flag clicked\nswitch costume to (costume1 v)\nshow\n\nwhen backdrop switches to [level3 v]\nswitch costume to (costume2 v)\n\nwhen backdrop switches to [level4 v]\nswitch costume to (costume3 v)\n\nwhen backdrop switches to [level5 v]\nswitch costume to (costume4 v)\n\nwhen backdrop switches to [level6 v]\nswitch costume to (costume5 v)\n\nwhen backdrop switches to [level7 v]\nswitch costume to (costume6 v)\n\nwhen backdrop switches to [end v]\nhide\n\n@checkpoint\n\nwhen flag clicked\nshow\n\nwhen backdrop switches to [end v]\nhide\n\n@Player\n\nwhen flag clicked\nset size to (50) %\nset [ghost v] effect to (0)\ngo to [back v] layer\nshow\nswitch costume to (player v)\nset [xv v] to [0]\nset [yv v] to [0]\nset [lvl v] to [1]\nset [score v] to [0]\nhide variable [score v]\ngo to x: (-201) y: (-59)\npoint in direction (90)\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [xv v] by (1)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> 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 (#888888)?> then\n        change y by (1)\n        if <touching color (#888888)?> then\n            change y by (1)\n            if <touching color (#888888)?> then\n                change y by (1)\n                if <touching color (#888888)?> then\n                    change y by (1)\n                    if <touching color (#888888)?> then\n                        change y by (1)\n                        if <touching color (#888888)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\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 (#888888)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#888888)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [yv v] to [16]\n        end\n    end\n    if <<(x position) > [-230]> and <(y position) < [-179]>> then\n        go to x: (-201) y: (-59)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <touching (enemy v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        wait (1) seconds\n        go to x: (-201) y: (-59)\n        set [xv v] to [0]\n        set [yv v] to [0]\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n    end\n    if <touching (spikes v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        wait (1) seconds\n        go to x: (-201) y: (-59)\n        set [score v] to [0]\n        set [xv v] to [0]\n        set [yv v] to [0]\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n    end\n    if <touching (trampoline v)?> then\n        set [yv v] to [16]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (checkpoint v)?> then\n        next backdrop\n        go to x: (-201) y: (-130)\n    end\nend\n\nwhen [r v] key pressed\ngo to x: (-201) y: (-130)\n\nwhen backdrop switches to [end v]\nhide\n\n@TB\n\nwhen flag clicked\nforever\n    change [ghost v] effect by (100)\nend\n\n