Week 7 — Final Game (Midterm Project)

https://editor.p5js.org/hajar.alk.2007/sketches/

Concept Recap

Now that I’ve finished my game, I just want to restate my concept briefly (which I explained in detail in my Week 6 submission). The original idea started as a candy game, but I decided to make it more traditional and personal by turning it into a Gahwa Rush theme. The inspiration came from my grandpa and my little brother how in our culture, gahwa is always seen as fine for kids while soft drinks aren’t. I found that really funny, so I made the goal of the game to catch the gahwa and avoid the Pepsi. It’s a simple idea, but it means a lot to me because it connects to my family and culture, and I’m really happy with how it turned out.

Week 7 Progress

This week, I was mainly working on the final details to perfect the game. Most of it was already done since last week the whole structure and idea were already there. What I focused on this week was adding sounds to make the game feel more alive and interactive. I also let my friend play it, and I noticed that it was really hard for her, even though for me it felt easy. That’s when I realized I had been increasing the difficulty too much without noticing because I kept testing and improving my own gameplay, so I was getting better while others weren’t. To fix that, I decided to lower the difficulty level to make the game more beginner-friendly and enjoyable for everyone.

I also found a small bug where the player would lose even when the character didn’t actually touch the Pepsi. To fix this, I adjusted the collision detection by making smaller rectangle frames around the Pepsi so that it only counts as a collision when it really touches the character.

Sources/Credit

https://youtu.be/enLvg0VTsAo?si=mPNyWkxCoWeOn3CG

https://youtu.be/bMYQbU01u04?si=KDpfq1w9eC_Bifax

https://youtu.be/Z57hx4ey5RY?si=ruAPhn2WmEeyHKXG

https://youtu.be/MuOcdYjF2F4?si=Z160JD3BE2VQnpvr

Although these YouTube links aren’t the same concept as my game and are actually very different, I used them to help me with the technical parts of creating my game. Since I’m still a beginner at coding, some things especially the math equations were really hard for me to figure out on my own. These videos really helped me understand how to make objects fall, how to make them appear randomly, and how to control different elements in the game. Even though their games had completely different themes, they included similar components that I could learn from, and I applied those ideas to make my own game work.

Code Highlight

const pw = p.w * PLAYER_HIT_SCALE.w;
const ph = p.h * PLAYER_HIT_SCALE.h;
const s  = ITEM_HIT_SCALE[it.kind] || { w: 0.5, h: 0.7 };
const iw = it.w * s.w, ih = it.h * s.h;

return (Math.abs(p.x - it.x) * 2 < (pw + iw)) &&
       (Math.abs(p.y - it.y) * 2 < (ph + ih));

When I was fixing the collision bug, it took me many tries to get it right. Even though I found YouTube videos about collision detection, I still couldn’t really figure it out at first because my game’s sprites and hitboxes didn’t match properly. The player would lose even when the Pepsi was far away. I kept testing and adjusting the numbers, but it wasn’t working. Then I found one YouTube video that explained hitboxes in a really simple way, and it finally made sense to me. That video helped me understand how to scale the hitboxes separately for each object, so I created smaller hitboxes around the Pepsi and the gahwa, and after that, the collisions finally worked perfectly. https://youtu.be/HK_oG_ev8FQ?si=BqtCL3WpHv3UpPQ0

End Of Project Reflection

Overall, I really enjoyed this project I genuinely, genuinely did. I loved developing my idea and adding more to it every single week. It’s crazy to see how much it changed from week 5, when I first thought of it, to how it looks now. It’s such an inspiring project for me because I got to be creative and technical at the same time. I also really enjoyed sharing it with my friends and family; everyone wanted to try it and play.

Even though it was a heavy project that took hours of work and a lot of effort, the result was completely worth it. I felt so accomplished when I finally finished it. It took a lot of trial and error, but that’s honestly what helped me learn the most. This project pushed me to apply everything I learned in class not just follow instructions, but actually take risks, test ideas, and build something real. It also made me go beyond what we learned and look for new solutions from other sources, like YouTube tutorials.

