Constraining player movement

This topic is 3824 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

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 on other sites
Are you using this in a cutscene perhaps? If not, I'm not entirely sure what you're aiming for. :/

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 on other sites
Quote:
 Original post by Alan KempThere is a great article here on gamedev.net about bezier curves:http://www.gamedev.net/reference/articles/article1808.asp

Thanx Alan! Exactly what I needed.

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• Forum Statistics

• Total Topics
634092
• Total Posts
3015438
×