• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

# What to learn to create a 2d golf game?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1ISDCaptain01  Members

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?

### #2BeerNutts  Members

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)

### #3minibutmany  Members

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.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.