In the end, it was a very in-depth and challenging project, but I truly enjoyed every step of it not just the outcome. I loved the process of testing, debugging, and improving. It was fun, creative, and one of the most rewarding projects I’ve ever done.

There were definitely moments when I found bugs that I just couldn’t fix, and it felt so overwhelming. It was really frustrating because I would go through the code again and again and still couldn’t figure out what was wrong. But I started using the debugging techniques we learned in class, and that really helped me calm down and approach the problem more logically instead of panicking. There were also days when I spent hours trying to fix one thing, and after a while, my brain would just stop functioning. I couldn’t think straight anymore. But whenever I took a break and came back later, it was like my mind was refreshed, I could suddenly see the problem so much more clearly and finally debug it.

At some points, I honestly wanted to delete the whole code and just make a simpler game because I was so frustrated. But I’m really glad I didn’t. Finishing it made me feel so accomplished, and it really boosted my confidence in coding. I kept going even when I wanted to give up, and I pushed myself to find answers and look for external resources when I got stuck. That persistence made me realize that even if something feels impossible at first, I can figure it out if I stay patient and keep trying.

This project definitely required a lot of patience and I think that’s a skill I’m really starting to develop. I realized that when you’re coding, you’re not always going to get it right the first time, and that’s completely okay. There’s nothing wrong with making mistakes or needing multiple tries. Especially when you’re creating a game or something complex, patience is everything. You have to be willing to try again and again, test small changes, and stay calm even when things don’t work right away. This project really taught me that. It helped me understand that patience isn’t just something nice to have it’s one of the most important skills in programming.

Week 6 – Game Progress

 

Project concept

Last week, when I first thought of my game idea, I had almost the same concept as now, but it was originally a candy-themed game. Then I decided to make it closer to home, more customizable, and more traditional. I was trying to think about what should fall from the sky instead of candy, but I really couldn’t come up with anything at first.

Then one day, I was at my grandpa’s house, and I saw him drinking coffee with my little brother. It made me laugh because in our culture, especially in Arab families, they always tell kids not to drink soft drinks, but somehow Gahwa (Arabic coffee) is always allowed, even though it’s full of caffeine! What’s even funnier is that my grandpa used to give my little brother kahwa when he was literally a baby. He could only drink milk, but my grandpa would secretly give him kahwa without my parents knowing. In his mind, kahwa was totally fine, but soft drinks were bad.

That moment gave me the idea to make the game about Gahwa. So now, in my game, the goal is to catch the Gahwa and avoid the Pepsi , if you catch the Pepsi, the game is over. That twist made the game feel really traditional and personal to me.

I also decided to name the characters with Arab names and base them on my younger brother and sister. I really enjoyed that part because it made the game feel more meaningful and connected to my culture. Even though it’s a simple game and my technical experience isn’t that advanced yet, I really love the creative side of it. It feels fun and personal, and that’s what I enjoyed most.

What I am proud of

For my Week 6 submission, what I’m most proud of is that I made this entire game from scratch it’s my first time ever creating a full game, and that alone makes me really proud of myself. I’m also proud of how resourceful I was throughout the process. Even though the YouTube videos I found weren’t the same as my game at all, I still managed to understand their concepts and figure out how to apply them to my own project. I feel like I found really good sources that helped me learn and improve, and it showed me that I’m capable of teaching myself new things and solving problems independently.

I’m also really proud of my concept because it has a story behind it that makes it personal and meaningful. I feel like I did really well in both the creative and technical parts of the project. On the technical side, I worked hard to understand new concepts and used different sources to make my game function the way I wanted. On the creative side, it all came naturally because I was genuinely passionate about the idea. I really enjoyed bringing my story to life through the game, and that made the whole process even more special for me.

Bug

