Recently I came upon cursors.io - a massive multiplayer maze game with a social twist. A really simple idea with an amazing experience. It reminded me of a small school project I developed as a teenager. It was a quick maze game with some neat MS Paint graphics made by my friend. I decided to port it as a browser game to check out the Phaser library.
At one point I realized there is no way to set the mouse position using JS. It makes sense, so people can’t abuse it. However, the whole game concept depends on it. Fortunately there is a Pointer Lock API to lock the mouse within an HTML element. It is only supported by Chrome and Firefox, but that’s fine with me. Check out the source code at GitHub. And here’s a live demo: