Archived

This topic is now archived and is closed to further replies.

CompiledMonkey

Basic math help needed...

Recommended Posts

I''m making a game for my final project in programming, and I need a little help with curved lines. I''m making 3 Card Monty (http://www.isy.vcu.edu/~cstewart/info350/FinalProject.html) and need a way to move two of the cards around at the same time. I know how to actually do the code of animating the cards, but I don''t know how to come up with the equation to do it with an arc. Can anybody help me here?

Share this post


Link to post
Share on other sites
One way to do it would be by using projectil-like parametric equations. In other words, set an x velocity, and update that until it gets to the destination. Also set a y velocity, but also a y acceleration, updating the velocity with the acceleration (negative if you want an arc that goes up and returns down, positive if you want an arc that goes down then returns up). Note that whatever sign the y acceleration has, the initial y velocity should have the opposite sign.

Check out an introductor physics book for more detail on this simple method of doing things.

Share this post


Link to post
Share on other sites