• Advertisement
Sign in to follow this  

Smooth Sprite Movement

This topic is 1645 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

I am continuing work on a 'space shooter' game in SFML 2.0, and everything is going well.  The question I have pertains to changing the sprite's position using velocity along the 'x' axis (velX) and velocity along the 'y' axis (velY).  Assuming each variable is set to a constant value of 5, the sprite will "skip" pixels until it reaches a new destination equal to its current position plus 5 per game cycle.

 

This creates a rough effect, as the sprite apparently jumps from one position along a diagonal line to the next.  Is there a way to have the game loop render all the "missing" frames between the sprite's old position and its new destination?  This is mostly a cosmetic concern.  The current method looks okay ... I just want to see if there is a "smoother" way of rendering the sprite's position change.

 

Thanks.

Edited by neomaycry

Share this post


Link to post
Share on other sites
Advertisement

Servant,

 

Your explanation was superb, and the resources you shared are wonderful.  Everything looks beautiful now.  Delta time was the answer :).

 

Thank you!

Share this post


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

  • Advertisement