Learn Create Your Own Split Screen

Next Page

We do that with a keyup handler.

This handler gets called whenever a key goes up. We just check which key was released, and set the appropriate velocity to zero.

Try it now.

It's very smooth and responsive, and even better, we can do diagonals by holding two keys at the same time.