Game Development Reference
In-Depth Information
the cursor and locking it in place so that it doesn't hit the edges of the screen. This means that instead of
relying on x and y coordinate values for mouse position in related to the top-left corner of the browser, you
instead rely on x and y distance values from the position that the mouse was locked to.
Console-like experience with the Gamepad API
Another input-related improvement that is coming to the web is that of the GamepadAPI. No longer are the
keyboard and mouse the only options available for your players to engage with your game. The
GamepadAPI now allows for all sorts of gamepads to be accessed via JavaScript. This even includes
some of the console controllers like those on the Xbox 360 and PlayStation 3 (with third-party drivers)!
Like the Mouse Lock API, the GamepadAPI has just landed in experimental builds of Firefox Nightly
and Chrome—and it's nice and simple to use (again, it is likely that the support will be in public builds
of these browsers by the time you read this). Coupled with the Full Screen API, gamepad support can
really change the experience of your game from that of a game within a web site to that of a desktop game
or console.
Identify players with services like BrowserID
Just like how iOS has services like OpenFeint and the Apple Game Center, games on the web need open
and reliable methods of identifying players. BrowserID is one of Mozilla's solutions to this problem, which
allows players to log into your game using their existing e-mail address and without needing a password.
Identifying players in this way is just the first step in providing all sorts of functionality with your game, like
friends lists, leader boards, chat, and multiplayer.
Create native OS applications with environments like WebRT
One of the more profound initiatives within Mozilla is the integration of a web run-time (WebRT). It allows
players to install your game “natively” on their chosen operating system (Windows, Mac, and Android right
now), with a launch icon just like standard OS applications.
WebRT also runs your game using an app-centric user agent (in contrast to browser-centric user agents
like Firefox) and runs your game using a separate user profile and OS process to your player's normal
Firefox that they use for browsing.
The ability of WebRT to break away into another process and remove all the browser UI makes the
experience for gaming that much sweeter. There's something about having an icon in the dock on a Mac
that launches your game in its own “native” window with no mention or feel that this is a browser.
As a developer, this is slightly magical. It allows you to break free from a game being a glorified web site
and instead turning it into an application, an experience in its own right. Mark my words: this will be a
turning point in the transition from five-minute puzzle games on the web to professional-grade games that
have a console-like experience.
 
Search WWH ::




Custom Search