DPA 4010 / 6010
Spring 2016
Moving in a Maze
Homework
Assignment
4
Due: Midnight,
Wednesday, March 9
This project is the next step in the process
of building a maze game. This time, you will load a maze from
a file specified on the command line, using your code from the
last assignment. But now, there a player should be positioned
in the starting cell of the maze, and your program should
allow the use of the arrow keys on the keyboard to move the
player around in the maze. The maze should be drawn as in the
previous assignment, but with the player shown as a yellow
circle. The arrow keys should move the player left, right,
down, or up, but only in directions not blocked by a wall, or
the edges of the maze. Since many games use the w, a, s, and d
keys to move around, you are free to use them instead of the
arrow keys if you prefer. Also, note if you decide to use the
arrow keys, you will have to use the glutSpecialFunc
callback, rather than the glutKeyboardFunc callback.
You can read about this in the
glut documentation.
Your program
should be written in C++. You must use the class definitions
defined in the attached .h files. These
include Maze, Room, and Player classes. I have also included a
Makefile that you can use to compile your project.
Your program
should open the window, and should respond to callbacks to service
the mouse button and to automatically redraw the screen if the
display is covered and then uncovered. The program should not quit
until either the 'q' or 'esc' key is pressed on the keyboard.
Advanced
Extension: Provide
a reshape callback that resizes the game without changing its
proportions.
Please submit
your program using the standard handin procedure. You should include your
program source code and a Makefile.