Desert || A platformer 2

Instructions: Move with arrow keys.\nUp arrow to jump.\nIn part 1 you fought a boss to get your treasure back,\nbut now, you have to get home...\nIf you didn't play part 1, play it here:\nhttps://scratch.mit.edu/projects/321724674/\nPART 3!\nhttps://scratch.mit.edu/projects/325398512\nPart 4: https://scratch.mit.edu/projects/326282236\n(Part 5 has no storyline)\nPART 6: https://scratch.mit.edu/projects/545565557\n

@Stage\n\n@Player\n\nwhen I receive [next level v]\nset [yv v] to [0]\nset [xv v] to [0]\ngo to x: (-200) y: (0)\n\nwhen flag clicked\nshow\ngo to x: (-200) y: (0)\npoint in direction (90)\nset [xvel v] to [0]\nset [yvel v] to [0]\nforever\n    if <<<mouse down?> and <(x position) > (mouse x)>> or <key (left arrow v) pressed?>> then\n        change [xv v] by (-1)\n    end\n    if <<<mouse down?> and <(x position) < (mouse x)>> or <key (right arrow v) pressed?>> 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 (#fffd30)?> then\n        change y by (1)\n        if <touching color (#fffd30)?> then\n            change y by (1)\n            if <touching color (#fffd30)?> then\n                change y by (1)\n                if <touching color (#fffd30)?> then\n                    change y by (1)\n                    if <touching color (#fffd30)?> then\n                        change y by (1)\n                        if <touching color (#fffd30)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<mouse down?> and <(y position) < (mouse y)>> or <key (up arrow v) pressed?>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-7]\n                                else\n                                    set [xv v] to [7]\n                                end\n                                set [yv v] to [12]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <touching color (#87f6ff)?> then\n        if <<<mouse down?> and <((y position) + (50)) < (mouse y)>> or <key (up arrow v) pressed?>> then\n            change [yv v] by (0.5)\n        end\n    end\n    if <touching color (#87f6ff)?> then\n        if <<<mouse down?> and <((y position) + (50)) > (mouse y)>> or <key (down arrow v) pressed?>> then\n            change [yv v] by (-1)\n        end\n    end\n    if <touching color (#fffd30)?> then\n        if <<<mouse down?> and <((y position) + (50)) < (mouse y)>> or <key (up arrow v) pressed?>> then\n            set [yv v] to [17]\n        end\n    end\n    change y by (1)\n    change [yv v] by (-1)\n    set [yv v] to ((Yv) * (0.99))\n    change y by (Yv)\n    if <touching color (#fffd30)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    hide variable [xv v]\n    if <(x position) > [230]> then\n        broadcast (next level v)\n    end\n    if <(y position) < [-170]> then\n        go to x: (-200) y: (0)\n    end\n    if <touching color (#b8b8b8)?> then\n        go to x: (-200) y: (0)\n    end\n    if <touching color (#0002ff)?> then\n        set [yv v] to [23]\n    end\n    if <touching color (#87f6ff)?> then\n        change [yv v] by (1)\n        if <touching color (#87f6ff)?> then\n            change [yv v] by (0.5)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Xenogenesis.mp3 v] until done\nend\n\n@Levels\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nswitch costume to (level 1 v)\nforever\n    if <<(costume [number v]) = [11]> or <(costume [number v]) = [15]>> then\n        go to [front v] layer\n    else\n        go to [back v] layer\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\n@TN\n\ngo to x: (0) y: (0)\n\nwhen flag clicked\nhide\n\nshow\n\n@Clouds\n\nwhen flag clicked\nset [ghost v] effect to (35)\ngo to [back v] layer\nshow\ngo to x: (-66) y: (90)\nforever\n    glide (25) secs to x: (356) y: (90)\n    go to x: (-365) y: (90)\nend\n\nhide\n\nwhen I receive [game start v]\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nset [ghost v] effect to (35)\n\n