跑酷遊戲4（Platformer）

Instructions: 感謝＠longlong2011教我做

@Stage\n\n@Sprite1\n\ndefine reset\ngo to x: (-190) y: (-10)\npoint in direction (90)\nswitch costume to (costume1 v)\nset rotation style [left-right v]\n\nwhen flag clicked\nshow\nswitch backdrop to (backdrop1， v)\nreset\nset [y v] to [0]\nset [x v] to [0]\nforever\n    if <<<mouse down?> and <(mouse x) > (x position)>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n        point in direction (90)\n        change [x v] by (1)\n    end\n    if <<<mouse down?> and <(x position) > (mouse x)>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n        point in direction (-90)\n        change [x v] by (-1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change x by ((x) * (-1))\n                            change y by (-4)\n                            if <<<mouse down?> and <(mouse y) > (y position)>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                                if <(x) > [0]> then\n                                    set [x v] to [-5]\n                                else\n                                    set [x v] to [5]\n                                end\n                                set [y v] to [15]\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (y)\n    if <touching color (#000000)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <<<mouse down?> and <(mouse y) > (y position)>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            set [y v] to [15]\n        end\n    end\n    change y by (1)\n    if <<<mouse down?> and <(y position) > (mouse y)>> or <<key (down arrow v) pressed?> or <key (s v) pressed?>>> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#ff0000)?> then\n        reset\n    end\nend\n\nwhen flag clicked\nforever\n    if <[-170] > (y position)> then\n        reset\n    end\nend\n\nwhen flag clicked\nforever\n    if <(x position) > [235]> then\n        next backdrop\n        reset\n    end\nend\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nforever\n    if <touching color (#00fff2)?> then\n        change [y v] by (25)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#1d00ff)?> then\n        set [y v] to [-20]\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\n\n@Sprite3\n\nwhen this sprite clicked\nnext backdrop\n\nwhen flag clicked\nforever\n    if <(backdrop [name v]) = [backdrop11]> then\n        hide\n    else\n        show\n    end\nend\n\n