Hey all, I want to create a GPS type game, I'm wondering if there is a way to measure real world distance? eg triggering events after 500 meters, something like that?
if it is possible, is it GPS or accelerometer? or something else?
Any help would be greatly appreciated!
If you can figure out how to convert from an on-map scale to pixels, then you should be set.
Develop games in your browser. Powerful, performant & highly capable.
Thanks for the response Excal, do you have any advice on how to do that? I cant seem to find much on the gps side of things.
You can get longitude and latitude with the Geolocation object. You could then implement the following using events: Calculate distance, bearing and more between Latitude/Longitude points.
If you plan on getting any more data other than distance, such as city name etc. then it would probably be best to write a plugin that utilises a reverse-geocoding service like the Bing Maps API (it's got more flexible licensing than Google's).
Edit -> This is a good place to start: Geolocation
thehen beat me to it.
But for completeness, I found a JAVA implementation based on the original FORTRAN code from the US National Geodetic Survey, to measure distances in meter based on 2 geolocations (2x longitude/latitude)
Thx Guys! I'll give that all a try.