Sign in to follow this  
HexorBlue

Constraining player movement

Recommended Posts

I need some insight into how one would constrain a player's movement. Specifically I would like to emulate something such as a curved path that the player can move along and when he gets to a certain point/node perhaps raise an event which at that point I can do game logic for the player. (ie rotate the bitmap) Any information or links to some theory on player movement would be much appreciated. Thanx in advance.

Share this post


Link to post
Share on other sites
You could try having a bezier curve and moving the player along that.

There is a great article here on gamedev.net about bezier curves:

http://www.gamedev.net/reference/articles/article1808.asp

Given the curves formula you can find any point along that curve from 0.0 (the first end) to 1.0 (the second end). In your case you could figure out how far along the curve the player is and draw them at the appropriate position.

Alan

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