Jump to content

  • Log In with Google      Sign In   
  • Create Account

What to learn to create a 2d golf game?

  • You cannot reply to this topic
2 replies to this topic

#1 ISDCaptain01   Members   -  Reputation: 1314


Posted 17 June 2014 - 10:20 PM

I want to code a 2d golf game similar to NES Open Tournament using C++ and Allegro 5. Ive got a bunch of games under my belt already, but I just don't know how to approach this type of gameplay. I want to keep things like air physics as simple as possible. Any ideas?


#2 BeerNutts   Crossbones+   -  Reputation: 2555


Posted 18 June 2014 - 09:44 AM

It shouldn't be too difficult.  You'll need to have a plan for how the ball and player will interact with the course map.  Meaning, you have a image of the hole you're on, and you hit the ball in the sand, how will you map the "sand" location to an x, y range?  A simple approach would be to test the pixel color the ball landed on.


As far as ball flight, you'll have to deal with a pseudo Z location (assuming top-down view), which be how high the ball is in the air, and create a little algorithm that applies pressure each frame in one direction to simulate wind.  Each club would produce different forces, based on loft of club, swing speed, and weight of club (woods have more force).


Other than that, I don't see it being too difficult, just standard golf UI, score keeping, menus, etc.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#3 minibutmany   Members   -  Reputation: 1474


Posted 19 June 2014 - 10:32 AM

You could use Box2D for the physics, which will enable you to make the interactions a bit more complex.

Stay gold, Pony Boy.