Week 5: CST 205: Text Adventure Game

This week, our team worked together to design and implement a text adventure game. Because we all have varying skill levels in programming and programming with Python in particular, pair programming was essential to the development process. We also heavily relied on GitHub for collaboration and version control.

It was easy to see how feature creep could quickly become problematic, as we continuously were juggling different ideas for this seemingly simple text adventure game.  However, the creation process and collaboration was fun and invaluable and I truly enjoyed this assignment.

Try our game below!

You can find the source code to our game on GitHub!

CST 205: Week 4 Audio Manipulation

This week we started learning about audio manipulation with JES. I learned that audio is recorded using different sample rates (samples per second) and with different bit depths (bits per sample). The bit depth of an audio file determines how many unique values a single sample can have. A sample’s value corresponds to amplitude (how quiet or loud it is). It is the change in a sample’s value over discrete time steps that determines a sound wave’s frequency (how high or low the pitch).

Ultimately, we applied what we learned about sound manipulation to create our own unique sound collages. I was selected to create a demo video on my approach and it can be seen below:

I decided I wanted to blend two of my samples together, so that I could have background music throughout my sound collage. It was not part of the assignment, but it was fun figuring it out.

After our brief section on audio manipulation, we were tasked to create a hangman game with a partner. It was fun figuring out all the error handling to redirect a player who may have entered unexpected input. It was satisfying creating a working copy of this simple game and I am excited to work with my team on our upcoming text-based adventure game!

Last, out midterm project was due this week. We had to create two filters: a CSUMB-themed filter, which we created last week, and one of our choice. Cody (my team partner) and I decided to create an effect that would make a photo appear like a bad VHS recording. While we didn’t get to include all the features we originally had hoped for (pixel shifting and color bleeding), I’m pretty satisfied with the results:

Unaltered Paramount logo

Paramount logo with our VHS effect applied

CST 205 Week 3 Midterm Update

We’re already planning a midterm project! This week, we worked on Lab 7 with a pair programming partner to create a design for a Thanksgiving card. I had the idea to create a scene with face cut-outs. After utilizing a similar algorithm to our chromakey procedure to get the photos drawn in the right place, we added functions that would scale the face photos up or down to fit the face cut-outs. After slapping on some text to wish our audience a happy Thanksgiving, it was done!

Thanksgiving card

I had a lot of fun with this project because we got to utilize everything we have learned about image manipulation until now. I also spent a fair amount of time refactoring the code to make it more readable and generalizable. It was a lot of fun.

We are doing peer and self evaluations right now as well. Peer evaluations will involve code checks, where we go through and analyze one another’s code in terms of naming conventions (functions and variables are well named), functionality (everything compiles and executes in the expected manner), and use of abstraction (breaking down complex problems into smaller easier to understand problems). It should be a great learning experience.

I am excited about the midterm project because we get to create our own filters. I have already completed the CSUMB filter. I found out how to programmatically create a gradient of two colors and to blend the colors of two source photos together (you take the average of reds, greens, blues, and use those averages to create a new color). I also added on a pixelated version of CSUMB’s mascot, an otter!

Gradient of CSUMB’s school colors

A photo of me CSUMB-ified

Week 2 of CST 205: Manipulating Pixels

Lab Reflection

This week we used loops and control statements to manipulate images.

Lab 4

In this independent lab, we created a variety of mirroring functions by iterating through the pixels of part of an image and copying the colors of those pixels to another part of an image. Here are some examples:

Original image of Mui, my whitefaced cockatiel.

Vertical mirror, left to right

Vertical mirror, right to left

Horizontal mirror, top to bottom

Horizontal mirror, bottom to top

Quadruple mirroring, using right to left and top to bottom mirroring

Lab 5

This was another independent lab. In this lab, we learned how to create a blank Picture object and to copy pixels from other pictures on to it. This enabled us to copy multiple pictures on to a large empty canvas, creating a collage. My approach was to iterate through a list of pictures and to apply random effects to each picture before it got copied on to the blank canvas. I also added my name to the bottom using the addTextWithStyle JES function. Here is one of the results:


In this pair programming lab, my teammates and I developed functions to manipulate pictures based on the color values of pixels. In the warmup problem, we had to implement red eye correction. Essentially, we had to detect pixels that were within some range of red (using a distance function) and to change those pixels’ color values to something that looked more natural (we chose black). Below is the before and after:

Photo before redeye correction

Photo after redeye correction


We then developed a function that created a sepia effect. This was done by first converting the photo to grayscale (when each value of red, green, and blue are essentially equivalent or close to being equivalent). Then, based on each pixel’s red amplitude, we modified the amount of red and blue. This created the sepia effect:

Original photo of salmon roe rice bowl

Sepia effect


We also created a function that created a fun posterizing, cartoony effect. This was a lot like the sepia function, in that the amount by which we changed the color of a pixel depended on the original color value. However in this case, we modified each color (red, green, and blue) based on the previous values of red, green, and blue. Here is the effect:

Original photo of bike

“Artified” version of bike

Last, we developed a chroma key function to add a background on to a green screen photo. Essentially, we had to detect the degree to which each pixel’s color matched the green color we expect the green screen to be. If it matched within a reasonable range, we copied the colors of the background photo (the volcano picture in the example) on to the green pixels of the green screen photo (the photo of Shia LeBeouf in this example):

Shia LaBeouf in front of a green screen


Shia defeating the volcano