Moving A Character Issue

Hey all. I’m having an issue with moving a character at the correct speed. My app is just a square in the middle of the screen, and I tap to where I want it to move. I handle this with the transition API, I tap and the square moves to the x/y co-ords. The only problem is how do I regulate the speed? EG, the transition API uses a default of 500ms for the movement, and it takes the same time to move 5 pixels distance as it does 500 pixels, it should take longer as its a longer distance. Can anyone give me any pointers on keeping the same speed for different distances?

I think i’ve worked it out in my head now… just gotta put it into practice. 

I’d just calculate the distance between the start and end points (a few examples exist around the community), and use that value as a divisor.

Cheers Brent, have it all sorted now :slight_smile:

I think i’ve worked it out in my head now… just gotta put it into practice. 

I’d just calculate the distance between the start and end points (a few examples exist around the community), and use that value as a divisor.

Cheers Brent, have it all sorted now :slight_smile: