Pirate - The platformer #1

Instructions: Use arrow keys to move the pirate !\n50 fav and lov for new part !\n

@Stage\n\nwhen I receive [next v]\nnext backdrop\nchange [level v] by (1)\n\nwhen flag clicked\nset [level v] to [0]\nswitch backdrop to (thumbnail v)\nforever\n    play sound [Starship v] until done\nend\n\nwhen backdrop switches to [backdrop1 v]\nset [level v] to [0]\nset [level v] to [0]\n\n@Sprite1\n\nwhen flag clicked\nset rotation style [left-right v]\ngo to x: (-211) y: (-95)\nswitch costume to (costume1 v)\nshow\nset [speedx v] to [0]\nset [speedy v] to [0]\nforever\n    go to [front v] layer\n    forever\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n            change [speedx v] by (-1)\n        end\n        if <key (right arrow v) pressed?> then\n            point in direction (90)\n            change [speedx v] by (1)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    set [speedx v] to ((speedx) * (0.9))\n    change x by (speedx)\n    if <touching color (#ffffff)?> then\n        change y by (1)\n        if <touching color (#ffffff)?> then\n            change y by (1)\n            if <touching color (#ffffff)?> then\n                change y by (1)\n                if <touching color (#ffffff)?> then\n                    change y by (1)\n                    if <touching color (#ffffff)?> then\n                        change y by (1)\n                        if <touching color (#ffffff)?> then\n                            change y by (-5)\n                            change x by ((speedx) * (-1))\n                            if <key (up arrow v) pressed?> then\n                                if <(speedx) > [0]> then\n                                    set [speedx v] to [-12]\n                                else\n                                    set [speedx v] to [12]\n                                end\n                                set [speedy v] to [15]\n                            else\n                                set [speedx v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [speedy v] by (-1)\n    change y by (speedy)\n    if <touching color (#ffffff)?> then\n        change y by ((speedy) * (-1))\n        set [speedy v] to [0]\n    end\n    change y by (-1)\n    if <<key (up arrow v) pressed?> and <touching color (#ffffff)?>> then\n        set [speedy v] to [12]\n    end\n    change y by (1)\n    if <<touching color (#6c0000)?> or <(y position) < [-160]>> then\n        change [die v] by (1)\n        go to x: (-211) y: (-95)\n    end\n    if <(x position) > [225]> then\n        broadcast (Next v)\n        go to x: (-211) y: (-95)\n    end\nend\n\n@Sprite2\n\nwhen backdrop switches to [thumbnail7 v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (-150) y: (-30)\nforever\n    glide (0.5) secs to x: (-150) y: (-150)\n    glide (0.5) secs to x: (-150) y: (-30)\nend\n\nwhen backdrop switches to [thumbnail8 v]\nhide\n\nwhen flag clicked\nforever\n    turn right (15) degrees\nend\n\n@Sprite3\n\nwhen backdrop switches to [thumbnail7 v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (-70) y: (-30)\nforever\n    glide (0.5) secs to x: (-70) y: (-150)\n    glide (0.5) secs to x: (-70) y: (-30)\nend\n\nwhen backdrop switches to [thumbnail8 v]\nhide\n\nwhen flag clicked\nforever\n    turn right (15) degrees\nend\n\n@Sprite4\n\nwhen backdrop switches to [thumbnail7 v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (10) y: (-30)\nforever\n    glide (0.5) secs to x: (10) y: (-150)\n    glide (0.5) secs to x: (10) y: (-30)\nend\n\nwhen backdrop switches to [thumbnail8 v]\nhide\n\nwhen flag clicked\nforever\n    turn right (15) degrees\nend\n\n@costume2\n\nwhen flag clicked\nhide variable [die v]\nhide variable [timer v]\nset [die v] to [0]\nset [timer v] to [0]\nhide\nrepeat until <(backdrop [number v]) = [8]>\n    wait (0.1) seconds\n    change [timer v] by (0.1)\nend\n\nwhen backdrop switches to [thumbnail9 v]\nshow variable [die v]\nshow variable [timer v]\n\n