From Test-Scratch-Wiki

A player vs player racing game is a project that lets one compete in racing against their friends.
Sprite 1
First create a new sprite, then change the costume to a car in the sprites library where there are sprites, add a if <> then block, then a Point in Direction block, then add a
Move () Steps block. It should look like this.
if <key [right arrow v] pressed> then point in direction (0 v) move (10) steps end
Continue to do this with the left arrow, down arrow, and so on. Then, place the scripts in a forever block, and under a when green flag clicked block. It should look like this once you are finished.
when gf clicked forever if <key [right arrow v] pressed> then point in direction (0 v) move (10) steps end if <key [left arrow v] pressed> then point in direction (-90 v) move (10) steps end if <key [down arrow v] pressed> then point in direction (180 v) move (10) steps end if <key [up arrow v] pressed> then point in direction (0 v) move (10) steps end end
Sprite 2
For the second sprite, get another car from the sprites library. Do the same thing as you did with sprite one, only using the W (up), A (left), S (down), and D (right) keys. Once finished, it will look like this-
when gf clicked forever if <key [w v] pressed> then point in direction (0 v) move (10) steps end if <key [s v] pressed> then point in direction (180 v) move (10) steps end if <key [a v] pressed> then point in direction (-90 v) move (10) steps end if <key [d v] pressed >then point in direction (90 v) move (10) steps end end
Backdrop
Now, time to move on to the backdrop! First go into Paint Editor. Paint a backdrop, but do not forget to paint a black and white finishing line, as it will be needed. You will need this to finish the game.
Sprites
Once the backdrop is finished, add the following code to both sprites.
when gf clicked forever if <touching color [#FFFFFF]?> then say [I win!] end end
Instructions
Sprite 1 will move with the up, down, left and right keys, and Sprite 2 will move with the W, A, S and D keys.