During this project, I had difficulties in several different areas. The most notable
is collision detection. Without proper collision detection, punches by the player and the
computer enemies could appear to hit, and not register. If the collision detection is not
consistent, the user will have a difficult time playing the game. While not as much of a
problem, characters can walk through each other without proper collision detection.
Because of the 3D nature of the characters, I needed to take into account the X
and Z axis. I left the Y axis out to simplify the process. I believed that I had adequate
detection of punches, but this did not turn out to be the case. In order to prevent the
program from behaving worse, I was forced to pull the collision detection code out. This
was only done after an extended period of testing, when I felt that I needed to concentrate
on other aspects of the program. After all, it would be better to have something less
impressive, than to have something that didnt work at all.
Related to the collision detection problem is the one of timing. For example, a
character that is hit needs to be stunned for a moment. Since I am not familiar with
threads in C++, I avoided that route. Instead, I used a for loop, along with the idle
functionality that GLUT provides. When the user presses a key, the players characters
information is updated, and the screen is redrawn. When there is no key entered, the idle
function takes over, computes the enemies information, and redraws the screen. Threads
probably would have greatly impacted this program.
Another area of difficulty was creating the character models. I learned that I am
not very familiar with how the human body should appear. Since this program is for a
computer graphics course, I knew that a simple cube would not do for the characters. I
determined that the simplest figure that would be acceptable would have a head, torso,
arms, elbows, fists, legs, and feet. As with collision detection, I spent much longer on
this than I should have, and removed the fists. Texture mapping the faces saved me some
time.
Previous page
Next page