The only thing that’s bothering me about my game right now is that sometimes you lose even when the Pepsi is kind of far from the character. It doesn’t actually touch or collide with the player, but the game still ends as if it did. I think it’s because the data or hitbox isn’t directed properly to the character, so I’m planning to fix that bug. I also haven’t added any sounds yet, but I really want to, I just need to watch some tutorials first to learn how to do it correctly.

Code Highlight

This part of the code is one of the main things we learned in class, and it really became the foundation for my whole project. It basically controls what shows up on the screen depending on which stage of the game you’re in, like the home screen, instructions, character select, gameplay, or game over. This structure made everything so much easier for me because it helped organize my code and made it clear what each part should do. I started with this as my base and then kept building on it, adding more functions and features as I went along. It really helped me understand how to manage different screens in a game.

function draw() {
  background(0);
//conditions for screens 
  if (currentScreen === 'home')       drawHome();
  else if (currentScreen === 'instructions') drawInstructions();
  else if (currentScreen === 'character')    drawCharacterSelect();
  else if (currentScreen === 'game')         drawGame();
  else if (currentScreen === 'gameover')     drawGameOver();

Some Images I Used

Week 5 – Reading Response ( Computer Vision for Artists and Designers: Pedagogic Tools and Techniques for Novice Programmers )

Human vision and computer vision are very different. Humans are born with natural senses that let us see, feel, and understand what’s happening around us without even thinking about it. For example, if I see someone waving at me, I instantly know who they are and what that action means. Computers don’t have this kind of built-in understanding. They need to be given artificial “senses” through cameras and sensors. Instead of just seeing, a computer has to go step by step, detecting pixels, separating the object from the background, and then tracking where it moves. Humans process all of this automatically and with emotion, while computers rely only on data and instructions.

To help computers track what we want, we can use techniques like motion detection, background subtraction, brightness levels, and object tracking. These methods allow the computer to focus on what matters, like spotting movement or identifying a specific shape or color.

Computer vision brings something really exciting to the world of art because it makes art interactive. It allows artists, even those who aren’t very technical, to push their creativity further without as many limits. I find this so beautiful because it opens up new ways to experience and create art.

A great example of this is the Rain Room. In this installation, rain falls inside a dark room, but when someone walks through it, sensors detect their movement and stop the rain wherever they are standing. It feels like you have the power to control the rain. Another example is TeamLab Borderless, where massive digital projections respond to visitors’ movements, creating an ever-changing world of color and light.

What makes this so special is that it gives the audience a role in shaping the art. The original artist creates the setup, but every visitor changes how the piece looks and behaves through their actions. In a way, everyone becomes an artist. The artwork is never exactly the same twice, which makes it even more meaningful. It turns art into a shared, living experience where the line between the creator and the audience disappears.

Week 4 – Loading Data, Displaying text

I speak both Arabic and English, so when I learned that our project had to involve words, I knew I wanted to create something that brought both languages together. My first idea was simple: a program that translates colors typed in English into Arabic and displays them on the screen. At first, I liked it, but I quickly realized it felt too basic. Each time you typed a color, the same thing happened, for the same input you got the same output every single time.

To improve it, I thought to add a quiz that tested you on three random colors each time. This added some variation, but it still didn’t feel interactive enough. I wanted users to not just type answers but to interact with the piece and feel like they were shaping the experience. As I worked on making the program more dynamic, I found a YouTube video that helped me learn how to add randomness and interactivity to my code: https://youtu.be/-6v_AYyn49k?si=Ra0T98ejk4Xkcr-J. From that tutorial, I learned how to make the Arabic words appear in different random positions and sizes and how to create multiple modes so the user can switch between still, bouncing, and floating text. This gave the piece a balance between control and randomness, the user can make choices, but there’s still some sort of randomness. I also used custom fonts from Google Fonts by embedding them directly into my HTML file.

In the final version, I kept my original concept of translating colors, but now the project feels much more alive. The user can explore different modes, play with the experience, and see something new each time. It’s almost as if its art created by the words now. It’s structured enough for the user to have some control, but there’s always randomness, so it’s never exactly the same twice. For me, this connects to Chris Crawford’s ideas about interactivity, where both the user and the program are working together to create something meaningful, rather than the program just showing a static result. It’s no longer just a translation tool, it’s an interactive artwork that bridges both of my languages while letting others engage with it in a fun and personal way.

When I first added Arabic text to my program, it kept printing from left to right, which looked really strange because Arabic is supposed to flow right to left. It took me a couple of tries to figure out why this was happening. Eventually, I realized I needed to set the text direction directly in the code. Once I added a line to force the drawing context to use RTL, the Arabic words finally displayed correctly. It was a small but important fix that made the project look much more natural and readable.

// Draw Arabic word correctly (right to left)
   push();
   drawingContext.direction = 'rtl'; 
   textFont(arabicFont);
   textSize(item.size);
   fill(item.color);
   text(item.word, item.x, item.y);
   pop();
 }

 

