CSC 562: Assignment #3
Minigolf: User Interface
Due: By midnight Friday, March 14 via Wolfware
The following minigolf course file is included to help you test your program with multi-hole courses.
In Assignment #3 you will complete the user interface for your minigolf game. The functionality implemented in this assignment will complement the interface operators you have already built as part of Assignments #1 and #2 (i.e., translation and rotation of the minigolf hole, and choosing the ball's direction and velocity). Specifically, you must provide:
Recall from Assignment #1 that you have a choice of which package to use to implement your user interface. Recommended packages include GLUI or the native Windows UI widgets. Some references that might be helpful include:
A minigolf course is a collection of between one and eighteen minigolf holes. The input language defined in Assignment #1 will be extended to support minigolf course definitions. Every minigolf course file must begin with the line:
course course-name n
where:
This initial line is followed by n minigolf hole layouts. In order to simplify processing, each layout begins with a line:
begin_hole
and ends with a line:
end_hole
A minigolf hole layout is defined using the same tile, cup, and tee commands described in Assignment #1. Your program must also support two new commands that provide additional information about a minigolf hole:
par par-val
name hole-name
where:
Based on these new definitions, a minigolf course containing a single hole would be defined as:
course "A Single Hole Course" 1
begin_hole
name "Simple Little Minigolf Hole"
par 2
tile 1 4 -0.5 0 1 0.5 0 1 0.5 0 0 -0.5 0 0 0 0 3 0
tile 2 4 -1.5 0 0 -0.5 0 0 -0.5 0 -1 -1.5 0 -1 0 3 0 0
tile 3 4 -0.5 0 0 0.5 0 0 0.5 0 -1 -0.5 0 -1 1 4 0 2
tile 4 4 0.5 0 0 1.5 0 0 1.5 0 -1 0.5 0 -1 0 0 0 3
tee 1 0 0 0.5
cup 2 -1 0 -0.5
end_hole
Note that commands between begin_hole and end_hole can be defined in any order. A course with more minigolf holes would have a different number for the initial course line, together with the appropriate number of additional minigolf hole layouts (bracketed with begin_hole and end_hole).
When a new game is started, you must allow up to four players to compete against one another. A "New Game..." dialog should be used to define:
Players alternate taking shots on each minigolf hole. This continues until all the players have put the ball into the cup.
The number of shots each player needs to complete each hole should be recorded and presented in a "Scorecard" dialog. This dialog is presented at the end of each minigolf hole. The scorecard should list the number of shots for each player, for each minigolf hole completed, together with the par value for each hole. Finally, the scorecard must also display each player's current "score", the total number of shots above or below par for all minigolf holes the players have completed.
Before each minigolf hole begins, a "Hole Description" dialog should be presented to the players. This dialog is used to report the hole number, and to describe the hole (e.g., its name, its par value, and perhaps a visual summary of its physical layout).
High scores for the top ten players should be maintained as part of an external high score file. A player's "score" is the number of shots above or below par (i.e., lower scores are better). The high score table will be available as a menu item, and will be displayed in a "High Score" dialog that shows the player name, the name of the course played, and the score for each player in order of score.
After a player completes a minigolf course, the program should check to see if the player's score qualifies as a high score (i.e., if the player's score is lower than the tenth score on the list, or if there are not yet ten scores on the list). If the player's score is a high score, the player should be allowed to enter a name for the high score table (possibly different than the name they entered when they started the game). The name the player selects, together with the course name and the player's score, should be added to the high score table, and permanently recorded the external high score file.
A "splash screen" provides information about your minigolf program, for example, the name of the program, its version number, the name of the programmer who created the game, and perhaps a representative image. The splash screen will be presented as part of an "About..." dialog available as a menu item.
Use Wolfware (the online assignment submission software) to submit the following files:
There are two important requirements that your assignment must satisfy.
First, your executable and instruction files must be named exactly as shown above. The program will be run and marked electronically using a script file, so using a different name means the executable will not be found (and subsequently will not be marked).
Second, your program must be compiled to run in the Multimedia Lab environment. This means that you should logon to a Multimedia Lab machine, compile your code, and test it to ensure it executes properly. You are free to do your initial work on another architecture (e.g., a home computer, or a Linux or Solaris workstation); this should be relatively easy to do, since C/C++, OpenGL, and GLUT are all reasonably portable across different platforms.
It will not be a valid excuse to say "I forgot/didn't know that I was supposed to submit a Windows executable file compiled to run in the Multimedia Lab."