Mini Golf

In this project, you will use sprites in the MonoGame framework to create a mini golf game. The example depicted above is roughly what your game could look like when finished (though the gif doesn’t quite capture all of its aspects).

Game Description

The project is played as a top-down 2D game. The exact way you display it graphically is up to you, but it should be reasonably intuitive to look at. For example, you might choose something simpler as depicted below.

Here, we display a blue bar to represent where the ball can be initially placed. Black areas are the walls and obstacles. The hole is denoted by a blue circle. The red and green patches represent the up and down slopes respectively (from the point of view of the starting location).

The goal of the game is, of course, to hit the golf ball from its initial location into the hole through a series of strokes. The less strokes required, the better the player has done.

Requirements

The following are the requirements that must be implemented in your game.

  • You must have at least one hole (which must be drawn accurately to the screen).
  • At least one hole must require turning at least one corner to reach from the initial position.
  • There must be kinetic friction so that the ball eventually stops once hit.
  • The ball bounces off walls upon impact, does not stick to them (this can be a problem at low velocities if you do not fully resolve collisions), and does not enter/teleport through them (this can be a problem at high velocities depending on how you resolve collisions).
  • You must have at least one slope (either uphill or downhill). Slopes should affect the ball’s velocity appropriately.
  • The ball can be hit when it is no longer moving (and not already in the hole).
    • The control scheme for hitting the ball can be anything you desire so long as it is sensible. In the topmost example, the game is controlled entirely with the mouse by clicking on the ball, pulling the mouse back as if it were a putter, and then releasing.
    • You must be able to hit the ball from at least 32 different angles from any position (even if this would send it straight into a wall).
    • The user should be able to select from at least 16 different levels of power to hit the ball with.
  • The number of strokes must be tracked and displayed to the player.
  • Whenever the ball hits a wall, hits an obstacle, or falls into the hole, an appropriate sound should play.
  • The game should sensibly use MonoGame’s component architecture (i.e. add the component parts of your game to Components in your Game class).

You are free to add as many bells and whistles as you desire to your game. In the topmost example, for instance, the ball will curve around the outside of the hole or skip over the hole if it’s going too fast (with a bit of a speed loss) as it would in real life. Collisions with walls also are not perfectly elastic, so some speed is lost when hitting them.

You are free to use the MonoGame Utilities library provided to you for this project if you so wish.

Submission Instructions

You will want to place your game code, project, content, and anything else needed to assemble it into a zip folder. Then upload it to Gradescope.

Your code must be able to be compiled on Windows 11. You must also INCLUDE INSTRUCTIONS FOR HOW TO BUILD/RUN YOUR GAME in a txt or pdf file named readme in the root directory.