

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Due: 12:30pm Thursday, February 28, 2002
This assignment has two pages. Make sure you have both of them.
This assignment involves using OpenGL programming API with the GLUT toolkit. The goal is to implement a simple maze game. The goal of the game is for the player to move a game piece in the shape of a face (we will refer to it as Gump) from its start position at the lower left of the screen to its ending position at the top right of the window. Your program should allow the player to use the keyboard to control Gump’s movement. You can find details about using OpenGL and GLUT on various platforms, links to download OpenGL and GLUT on your PC or UNIX workstation, and Assignment 1 startup source code and data at http://www.cs.umd.edu/class/spring2002/cmsc740/assg1/. Given the various possible platforms and their configurations as well as our limited resources we would not be able to help you install OpenGL and GLUT on your personal systems. Please make sure that your final program works on machines in one of the following labs: Microsoft/WAM Lab (AVW
(a) Open a window should of size 512 × 512 , with blue background. The walls of the maze are specified in a file mazedata.txt, in the following format:
n x 11 y 11 x 12 y 12 x 21 y 21 x 22 y 22 .. . xn 1 yn 1 xn 2 yn 2
Here n is the number of line segments denoting the n walls of the maze, and (xi 1 , yi 1 ) and (xi 2 , yi 2 ) represent the start and end points of the ith^ wall. Write the code to read the above data file and display the walls of the maze as yellow lines that are three pixels thick. (5)
(b) Use the image-reading code at the assignment web-page to read the image of a house house.dt. If you prefer your own image readers, you may use GIF, TIFF, JPG formats of this image available from this assignment’s web page. Display the image near the exit of the maze at the top right corner of the window. Also write the code to display Gump’s face at the lower left corner of the maze and inside the maze. You should create it using OpenGL triangles or polygons. (5)
(c) Write code to enable the player to use the keyboard’s four arrow keys to control Gump’s movements in the maze as follows:
(7)
(d) Implement Gump to have animated expressions as follows:
(3) Special Note: Refer to the demo version of our sample implementation of this game to resolve any ambiguities that might have remained in the above description.