Week 3 – Reading Response ( The Art of Interactive Design )

 

I think a strongly interactive system is one that feels like it’s really engaging with you, almost like having a conversation. The author describes interactivity as two sides listening, thinking, and responding, and I see that especially in how responsive a system is. When I was younger, I joined a LEGO robotics competition and built a robot from scratch. At first, it didn’t do anything, but once we added the Arduino parts and coded it, it started moving and reacting to our commands. It felt alive, like it was “listening” to us.

Artificial intelligence takes this even further. I heard about a study where researchers kept breaking a robot’s leg, and instead of shutting down, it figured out a new way to walk. That’s incredibly interactive because it shows learning and adaptation. Even something like Siri or Alexa shows this on a smaller scale, you ask a question, and it responds right away. For me, a truly interactive system listens, adapts, and almost feels like a partner, not just a machine following instructions.

I love how they made something normal we play with everyday interactive.

One idea I have for improving the degree of user interaction in my p5 sketches is adding an AI chat voice, kind of like Siri. Instead of having to leave the sketch and go back to the coding page whenever I have a question or need to fix something, I could just talk to the AI while working on my project. It would feel like we’re coding “together,” where I can ask questions out loud and get instant feedback or suggestions. This would make the process more fun and interactive, and it would keep me focused on creating instead of constantly switching between different pages or tools.

week 2 – patterns

Overview

At first, I wasn’t sure what to create for this project, so I decided to just start by making something simple: dots. My plan was to practice using loops by randomly placing dots on the screen. I used a while loop to create many dots, and once I saw them on the canvas, I realized they looked a lot like stars scattered across a dark night sky.

That gave me the idea to turn my project into a night sky scene. I kept the dots as stars, and then I wanted to make them feel more realistic. To do this, I decided to practice with a for loop to make the stars twinkle. By adjusting their brightness smoothly over time, the stars started to fade in and out, creating a gentle twinkling effect.

In the end, my project isn’t just a pattern of dots, it’s a simple, animated night sky that uses both while and for loops, and I really enjoyed the process of seeing it come to life step by step.

Highlight of code

One part of my code that I really enjoyed working on was where I used the while loop to create all of my stars. At first, I didn’t fully understand how a while loop worked, but through this project, I learned how it keeps running over and over until a certain condition is met.

let count = 0;
  while (count < 500) {  
    stars.push({
      x: random(width),
      y: random(height),
      size: random(1, 3),
      phase: random(TWO_PI) // different twinkle timing
    });
    count++; // increase count each time
  }

I used the while loop to generate 500 stars, each with a random position and size. What I liked about this was how simple it felt to control the number of stars, I just set a limit, and the loop kept creating stars until that limit was reached.

This helped me understand loops better because I could actually see the results on the screen. It also made me realize the difference between a while loop and a for loop. The while loop gave me more control over the setup process, and it was perfect for building the starting starfield for my night sky.

Week 9 – Assignment

Concept:

For this assignment, I decided to create a gender reveal project. I used a red LED and a button to represent “girl,” and a blue LED and button to represent “boy.”

Implementation:

