Move sprite on layout - based on geolocation.

Get help using Construct 2

Post » Fri Feb 28, 2014 12:49 pm

Hi

I'm having a hard time getting my head around the math on this one..

So I found this rule of thumb that 1 degree lattitude equals 111111 meters and that 1 degree longitude equals 111111*cos(lat). This might not be completely accurate, but let it be ok for now..

I want to be able to move within a 40m x 40m square in real life and start in the center.. So my Layout.Width somehow has to translate into the 40m..

I can use
Geolocation.Latitude
Geolocation.Longitude
- to find my center, but when I move, how do I calculate how my sprite has to move?
B
7
S
1
Posts: 43
Reputation: 1,052

Post » Mon Mar 03, 2014 7:03 am

I'm sorry but I have to bump this... No one able to help? :cry:
B
7
S
1
Posts: 43
Reputation: 1,052

Post » Mon Mar 03, 2014 7:56 am

How many pixels high/wide is your project going to be?

And are you looking to have the 40m in real life calculated into latitude-longitude? Or are you wanting global positions translated into a 40m by 40m RL square? This will determine the calculation method used.
B
27
S
9
G
2
Posts: 154
Reputation: 2,833

Post » Mon Mar 03, 2014 9:46 am

I was hoping to use the layout.width but about 800x600.

I think endnu in pixels would be better - so from lat lang to pixels..

Thanks for answering!
B
7
S
1
Posts: 43
Reputation: 1,052

Post » Mon Mar 03, 2014 9:49 am

Couldn't something like this work? Instead of havin a grid 32x32 make it 40x40 where 1 pixel is 1m

Oh, here is the sourcethread

Or image points?
Or waypoints?
Or as example capx zones

Sidenote if you puting waypoints...
Nice to show grid in general in C2
file|home|View
goto view
select show grid and choose your grid width/height
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Mon Mar 03, 2014 10:15 am

Dutoit>> Thanx for the suggestion. I'm not entirely sure, how that would help me.. (I'm saving it for a later project though ;-)
My problem is still moving the player based on actual geolocation..

Nice tips though..
B
7
S
1
Posts: 43
Reputation: 1,052

Post » Thu Mar 06, 2014 7:16 am

This keeps bugging me down - I cant wrap my head around it.. Perhaps I need to find a math-forum.. :-/
B
7
S
1
Posts: 43
Reputation: 1,052

Post » Sat Aug 05, 2017 9:07 pm

Same here! I can't move a sprite using Geolocation. Any idea how to do this?
B
4
S
1
Posts: 1
Reputation: 529


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Kin, ratboy3, tinhofiel, totoe and 44 guests