Friday, July 31, 2009

Golf game using c++?

I need help in writing a golf game using c++ on Visual Studio - 2005. Could anyone just give ideas how to do it? The program should allow the user to play one hole a 280 metre par 5.


Please help......

Golf game using c++?
You'll need a way to determine the direction, strength and accuracy of the shot based on the player's input. Most games I've seen ask the player to decide how hard he's going to swing, then use a click timer to gauge how close to a perfect swing he makes. The path the ball takes is calculated like a shot in the classic artillery game, and if you care about realism can take wind into account as well as the slope and condition of the grass. Keep it simple while you get the physics down and save the extra credit features for later.





So it would go like this:





1. Get the player's club choice, aim, and swing strength.


2. Take a swing, challenging the player to click at exactly the right time.


3. From those input parameters, decide which direction the ball is going and how hard it's being hit, taking accuracy into account.


4. Launch the ball and calculate/animate its trajectory.


5. When the ball has stopped, make a report and invite the player to hit again.





There's a real nice game online at http://www.worldgolftour.com/ that might give you some ideas.
Reply:Well thats according to the level of detail you want to use. I'd go use the directx API within c++. Thats how I do my basic game programming.





Of course if it's going to be really really simple such an approach may be overkill.





Look up the directx 9 sdk. Get it and google some tutorials.
Reply:C and C++ attach the coding software and output hear


No comments:

Post a Comment