assignment 4

Maze Game

FINISHED PROJECT

Link to code

Including textured walls and floors, unique doors and keys, animated doors opening, jumping, and video.

keys & doors

Artistic screenshot. Extra credit & art contest.

Holding all keys. Gold piece is end of level.

Key and matching door.

Door unlocked.

Game screenshot.

Keys

Game screenshot.

***************

Game Instructions:

Up/down/left/right - Move.

Complete the level by obtaining the golden piece.

n - Go to next level.

r - Reset the current level.

j - Jump.

To unlock doors, find the corresponding key.

q - Quit.

***************

maze.mov

Arrow keys to move. j to jump. If you are under a door, you cannot jump. After landing, you have to wait a few seconds to jump again. Jumping and moving works by time elapsed, not by how many frames per second. The video gameplay isn't smooth because I had to have the screen recorder running as well as the game.

Link to video

The numLevels.txt file has two numbers. The first is how many levels there are, the second is what level to start at, which was useful for debugging file loading and key-door interaction. In the levels folder I included directions for how to add levels by adding more .txt files.

I started with Guy's multiobject.cpp file and slowly started adding my own code. This was my first time coding with OpenGL and SDL, so it was sort of a challenge to figure out the function calls and order. I don't totally understand how every part of OpenGL and shaders work, but I feel comfortable moving models around, transforming them, and applying textures, which was the bulk of making this game. I had some trouble with having the correct key unlock the correct door, but I realized I made a logic error about order keys were added to the key vector. My solution was to loop through all keys until the matching texture id was found, and see if that key was picked up and unused. It took me a little bit to understand the collision algorithm. I'm sure there are better ways to do it, but since my current mazes work off a 2D grid model, the collision code of checking nearby points is good enough.

This was a fun assignment!