# How to calculate speed

#### Timothius

##### Villager
In a project, I plan to have MPH and/or KPH displayed on the screen to show how fast the player is going.

But how would I have that calculated to display on the screen?
How would the game know that your current speed is 20mph or 50 mph?

I'm not a big math guy, but I am sure if someone pointed out a simple formula for that, I could code it from there.
Any help appreciated.

#### TheoAllen

##### Self-proclaimed jack of all trades
Velocity = Displacement / Time

The term itself refers to "Miles Per Hour" or "Kilometer Per Hour".
So it is divided by time. How long does it take to move from A to B.

#### Timothius

##### Villager
Velocity = Displacement / Time

The term itself refers to "Miles Per Hour" or "Kilometer Per Hour".
So it is divided by time. How long does it take to move from A to B.

Wow, super simple! Thanks for the reply!

So all I would really need would be a variable for time, a variable for where I was, where I am currently (displacement), figure out how much time has passed from one coordinate to the next, and then finally a variable for the end result (velocity). I'll have to try this out.

### Latest Profile Posts

The site is being slow and funky again. IS SOMEONE CRAFTING POEMS?!
So yeah, @TRIDIUM @TESTOSTERONE, I wuz like, "What do they mean by borderline and boundaries?"

And then, y'all know this girl?

The clothes? They're just a, um, quick edit.
I've uploaded the opening cutscene from my game to my channel. It basically introduces us to the first three characters, and what their relationships are:
Cosmic Inferno: Opening dialogue
I don't want to start a panic...but everyone, check the color of your milk!
My One Map Challenge is nearing completion. I am in the multiple run testing phase atm. This is the map. Beware the minotaurs in the maze area. The female ones are more aggressive. Can you prove to the land of Winchell that a dragon and a human can love each other?