Game Development Reference
In-Depth Information
Geolocation
Although 3D graphics are awesome, as is a socket-based, multiplayer game, neither
technology is necessarily new. Geolocation, on the other hand, is somewhat of a more
recent phenomenon. With it, we are able to use JavaScript to determine the physical
location (geographical location) of a user. Having such a tool at our disposal opens up
new possibilities of awesome, highly innovative game concepts.
Now, whenever a new feature comes out that promises to be able to track down
exactly where a user is physically located, most people (except for developers, of
course) get at least a little scared about it. After all, how creepy would it be to play
a very dark, survival horror game, knowing that other people playing the game can
see exactly where you live. Luckily for us, the entire geolocation API is opt-in-based,
meaning that the user is prompted about the application attempting to capture the
user's location and the browser only allows the application to continue to capture the
GPS location of the user if and when the user accepts the request from the applica-
tion.
As shown in the following screenshot, when attempting to use the geolocation API,
the browser will somehow alert the user about it and ask for permission to continue. If
the user decides not to share his or her location with the application, the browser will
not share the location with the application.
Search WWH ::




Custom Search