Learn Create Your Own Split Screen

Next Page

By now, you're probably getting unhappy about how unresponsive these games are to the keyboard.

They're really no better than Scratch.

The problem is we're relying on the key-repeat function of the keyboard.

You've doubtless noticed this, even just when typing documents. If you press a key and hold it down, one character immediately appears on the screen, then there's a delay, then the character starts to slowly repeat. This behaviour is controlled deep down in the operating system.


Even worse, there can only be one key down at a time. For any decent game, you want to be able to press "up" and "right", and end up with a diagonal. Or hold down "right" and press the space bar at the same time.

Fortunately, with Javascript, we can do something about it.