Geolocation

Discussion and feedback on Construct 2

Post » Thu Aug 30, 2012 11:24 am

I would like to request a new feature, GeoLocation

http://tutorials.html5rocks.com/en/tutorials/geolocation/trip_meter/
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Thu Aug 30, 2012 3:18 pm

What do you need this for? While it's kind of cool, I prefer not to develop features unless there's a specific need.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Thu Aug 30, 2012 3:36 pm

well you could develop a location based games :)

also, do it yourself Joannesalfa, its very simple javascript with calljs plugin, or in phonegap / appmobi.
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Thu Aug 30, 2012 6:11 pm

geolocation based games would be a cool feature to add to construct 2s list of capabilities but i also see how a plugin can be written very simply for this since its all javascript anyways maybe post a plugin idea in that thread
B
20
S
3
Posts: 109
Reputation: 1,967

Post » Thu Aug 30, 2012 7:45 pm

Since accelerometer is a feature for control already.
Taking advantage of something like location services sounds awesome.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Thu Aug 30, 2012 8:34 pm

I tought about browser plug in can integrate geolocation, then 3rd third party plugin would be awesome
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Thu Aug 30, 2012 9:36 pm

Since browsers reach so far geolocation could come in very handy. Some places ban certain things. If a game has a ban on say alcohol or mature references then it might be wise to have a separate layout with those references removed. Some areas don't allow certain payment types, the list goes on. I'll be using facebook graph to determine what language is shown, however people without Facebook integration could utilize the location to determine language. :) I'd definitely call adding it a positive. :)
B
67
S
21
G
15
Posts: 701
Reputation: 15,579

Post » Mon Jun 03, 2013 9:25 am

Hi,
Digging up an old thread :)
I'm currently trying to develop a geolocation based game with Construct. However I'm struggling to implement a working solution.

I tried using the ExecJS function in the Browser object to run the geolocation feature but I don't really know how to store latitude and longitude values into C2 variables.

Here is my script so far (excuse the messy solution used, I've never used javascript before and I tried several things but always get returned zero in my latitude variable, I'm not even asked for geolocation permission)

Browser.ExecJS("
var position;
function getLocation(p)
{
if (navigator.geolocation)
    {
    navigator.geolocation.watchPosition(function (position){
"&Text.latitude &"= position.coords.latitude; }
);
    }
}

")
B
8
S
2
Posts: 5
Reputation: 562

Post » Mon Jun 03, 2013 12:57 pm

@Manfred - it's on my todo list to add an official geolocation plugin. You should probably wait for that, or if you're desperate, use the Javascript SDK yourself - the ExecJS expression is entirely unsuitable for this type of thing.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Mon Jun 03, 2013 1:06 pm

Thanks Ashley,
Great news to hear an official plugin is coming :)
For now I'll try to cook my own plugin to see how the Javascript SDK is working and quiclky test a basic geolocation feature.
B
8
S
2
Posts: 5
Reputation: 562

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Colludium, Lof and 12 guests