When the red button is pressed, the red LED (representing “girl”) lights up. Similarly, when the blue button is pressed, the blue LED (representing “boy”) turns on.

int yellowLED = 13; // yellow LED
int blueLED = 9;    //  blue LED
int yellowButton = A0; // yellow button 
int blueButton = A2;   // blue button 
void setup() {  
  pinMode(yellowLED, OUTPUT);    
  pinMode(blueLED, OUTPUT);        
  pinMode(yellowButton, INPUT_PULLUP); 
  pinMode(blueButton, INPUT_PULLUP);   
}

void loop() {
  int switchPositionYellow = digitalRead(yellowButton);  
  int switchPositionBlue = digitalRead(blueButton);     

  // Check if both buttons are pressed at the same time
  if (switchPositionYellow == LOW && switchPositionBlue == LOW) {
    digitalWrite(yellowLED, LOW);  
    digitalWrite(blueLED, LOW);     
    delay(500);               

    digitalWrite(yellowLED, HIGH);  
    delay(500);
    digitalWrite(yellowLED, LOW);

    digitalWrite(blueLED, HIGH);    
    delay(500);
    digitalWrite(blueLED, LOW);
  }
  
  // If only the yellow button is pressed
  else if (switchPositionYellow == LOW) { 
    digitalWrite(yellowLED, HIGH);   // Turn ON yellow LED
    digitalWrite(blueLED, LOW);      // Turn OFF blue LED
  }

  // If only the blue button is pressed
  else if (switchPositionBlue == LOW) { 
    digitalWrite(yellowLED, LOW);    // Turn OFF yellow LED
    digitalWrite(blueLED, HIGH);     // Turn ON blue LED
  }

  // If neither button is pressed
  else {
    digitalWrite(yellowLED, LOW);    // Turn OFF both
    digitalWrite(blueLED, LOW);
  }
}

IMG_8148

week13&14 – final project documentation

USER TESTING:
My deliverable was still at a premature stage so I was unable to film a user-testing video, however I was able to get verbal feedback on my p5 program design (and so have adjusted my code accordingly). Initially, I had no text to indicate any sort of instructions or context, as I had thought the arrow buttons were enough to prompt users into action. However, my sister advised against this and suggested I include a phrase or 2 to provide basic information as to what my project is about – even more so since I did not have a start/ introductory screen. Another feedback I got was regarding the separate display screen for when the recommended playlist sounds – which was mentioned in the previous documentation. I was initially just planning to display the user’s chosen personalised cassette however my sister thought it to be too static, commenting that it was lacking flair. I starting brainstorming other potential display screens I could have but the one that resonated most with me was actually animating a rolling cassette tape, of course this would mean I had to create animations for all possible cassette tape designs.

Final project video: https://youtu.be/t_wIKjY5s1o

My final project concept is based off of my midterm project. In the previous midterm, I made a digital radio that played 2 meaningful songs. Each song displayed (what was supposed to be) a dynamic background of a personal memory associated with the songs. My final project builds off on this idea but with an added twist. You are able to customise your own cassette tape and based on your choices, it assembles a recommended playlist. There are 3 choices in each stage of customizing for the personalisation of your cassette and when finished, it plays a recommended playlist of 4 songs, each similar in genre. You can adjust the volume, use a skip function and reset the entire experience through physical means (buttons and potentiometer). Whilst my midterm involved a sense of personal intimacy, I tried to make this project evoke a more shared intimacy. Music is very personal to me and by sharing it with others, I am able to show a partial extension of my own identity which can be reciprocated by external users. Speaking from personal experience, it cements a bond quicker.

//arduino code:

int button1Pin = A2; 
int button2Pin = A3; 
int potentiometerPin = A0;

void setup() {
  // Start serial communication so we can send data
  // over the USB connection to our p5js sketch
  Serial.begin(9600);

  // We'll use the built-in LED as a status output.
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // Read button states and potentiometer value
  int button1State = digitalRead(button1Pin);
  int button2State = digitalRead(button2Pin);
  int potValue = analogRead(potentiometerPin);

  // Send data to p5.js
  Serial.print(button1State);
  Serial.print(",");
  Serial.print(button2State);
  Serial.print(",");
  Serial.println(potValue);

  delay(100); // Adjust delay as needed
}

