Maze-Running Program: Pac-Man Game
Project Overview

1. Maze Rendering Algorithm

* The images displayed below is resized and may not displayed properly *
Please click on it to view the actual image

1.1 Rendering

The Maze Rendering is handled by the drawCell function,
which recursively loops through each cell in the player's viewing frustrum,
starting with the cell that the player is currently occupying. As it goes
through each cell, the function checks each of the surrounding four walls of
the cell to see whether they are transparent (ie, the wall doesn't exist) or
opaque. In the case that the wall is opaque, the function then calls the
drawWall function, which then handles drawing the wall onto the buffer
(also makes calculations for shadows and texture maps). In the case that the
wall is transparent, the drawCell function calls itself on the cell lying beyond
the transparent wall and gives it a frustrum that is clipped to the that wall.
The drawWall function returns once all the walls (and objects) in the frustrum
passed to it is drawn to the buffer.

Different positions in the Maze
Click to Enlarge










To check the source code and try to run on your machine
please email us and is availble upon request
Download Source Code


Copyright © 2003, Tony Shih & Angela Lee
Revised: May 11, 2003
URL: http://inst.eecs.berkeley.edu/~cs184-go/index.html