3D games controlled with your gamepad
Have you ever tried to play a non-Flash browser game nowadays? The graphic capabilities are amazing, especially when you see game clones like Quake.
But when playing this stuff you're always tied to your keyboard and the (mostly) clunky mouse. This is a major disadvantage, in particular for action games, it really holds them back from the browser.
Wouldn't it be cool if you just could plug your Xbox controller into your PC and start playing your favourite browser game? This is not a future vision anymore, say hello to the Gamepad API!
If you are having a gamepad around your desk, plug it in right now and enjoy some games, that already are using the Gamepad API. Programming the input controls also is a piece of cake, check out this code snippet or even better, run it yourself:
If you are having a gamepad around your desk, plug it in right now and enjoy some games, that already are using the Gamepad API. Programming the input controls also is a piece of cake, check out this code snippet or even better, run it yourself:
- <div id="gamepads"></div>
- <script>
- function gamepadConnected(event) {
- var gamepads = document.getElementById("gamepads"),
- gamepadId = event.gamepad.id;
- gamepads.innerHTML += " Gamepad Connected (id=" + gamepadId + ")";
- }
- window.addEventListener("MozGamepadConnected", gamepadConnected, false);
- </script>