Real World Distance Measuring?

Get help using Construct 2

Post » Fri Sep 13, 2013 10:25 pm

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!
B
4
Posts: 9
Reputation: 394

Post » Sat Sep 14, 2013 12:45 am

If you can figure out how to convert from an on-map scale to pixels, then you should be set.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,224

Post » Sun Sep 15, 2013 7:52 pm

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.
B
4
Posts: 9
Reputation: 394

Post » Sun Sep 15, 2013 8:03 pm

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: Geolocationthehen2013-09-15 20:05:13
Moderator
B
72
S
14
G
11
Posts: 900
Reputation: 11,920

Post » Sun Sep 15, 2013 8:26 pm

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)

Bearing.javatulamide2013-09-15 20:26:57
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Sun Sep 15, 2013 9:40 pm

Thx Guys! I'll give that all a try.
B
4
Posts: 9
Reputation: 394


Return to How do I....?

Who is online

Users browsing this forum: Cha0tiXGamer, Google [Bot] and 9 guests