Move sprite on layout - based on geolocation.

0 favourites
  • 8 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • 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?
  • I'm sorry but I have to bump this... No one able to help?

  • 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.

  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • 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..

  • This keeps bugging me down - I cant wrap my head around it.. Perhaps I need to find a math-forum.. :-/

  • Same here! I can't move a sprite using Geolocation. Any idea how to do this?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)