Jump to content

What's the easiest way to calculate moving speed?


Recommended Posts

Create a countdown timer with 5 s and a variable for last position. When starting the timer, init the variable with the position of the player. In timer tick calculate the distance to the last position and save the new position to the variable (for next calculation). Now you have a walked distance in meters and a time of 5 s. distance * 720 is the speed in km/h of the player. Check this result. If it is ok, start timer again. If not, do whatever you want.

Link to comment

Sorry for ikstupid question: but how do this in Urwigo? Is possible in Urwigo to calculate speed like in this case? (sorry for my english).

I would like avoid cheatning (e.g geocacher should walk from zone A to zone B in 5 min. The use of bicycles is prohibited)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...