• Advertisement
Sign in to follow this  

Constraining player movement

This topic is 3494 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 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
Advertisement
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
Sign in to follow this  

  • Advertisement