Advanced Graphics, 2D rendering homework

Basic assignment

For this homework assignment, we will be implementing the 2D rendering functions of a simple game.

You will need to download this game project: Bejeweled.zip (updated 1/16). In it you will find a file called "Homework.cpp" with three drawing functions whose bodies are empty.

The assignment is to correctly implement those functions:

Submitting

You must send to JCAB your completed Homework.cpp file according to the instructions.

Extra grade

Extra grade will help you compensate your grade if you don't manage to successfully complete one or more basic assignments.

For extra grade, you can add some meaningful 2D graphics to your game project, rendered in a manner similar to the basic assignment.

There are several possible things you may want to draw. One possible suggestion is a health bar or scoring element of some kind.

Another posibility is adding a simple minimap to your game project. Following are suggestions on how to design such a minimap:

One example of what this might look like:

Capture of the minimap in action

Two possible strategies for implementing the minimap are:

Circular geometry, animating the texture coordinates

Make a fan of triangles arranged in a circular shape. Each vertex will have texture coordinates according to what part of the map should be visible at its location.

Single quad rendered with a texture mask

Instead of using a triangle fan to represent the circle, you could render the map as a simple sprite, centered on and rotated around the player position. You can then use a second texture's alpha channel to "cut out" the part of the minimap that we want visible. This mask texture would contain a circular shape in its alpha channel, and would be sampled with a second set of texture coordinates.

Submitting

You must send to JCAB your entire game project according to the instructions. You should use the CleanBeforeZipping.bat file instead of the one Dan Chang provided, because I also require that you don't deliver the generated directories (Debug, Release, etc.)

[an error occurred while processing this directive]

Solution available

Basic assignment: download here.

Extra credit: download here. Or access subversion repository: http://uw.thejcab.com/UWGame2011/

The meat of the extra credit solution is in the new source file, Minimap.cpp. Examine the file as it's commented to explain what it's doing.