This final project was so so painstakingly challenging and was such an arduous experience in general it took my soul and a chunk of hair by the time I was finished. Every portion of code had a bug and debugging it took a minimum of 1.5 hours (rarely as I wasn’t so lucky) and a maximum of 7 hours+. I will most likely never forget such an experience. The first portion – p5.js, was doable, yes there were countless debugging that was really frustrating but the cherry on the cake was the second portion – serial communication of the final project. The process of this entire final was tedious overall:

PROCESSES – ART STAGE:
I first created 3 playlists of 4 songs. Then using pinterest inspirations of vintage cassette tapes, I drew each stage: cassette base, cassette sticker, cassette detail using procreate. I illustrated specific combinations of these cassettes to equate to a certain playlist and I drew the details to correspond with the overall music vibe and aesthetic: (see below: 1) result1, 2) result2, 3) result3). As mentioned in my user-testing documentation section,  I wanted to create an animation of the cassette tape rolling when users entered the final stage: music playing. The only plausible way was to create a gif file containing such animation. Because there are 3 choices for each 3 stages and 3 different combinations users could select, it meant I had to create animations for a total of 27 cassettes, hence why it was so time consuming.

PROCESSES – P5.JS:
Essentially both coding experiences were one I do not want to remember… the endless bug fixes, the endless error messages on the console, it was just incredibly stressful. However the code that evoked the most stress and hence, I’m most proud of was attributing the corresponding gif files to every possible indices user could end up with – likewise with creating the cassette animations, there were 27 different combinations. This meant that the program had to store the index chosen at each stage and use this information to call upon a gif file with the corresponding index. This was one of those sections that took 7+ hours to debug and code. I didn’t know where to start and how, so, like I always did with previous assignments, I began researching and looking for codes that fulfilled similar instances on google. Then came the experimentation and checking using console.log. Through this I was able to learn syntax I had never encountered before and this acted as a sort of revelation for me. Here is the relevant code section:

//
const gifFilenameMap = { //attributing gif file pathway to user selected indices
//for cassetteBase[0]
  "0_0_0": "gifs/result1_prpl1.gif",
  "0_0_1": "gifs/result1_prpl2.gif",
  "0_0_2": "gifs/result1_prpl3.gif",
  "0_1_0": "gifs/result1_green1.gif",
  "0_1_1": "gifs/result1_green2.gif",
  "0_1_2": "gifs/result1_green3.gif",
  "0_2_0": "gifs/result1_grey1.gif",
  "0_2_1": "gifs/result1_grey2.gif",
  "0_2_2": "gifs/result1_grey3.gif",

//for cassetteBase[1]
  "1_0_0": "gifs/result2_prpl1.gif",
  "1_0_1": "gifs/result2_prpl2.gif",
  "1_0_2": "gifs/result2_prpl3.gif",
  "1_1_0": "gifs/result2_green1.gif",
  "1_1_1": "gifs/result2_green2.gif",
  "1_1_2": "gifs/result2_green3.gif",
  "1_2_0": "gifs/result2_grey1.gif",
  "1_2_1": "gifs/result2_grey2.gif",
  "1_2_2": "gifs/result2_grey3.gif",

//for cassetteBase[2]
  "2_0_0": "gifs/result3_prpl1.gif",
  "2_0_1": "gifs/result3_prpl2.gif",
  "2_0_2": "gifs/result3_prpl3.gif",
  "2_1_0": "gifs/result3_green1.gif",
  "2_1_1": "gifs/result3_green2.gif",
  "2_1_2": "gifs/result3_green3.gif",
  "2_2_0": "gifs/result3_grey1.gif",
  "2_2_1": "gifs/result3_grey2.gif",
  "2_2_2": "gifs/result3_grey3.gif",
};

