In initially planning our game, we tried to think not only about how a mini-golf game should work, but what elements we wanted to make ours unique. We came up with two main ways to distinguish our game from others:
Continue with the "Grand Theft Golf Cart" theme from our previous game. In keeping with this theme, we envisioned a rotating golf cart on our course, and assorted cans and bottles littering the course as obstacles.
Create a billboard with game instructions (using the same graphics scheme as our first game), and then sweep the camera from this billboard, across the course, to the ball and club.
In addition to the major risks associated with building a physics engine which Z discussed in class, we came up with 3 major risks for our game:
We weren't sure if we would be able to find (or create our own) models of the assorted obstacles we wanted on the course, specifically the golf cart and bottles. We were able to find these models, although the golf cart required conversion between a couple of different formats, and still required some major simplification (for instance, we removed the clubs from the back of the cart).
We weren't sure if we'd be able to make the cart rotate. This turned out to be pretty simple -- increment the angle with every timer tick, and call the OpenGL? rotate function.
We thought we might have to create bounding boxes to display the complex models without a performance loss. We didn't implement bounding boxes, coming up with a far easier solution. We created a separate class, the Shape class, which functions like the Triangle class, but doesn't perform collision detection. So our complex objects -- the golf cart, bottle, and can -- are all implemented as shapes. Additionally, we created highly simplified models of these shapes which are implemented as triangles, and therefore perform collision detection. The simplified models are transparent, and the combination of the two models produces the effect of collision with the visible models without the performance limitations.
We do have a few bugs that we haven't been able to resolve:
The club is not oriented properly at the beginning of each stroke.
You can't change the camera orientation during sweep.
The ball doesn't always go into the hole.
Edge collision occasionally fails.
The opening camera is not centered properly on the billboard.
The ball rolling is not perfect. We've tried several friction constants, but none of them looks exactly right.
The ball texture does not rotate correctly as the ball rolls.
Possible future enhancements:
Add additional levels. Since the engine loads all the information it needs about the course from a file, it would be pretty easy to create additional files for different levels.
Water. We considered adding puddles or some sort of water trap, but decided we didn't have time to implement this. However, it would add a lot to the game.