2-player platformer

Instructions: help the two ninja complete their training.\n\nControl p1 (green) with the arrow keys\n\nControl p2 (purple) with W S A D

@Stage\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [16]> then\n        show variable [p1 deaths v]\n        show variable [p2 deaths v]\n    else\n        hide variable [p1 deaths v]\n        hide variable [p2 deaths v]\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [SONIC_FORCES_FIST_BUMP_FULL_VERSION_ANIMATED_LYRIC_60_fps\[Youtubeamp3.net\].mp3 v] until done\nend\n\n@,\n\nwhen flag clicked\nswitch costume to (gray enemy v)\nswitch backdrop to (backdrop1 v)\ngo to x: (-206) y: (-134)\nhide variable [p1 deaths v]\nset [p1 deaths v] to [0]\nforever\n    change [yv v] by (-0.5)\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (0.7)\n        point in direction (90)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-0.7)\n        point in direction (90)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#000008)?> then\n        change y by (1)\n        if <touching color (#000008)?> then\n            change y by (1)\n            if <touching color (#000008)?> then\n                change y by (1)\n                if <touching color (#000008)?> then\n                    change y by (1)\n                    if <touching color (#000008)?> then\n                        change y by (1)\n                        if <touching color (#000008)?> then\n                            change x by ((Xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            change x by (1)\n                            if <key (up arrow v) pressed?> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-8]\n                                else\n                                    set [xv v] to [8]\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 y by (Yv)\n    if <touching color (#000008)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000008)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [10]\n        end\n    end\n    change y by (1)\n    if <touching color (#ffff00)?> then\n        set [yv v] to [0]\n        broadcast (message1 v)\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    if <touching color (#00ffff)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [5]\n        else\n            set [yv v] to [-1]\n        end\n    end\n    if <touching color (#ff0000)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [yv v] to [0]\n        set [xv v] to [0]\n        set [ghost v] effect to (0)\n        change [p1 deaths v] by (1)\n        go to x: (-206) y: (-134)\n    end\nend\n\nwhen I receive [message1 v]\ngo to x: (-206) y: (-133)\nswitch backdrop to (next backdrop v)\nchange [level v] by (1)\n\nwhen [left arrow v] key pressed\nswitch costume to (gray enemy2 v)\n\nwhen [right arrow v] key pressed\nswitch costume to (gray enemy v)\n\n@.\n\nwhen flag clicked\nswitch costume to (orange enemy v)\nswitch backdrop to (backdrop1 v)\ngo to x: (-225) y: (-131)\nhide variable [p2 deaths v]\nset [p2 deaths v] to [0]\nforever\n    change [yv v] by (-0.5)\n    if <key (d v) pressed?> then\n        change [xv v] by (0.7)\n        point in direction (90)\n    end\n    if <key (a v) pressed?> then\n        change [xv v] by (-0.7)\n        point in direction (90)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#000008)?> then\n        change y by (1)\n        if <touching color (#000008)?> then\n            change y by (1)\n            if <touching color (#000008)?> then\n                change y by (1)\n                if <touching color (#000008)?> then\n                    change y by (1)\n                    if <touching color (#000008)?> then\n                        change y by (1)\n                        if <touching color (#000008)?> then\n                            change x by ((Xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            change x by (1)\n                            if <key (w v) pressed?> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-8]\n                                else\n                                    set [xv v] to [8]\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 y by (Yv)\n    if <touching color (#000008)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000008)?> then\n        if <key (w v) pressed?> then\n            set [yv v] to [10]\n        end\n    end\n    change y by (1)\n    if <touching color (#ffff00)?> then\n        set [yv v] to [0]\n        broadcast (message1 v)\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    if <touching color (#00ffff)?> then\n        if <key (w v) pressed?> then\n            set [yv v] to [5]\n        else\n            set [yv v] to [-1]\n        end\n    end\n    if <touching color (#ff0000)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [yv v] to [0]\n        set [xv v] to [0]\n        go to x: (-225) y: (-130)\n        set [ghost v] effect to (0)\n        change [p2 deaths v] by (1)\n    end\nend\n\nwhen I receive [message1 v]\ngo to x: (-225) y: (-130)\n\nwhen [a v] key pressed\nswitch costume to (orange enemy2 v)\n\nwhen [d v] key pressed\nswitch costume to (orange enemy v)\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nshow\n\n