//generates gif filename based on indices of selected cassette components
function generateGifFilename(baseIndex, stickerIndex, detailIndex) {
  return gifFilenameMap[`${baseIndex}_${stickerIndex}_${detailIndex}`]; //generating filename using map => e.g., 2_1_0
}

function determineResult() {
...
//generating filename (e.g., "1_2_3") based on indices of selected components
  const gifFilename = generateGifFilename(selectedBaseIndex, selectedStickerIndex, selectedDetailIndex);
  gifElement = createImg(gifFilename, "selectedGif"); // displaying selected gif on canvas
  gifElement.size(imageWidth, imageHeight);
  gifElement.position(imagePosition.x, imagePosition.y);
}

PROCESSES – ARDUINO + SERIAL COMMUNICATION:
Serial communication was one I had the most issues with. I used the existing serial communication code (in mang’s lecture notes) for both arduino and p5.js and altered it around my main piece of code however, problem 1) there seemed to be issues with p5.js and arduino exchanging data, hence it was impossible to know whether the physical wiring of the components on the breadboard was the problem or whether it was the code itself that was causing issues. 2) I continually experienced error messages stating that there was a network error hence I was unable to connect to a serial port. Both cases required patience, calmness and perseverance and through this it was engrained into me again the importance of console logging when debugging faulty code. At the start, I wasn’t able to understand the serial communication code that was provided but after the completion of my final project, everything kind of clicked into place.

Regarding attributing functions to the physical components: 2 push buttons and a potentiometer, I was also having major problems with applying my desired functions: play/pause, skip forward, skip backward, to the push buttons. Mapping the volume to the potentiometer value was really easy as something like it had already been done for the serial communication assignment. For the rest, it was a nightmare. I think it was the structure of the code and the specific manner in which I coded that caused so many breakdowns and errors. In the end I was incredibly short for time and so was forced to compensate and only code 1) resetToInitialState, 2) skip forward on loop. when coding for the function: resetToInitialState, 2 problems occurred: 1) gif image appearing over initial state, 2) sound continuing to play regardless of being set to its initial state. With extensive experimentation, I realised that creating new variables to keep track of the states of both the gif and sound was the most simplest and most rational solution – here is the relevant code:

let gifElement; (ADDED) 

//within function determineResult() 
if (gifElement) { (ADDED) 
  gifElement.remove(); //remove existing gifElement if it exists 
} 

const gifFilename = generateGifFilename(selectedBaseIndex, selectedStickerIndex, selectedDetailIndex); 
gifElement = createImg(gifFilename, "selectedGif"); // displaying selected gif on canvas (ADDED) 
gifElement.size(imageWidth, imageHeight); (ADDED) 
gifElement.position(imagePosition.x, imagePosition.y); (ADDED) 

/////////////////////////////////////////////////////////////////////////////////////
let shouldPlayNextSound = true; //(ADDED) 

//within function playNextSound()
if (shouldPlayNextSound) { //(ADDED)
  currentSoundIndex++; // increment sound index
  if (currentStage === 4 && currentSoundIndex >= result1.length) {
    determineResult();
    currentSoundIndex = 0; //reset to the beginning if end is reached
  }
}

//within function resetToInitialState()
shouldPlayNextSound = false; //disable skip function (ADDED)

//stopping all currently playing sounds
for (let i = 0; i < result1.length; i++) {
result1[i].stop();
}
for (let i = 0; i < result2.length; i++) {
result2[i].stop();
}
for (let i = 0; i < result3.length; i++) {
result3[i].stop();
}
shouldPlayNextSound = true; //enable skip function (ADDED)

