2 Player Platformer race!

Instructions: A two player platformer race! All levels are possible.\nBlue: WASD\nRed: Arrow keys \n\n https://scratch.mit.edu/projects/282118515/\n\n https://scratch.mit.edu/projects/280834968/

@Stage\n\nwhen flag clicked\nwait (7) seconds\nforever\n    play sound [Undertale Ost 087 - Hopes and Dreams v] until done\nend\n\n@Sprite1\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [22]> then\n        broadcast (Red Wins v)\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\n@Sprite2\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [22]> then\n        broadcast (Blue Wins v)\n    end\nend\n\nwhen I receive [bnext level v]\nnext costume\n\nwhen flag clicked\ngo to x: (0) y: (180)\nswitch costume to (costume1 v)\n\n@Sprite3\n\nwhen I receive [go! v]\ngo to x: (-220) y: (-30)\nshow\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-1)\n    end\n    if <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 (#ff3232)?> then\n        change y by (1)\n        if <touching color (#ff3232)?> then\n            change y by (1)\n            if <touching color (#ff3232)?> then\n                change y by (1)\n                if <touching color (#ff3232)?> then\n                    change y by (1)\n                end\n                if <touching color (#ff3232)?> then\n                    change y by (1)\n                    if <touching color (#ff3232)?> then\n                        change x by ((Xv) * (-1))\n                        change y by (-5)\n                        if <key (up arrow v) pressed?> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\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    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching color (#ff3232)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#ff3232)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nforever\n    if <touching color (#848484)?> then\n        change [xv v] by (10)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#000000)?> then\n        set [yv v] to [0]\n        set [xv v] to [0]\n        go to x: (-220) y: (-30)\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <key (down arrow v) pressed?>> then\n        switch costume to (costume2 v)\n    end\n    if <key (down arrow v) pressed?> then\n        switch costume to (costume3 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(x position) > [239]> then\n        broadcast (Next Level v)\n        go to x: (-220) y: (-30)\n    end\nend\n\n@Sprite5\n\nwhen I receive [go! v]\ngo to x: (-220) y: (150)\nshow\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <key (a v) pressed?> then\n        change [xv v] by (-1)\n    end\n    if <key (d 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 (#5b91ff)?> then\n        change y by (1)\n        if <touching color (#5b91ff)?> then\n            change y by (1)\n            if <touching color (#5b91ff)?> then\n                change y by (1)\n                if <touching color (#5b91ff)?> then\n                    change y by (1)\n                end\n                if <touching color (#5b91ff)?> then\n                    change y by (1)\n                    if <touching color (#5b91ff)?> then\n                        change x by ((Xv) * (-1))\n                        change y by (-5)\n                        if <key (w v) pressed?> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\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    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching color (#5b91ff)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#5b91ff)?> then\n        if <key (w v) pressed?> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nforever\n    if <touching color (#9a9a9a)?> then\n        change [xv v] by (-10)\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <key (s v) pressed?>> then\n        switch costume to (costume2 v)\n    end\n    if <key (s v) pressed?> then\n        switch costume to (costume3 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#848484)?> then\n        change [xv v] by (10)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#000000)?> then\n        set [yv v] to [0]\n        set [xv v] to [0]\n        go to x: (-220) y: (150)\n    end\nend\n\nwhen flag clicked\ngo to x: (-220) y: (150)\n\nwhen flag clicked\nforever\n    if <(x position) > [239]> then\n        broadcast (BNext Level v)\n        go to x: (-220) y: (150)\n    end\nend\n\n@Sprite4\n\nwhen flag clicked\nshow\nset [ghost v] effect to (25)\nswitch costume to (3 v)\nset size to (100) %\ngo to x: (0) y: (0)\nrepeat (4)\n    repeat (50)\n        change size by (10)\n    end\n    next costume\n    set size to (100) %\nend\nbroadcast (GO! v)\nhide\n\n@Sprite6\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\n\nwhen I receive [blue wins v]\nshow\nswitch costume to (costume2 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [red wins v]\nshow\nswitch costume to (costume1 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@Sprite7\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\ngo to [front v] layer\n\n