# Isometric Pixel-by-Pixel Movement

This topic is 4545 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I'm trying to learn how to create isometric (2:1) games. Right now I know how to draw isometric tiles, and I can move my hero sprite tile-by-tile. However, I can't seem to get him to move pixel-by-pixel, so that he would be able to appear in the middle of an isometric tile. Right now by using tile-by-tile movement, he just "jumps" from 1 tile to another. I would like him to move smoothly instead. If anybody knows a formula or something, please tell me. :)

##### Share on other sites
You can calulate the pixel positions between two tiles by interpolating linearly between the two coordinates. If you think about linear interpolation as a percent between 0 and 100, then the first frame will have 100 of the first position and 0 of the second. The middle frame will have 50/50 and the last frame will have 0 from the first (starting) position and 100 from the second (destination) position. The speed at which you are changing from 100 to 0 and 0 to 100 will be the speed of your character. Just make sure the sum of the two percents are always 100.

Viktor

##### Share on other sites
Your hero starts at location X at time 0.

At time T you want your hero at location Y.

If you don't care about jerky accelleration, your hero's location at time t, with 0<t<T, will be:

X + (Y-X)*t/T

If you care about having a smooth velocity movement, you are now moving into the realm of smoothing your path.

You'll want to know the initial Velocity, and possibly more than 1 planned location in the future. Such an approach could avoid "jerky rectangular movement" of your character.

Oh, and make sure your render frequency has nothing to do with your character's movement speed.

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 11
• 10
• 13
• 96
• 11
• ### Forum Statistics

• Total Topics
632974
• Total Posts
3009641
• ### Who's Online (See full list)

There are no registered users currently online

×