• Advertisement

Archived

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

Simple Demonstration

This topic is 6064 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 have this idea of creating a program in which a person enters in the initial velocity and angle to throw a basketball into a hoop. Does anyone have source code to a game/program of this nature? I''d really appreciate it and love to view it for intellectual purposes.

Share this post


Link to post
Share on other sites
Advertisement
Why on earth would you need source code to an application such as that? There is so much documentation on creating such a representation, all on the Internet. geesh

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try searching under ''balistics'' - here''s a url http://www.programmersheaven.com/search/Download.asp?FileID=13760

Best of luck

Share this post


Link to post
Share on other sites
But what about if the ball hits the rim. wouldn''t that be kind of difficult? I don''t think they include that in the article.

Share this post


Link to post
Share on other sites
"What if..."

Well, then you do what coders have been doing for decades...you simplify.

There are lots of variables that you won''t be able to take into consideration.

As for the rim, if you assume a non-elastic collision (where things don''t lose velocity from bouncing), you can just find the angle of impact and send the ball against that angle. Not too hard, but if you haven''t even taken physics and learned about projectiles, it won''t be easy.

You can do the same with the back-board, but of course that''s easier, because it''s just vertical, and you can just swap the horizontal velocity.

G''luck,
-Alamar

Share this post


Link to post
Share on other sites

  • Advertisement