Desert - A platformer 4
@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\ngo to [front v] layer\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 [15]\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 (#ff0000)?> then\n        go to x: (-200) y: (0)\n    end\n    if <touching color (#0800ff)?> 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 [Prelude v] until done\nend\n\nwhen flag clicked\nforever\n    if <<touching color (#ffd560)?> or <<touching color (#0cff00)?> or <<touching color (#0cff00)?> or <<touching color (#3100ff)?> or <<touching color (#efc247)?> or <<touching color (#ff0000)?> or <touching color (#630000)?>>>>>>> then\n        repeat until <(x position) > [230]>\n            set [xv v] to [19]\n        end\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\n\nwhen I receive [next level v]\nnext costume\n\n@Sprite2\n\nwhen flag clicked\nhide\n\n
Move around and jump with arrow keys.\nPart of the Desert - a platformer series. \nI hope you like it!\nThis time you must get home...\nPART 6: https://scratch.mit.edu/projects/545565557\n(Part 5 has no storyline)\nPART 3: https://scratch.mit.edu/projects/325398512\nPART 2: https://scratch.mit.edu/projects/322246456\nPART 1: https://scratch.mit.edu/projects/321724674\n