Jump to content
  • Advertisement
Sign in to follow this  
Dante Shamest

Isometric Pixel-by-Pixel Movement

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!