Jump to content
  • Advertisement
Sign in to follow this  
hungboy

How to control the sprite motion?

This topic is 3005 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 want my sprite walk on a U-style road, but I don't know how to update its rotate angle and postion. Can anyone help me? I'm very very new to game programming and I don't know where to find the answer, is there any book related this issue? Thanks. Jacky

Share this post


Link to post
Share on other sites
Advertisement
Could you give more detail to what you want to do with the sprite?
(I presume to rotate the sprite based on an angle ?)

Also, what language do you program in ?

Share this post


Link to post
Share on other sites
Quote:
Original post by Dieseltjuh
Could you give more detail to what you want to do with the sprite?
(I presume to rotate the sprite based on an angle ?)

Also, what language do you program in ?


Dieseltjuh, thanks for your reply!

Sorry for reply so late. My sprite is a car. I want it drive on a road which will never changed.

My language is C++.

Share this post


Link to post
Share on other sites
You can use a waypoint system or splines to set a path for an object to follow.

If you choose the former, it's as simple as placing points and having your object move from one point to the next. The latter is slightly more complex, but instead of having straight lines it will curve the path of the car nicely (and thus look much more natural).

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!