FINAL REFLECTIONS + FUTURE IMPROVEMENTS:
Whilst it was the most nerve wrecking, anxiety inducing overall experience, since persisting bugs were fixed the day of the IM show, I was quite proud of what I have completed. Whilst the coding aspect of this project was beyond challenging, I can’t deny that it was lowkey fun at the same time – creating a project that involves my passion. To me, it certainly felt like a large leap in the level of difficulty, compared to my midterm project, and this was more so why I am proud of the finished result. For future improvements on the project, perhaps there could be a personality test which based on your selected answers allocates you to a specific design for each stage of the cassette customisation. This way the experience maintains for longer. I also think it builds more excitement and anticipation as to what cassette you’ll end up with. Improvements for the physical aspect of the project would be to build a radio with more extensive functions, like originally planned.

Regarding improvements for future IM projects, I am incredibly motivated to put thought into the building of an exterior because that, at the end of the day, is what can elevate user experience. Since it was my first time both showcasing and attending an IM show, I experienced somewhat of an epiphanous moment. In future classes I will be more mindful in creating a more immersive user experience that is able to appeal to a wider body of people, because whilst mine did have some sort of user experience, it was more so stagnant with limited interaction compared to the other projects that were showcased. Overall I think it was an excellent opportunity to understand the fundamentals of what Interactive Media embodies and it has further propelled my motivation to learn in depth creative coding.

week 11&12 – (final project) preliminary concept | idea finalization | user testing

PRELIMINARY CONCEPT:
I wanted to do some brainstorming regarding the concept of my final project. I wanted to do something that wasn’t too ambitious (considering the myriad of deadlines as a result of finals week and the limited time constraints). I think because I couldn’t think of a theme, ideas were very vast which didn’t help. After some major considerations and scrapping of multiple ideas, I came to the conclusion that I would want to build off on my midterm project to create a physical radio that is controllable through i.e., buttons, potentiometer, power switch. Output would be digital and input would be both digital and physical.

FINALIZED CONCEPT:
I thought creating a purely physical radio with a digital output would not be enough interactivity or at least a meaningful interaction, hence I wanted to perpetuate intimacy. I love music and (to me) what is more intimate than sharing your favourite playlists/ artists with others? I decided to make my final project a 2-part: 1) determine corresponding mood/ personality through personalizing their own cassette tape, 2) according to results, a playlist of 4 songs would be curated – this way there is more intimate and meaningful back and forth. Essentially it would work like those buzzfeed quizzes except physical input via push buttons are possible.

Total physical components would include 3 push buttons and a potentiometer for volume control. My arduino program will read the potentiometer value and buttons’/switch’s state and send the information to p5.js via serial communication. When p5.js receives information about the button’s push state, it will call upon its corresponding function, i.e., pause/play, skip forward/ backward. I will use the mapping function to map the potentiometer value to the volume so that whenever the potentiometer is toggled, p5.js will continuously receive its p value and adjust the volume accordingly. With regards to my p5 program design, I intend to have a cassette displayed in the middle with “select” and arrows buttons. Since users will select designs for each of the 3 stages, the “select” button will store user choices in a separate variable so as to assign a “result1/2/3” playlist. Although undecided, I intend to have a separate display screen for when the recommended playlist sounds to indicate the change of focus from p5 to the actual physical components.

User Testing

Before completing the project, I did some user testing with a small sample of participants. Here is a video of Zion using my project:

User testing stage gave me valuable insight that was difficult to see from my perspective as the creator of the project. Here are the tips that I implemented in the final version:

  • Specifying how many stages (color inputs) there will be, helps the participant to understand the structure of the experience from the start.
  • Starting the instructions by saying what is the main thing that will be required (color input based on prompts).
  • Introducing an additional screen in between the last color input and generated gradient to build some suspension.

Are they able to figure it out? Where do they get confused and why? Do they understand the mapping between the controls and what happens in the experience?

– Everyone was able to figure it out, sometimes there would be a little confusion in the beginning due to multiple potentiometers though.

What parts of the experience are working well? What areas could be improved?

– The generative gradient tends to produce a pleasant reaction, so I would say that works well. The button perhaps is the one that is not too reliable.

What parts of your project did you feel the need to explain? How could you make these areas more clear to someone that is experiencing your project for the first time?

-I would often receive questions as to how many stages there will be in total, therefore I decided to add this information to the instructions page.