Sign in to follow this  
hungboy

How to control the sprite motion?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this