Final Project: Soulmate Showdown

Soulmate Showdown – Savanna Peng – Andy Garcia 

 

Conception & Design

The concept of my project revolves around the idea and inspiration of gameshows aired on TV. My initial vision for this project was not to design it in this way, but to make it a fun, lighthearted activity. After speaking with Andy, he recommended that I take inspiration from the idea of gameshows, making my project more dramatic, engaging, and emotional. I then went on to research more about what environments gameshows create visually, audibly, and emotionally. I realized that gameshows hold simple props, like buttons and LED screens, and the “drama” mainly stems from the surrounding characteristics, like the lighting, music, and point system/competitiveness. Due to the results of my research and my understanding of how users will interact with my project, I decided to keep my hardware designs simple, with only two sets of buttons, and keep all of the intricate designs to be displayed on the screen. During User Testing, I received positive feedback about how the game is heartwarming, easy to understand, and engaging. Some suggestions I received that influenced my design afterward were to make the game longer, change the original length of five questions to ten questions, add music, clarify the rules and relationship status choice pages, and cover the buttons so the partners could not see each other’s responses. These additions improved my project by clarifying the game, increasing the users’ interactions with my project and with each other, and making the results more enjoyable and effective. 

Fabrication & Production

First, I acquired four big game buttons, two red and two blues, for the two choices that the partners can choose from. Keeping in mind the initial objective and idea for this project, I wanted to use big game buttons that replicated gameshow buttons, especially after putting them into their customized button stands/holders. I then measured the buttons’ measurements and designed the boxes to hold them and for laser cutting. I downloaded a template of a box and uploaded it to Cuttle to adjust the measurements, add two holes per box to hold the buttons and label the buttons A and B. When designing these boxes, I wished that I was more careful with the designs and measurements as I did not count for the laser cutting machine’s mistakes in measurements. I also forgot to cut out a hole in the back of the box for the wires to go through, which I was fortunate enough to have been able to cut out later even after I glued the box together. I then soldered the wires to the four buttons and built the circuit, put them together with the boxes, and began coding the game. One thing I did that helped a lot throughout the wiring and rewiring process was labeling my wires with masking tape with what button or LED it corresponds to and which pin it should be in. 

 

 

The code was very difficult to put together and I received lots of help from friends, fellows, and professors, as most of my programming happened on Processing, which I am not as familiar with compared to Arduino since we’ve been using that for longer. The general logic of the code, inspired by the code from my midterm project, is separated into various stages: stage 0 is the title page/introduction, rules, and relationship status choices; after choosing what relationship status the two partners are, the game will be directed to one of the four cases; case 1 is for friends, case 2 is for romantic partners, case 3 is for professional peers, and case 4 is for complicated relationships that don’t quite have a label; after all ten questions are answered, the game will jump to stage 5, the final stage, where the program will calculate how many questions partners 1 and 2 answered the same and provide a Soulmate Score, ranking from lowest to highest, 1-5. It was quite tricky working with the images, buttons, and many stages as the buttons would send signals from Arduino to Processing very fast, and there were nearly 60 images and six stages in total. 

Finally, after many, many times of trial and error and asking for help from professionals, the code ran smoothly and the game was pretty fun to play with. I added some finishing touches to better adhere to my initial goal of making this seem like a gameshow and dramatizing the entire project. I created two cardboard covers/booths to cover up the two partners’ buttons, preventing the players from seeing what the other player chooses. I also taped all of the wires together while putting all the extra wires, Arduino, and breadboard into a cardboard box that would also act as a laptop stand, so that everything looked neat and pleasing to the eye. Lastly, I searched for some gameshow music and sound effects to play in the background. Throughout the entire game, the background song that loops is “The Game Show Theme Music” by Waderman – Royalty Free Music, and at the final stage where the score is revealed, the sound effect is called “Audience Clapping Sound Effects (no copyright)” by Renante Tabas (both found on Youtube). 

Conclusions

The goal of this project was to create a lighthearted game to bring people closer to one another, no matter what the relationship is between them. I believe that my project is almost there in achieving this goal. One of the pieces of advice that I received from my presentation is to have a final reveal of both partners’ answers alongside a copy of the questions, which I think is a great idea so that the partners can have a further discussion afterward and discover more about each other. Unfortunately, I did not have enough time to add this feature and was also a bit scared to mess up the code which took professors very long to debug. If given the chance, I would reveal the answers of the partners after every question on the screen or create a sort of receipt printer that prints out the questions along with both partners’ choices to give to the players. 

Luckily, my expectations match with how the users actually interacted with my project as my project was pretty direct in interactions. My project results align with my definition of interaction as users are sending a signal from their buttons to the computer and receiving signals back, with an additional benefit of interaction and communication between the two players. From the setbacks and challenges that I faced while building this project, I learned that patience is ultimately the biggest contributor to any project, especially IMA-related projects, as there are so many bugs and tiny things that seem minimal but ultimately affect the entire project. I had lots of fun creating this project as this is a topic that I am interested in and I see that my users have been very intrigued with the game as well. After the project had been built and successfully interacted with by others, it felt rewarding and a bit heartwarming to see the code run smoothly and the laughter and discussions that arose between the players. 

Final Arduino code:

const int buttonPin1 = 2;  // button 1
const int buttonPin2 = 6;  // button 2
const int buttonPin3 = 3;  // button 3
const int buttonPin4 = 4;  // button 4
const int ledPin1 = 13;    // led 1
const int ledPin2 = 12;    // led 2
const int ledPin3 = 11;    // led 3
const int ledPin4 = 9;    // led 4
int buttonState1;          // variable for reading the pushbutton status
int buttonState2;          // variable for reading the pushbutton status
int buttonState3;          // variable for reading the pushbutton status
int buttonState4;          // variable for reading the pushbutton status

int prebuttonState1;
int prebuttonState2;
int prebuttonState3;
int prebuttonState4;

int count = -2;
bool count_recorded = false;

void setup() {
  Serial.begin(9600);
  // initialize the LED pin as an output:
  pinMode(ledPin1, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin1, INPUT_PULLUP);  //PULLUP to get rid of 10k resistor
  // initialize the LED pin as an output:
  pinMode(ledPin2, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin2, INPUT_PULLUP);  //PULLUP to get rid of 10k resistor
    // initialize the LED pin as an output:
  pinMode(ledPin3, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin3, INPUT_PULLUP);  //PULLUP to get rid of 10k resistor
  // initialize the LED pin as an output:
  pinMode(ledPin4, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin4, INPUT_PULLUP);  //PULLUP to get rid of 10k resistor
}

void loop() {
  // read the state of the pushbutton value:
  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3);
  buttonState4 = digitalRead(buttonPin4);

if (buttonState1 == HIGH && prebuttonState1 == LOW) {
    // turn LED on:
    digitalWrite(ledPin1, LOW);
    count += 1;
    prebuttonState1 = HIGH;

  } else if (buttonState1 == LOW) {
    // turn LED off:
    digitalWrite(ledPin1, HIGH);
    prebuttonState1 = LOW;
  }
  if (buttonState2 == HIGH && prebuttonState2 == LOW) {
    // turn LED on:
    digitalWrite(ledPin2, LOW);
    count += 1;
    prebuttonState2 = HIGH;
  } else if (buttonState2 == LOW) {
    // turn LED off:
    digitalWrite(ledPin2, HIGH);
    prebuttonState2 = LOW;
  }
  if (buttonState3 == HIGH && prebuttonState3 == LOW) {
    // turn LED on:
    digitalWrite(ledPin3, LOW);
    count += 1;
    prebuttonState3 = HIGH;
  } else if (buttonState3 == LOW) {
    // turn LED off:
    digitalWrite(ledPin3, HIGH);
    prebuttonState3 = LOW;
  }
  if (buttonState4 == HIGH && prebuttonState4 == LOW) {
    // turn LED on:
    digitalWrite(ledPin4, LOW);
    count += 1;
    prebuttonState4 = HIGH;
  } else if (buttonState4 == LOW) {
    // turn LED off:
    digitalWrite(ledPin4, HIGH);
    prebuttonState4 = LOW;
  }

  Serial.print(buttonState1);
  Serial.print(",");  // put comma between sensor values
  Serial.print(buttonState2);
  Serial.print(",");  // put comma between sensor values
  Serial.print(buttonState3);
  Serial.print(",");  // put comma between sensor values
  Serial.print(buttonState4);
  Serial.println();

  delay(10);
} 

Final Processing code:

import processing.sound.*;
// declare a SoundFile object
SoundFile sound1;
SoundFile sound2;

import processing.serial.*;

Serial serialPort;

int NUM_OF_VALUES_FROM_ARDUINO = 4;  /* CHANGE THIS ACCORDING TO YOUR PROJECT */

/* This array stores values from Arduino */
int arduino_values[] = new int[NUM_OF_VALUES_FROM_ARDUINO];

int imageNum = 0;
int stage;
String fileName;

PImage[] images = new PImage[70];
PImage tImage;
int p1 = 0;
int p2 = 0;

int prev0;
int prev1;
int prev2;
int prev3;

int counter = 0;

int frameCounter = 0;

void setup() {
  size(1440, 900);

  // create the instance, load its data from a file
  sound1 = new SoundFile(this, "Gameshow.mp3");
  // play the sound on loop
  sound1.loop();
  sound2 = new SoundFile(this, "Clap.mp3");

  printArray(Serial.list());
  // put the name of the serial port your Arduino is connected
  // to in the line below - this should be the same as you're
  // using in the "Port" menu in the Arduino IDE
  serialPort = new Serial(this, "/dev/cu.usbmodem14201", 9600);

  for (int i = 0; i < images.length; i ++) {
    int j = i + 1;
    fileName = j + ".png";
    println(fileName);
    tImage = loadImage(fileName);
    images[i] = tImage;
  }

  prev0=1;
  prev1=1;
  prev2=1;
  prev3=1;
  //fullScreen();  // Make the sketch go full screen
}

void draw() { //stage 0
  getSerialData();
  //println("STAGE:", stage, "COUNTER:", counter);
  image(images[imageNum], 0, 0, 1440, 900);
  switch(stage) {
  case 0:
    //if (arduino_values[0] == 1 && prev == 0) {
    //  prev0 = 1;
    //}
    if (imageNum == 2) {
      if (arduino_values[0] == 0 && prev0 == 1) {
        imageNum = 3;
        stage = 1;
        imageNum++;
        prev0 = arduino_values[0];
      } else if (arduino_values[1] == 0 && prev1 == 1) {
        imageNum = 14;
        stage = 2;
        imageNum++;
        prev1 = arduino_values[1];
      } else if (arduino_values[2] == 0 & prev2 == 1) {
        imageNum = 25;
        stage = 3;
        imageNum++;
        prev2 = arduino_values[2];
      } else if (arduino_values[3] == 0 && prev3== 1) {
        imageNum = 36;
        stage = 4;
        imageNum++;
        prev3 = arduino_values[3];
      }
      prev0 = arduino_values[0];
      prev1 = arduino_values[1];
      prev2 = arduino_values[2];
      prev3 = arduino_values[3];
    } else {
      if (arduino_values[0] == 0 && prev0 == 1) {
        imageNum++;
      }
      prev0 = arduino_values[0];
    }
    break;

  case 1:
    if (p1 == 0 && arduino_values[0] == 0 && prev0 == 1) {
      p1 = 1;
      prev0 = arduino_values[0];
    }
    if (p1 == 0 && arduino_values[1] == 0 && prev1 == 1) {
      p1 = 2;
      prev1 = arduino_values[1];
    }
    if (p2 == 0 && arduino_values[2] == 0 && prev2 == 1) {
      p2 = 1;
      prev2 = arduino_values[2];
    }
    if (p2 == 0 && arduino_values[3] == 0 && prev3 == 1) {
      p2 = 2;
      prev3 = arduino_values[3];
    }

    prev0 = arduino_values[0];
    prev1 = arduino_values[1];
    prev2 = arduino_values[2];
    prev3 = arduino_values[3];

    if (p1 == p2 && p1 != 0) {
      counter++;
      imageNum++;
      delay(500);
      if (imageNum == 13) {
        stage = 5;
        imageNum = 47;
        sound1.stop();
        sound2.play();
      }
      p1 = 0;
      p2 = 0;
    }
    if (p1 != p2 && p1 != 0 && p2 != 0) {
      imageNum++;
      delay(500);
      if (imageNum == 13) {
        stage = 5;
        imageNum = 47;
      }
      p1 = 0;
      p2 = 0;
    }
    break;

  case 2:
    if (p1 == 0 && arduino_values[0] == 0 && prev0 == 1) {
      p1 = 1;
      prev0 = arduino_values[0];
    }
    if (p1 == 0 && arduino_values[1] == 0 && prev1 == 1) {
      p1 = 2;
      prev1 = arduino_values[1];
    }
    if (p2 == 0 && arduino_values[2] == 0 && prev2 == 1) {
      p2 = 1;
      prev2 = arduino_values[2];
    }
    if (p2 == 0 && arduino_values[3] == 0 && prev3 == 1) {
      p2 = 2;
      prev3 = arduino_values[3];
    }

    prev0 = arduino_values[0];
    prev1 = arduino_values[1];
    prev2 = arduino_values[2];
    prev3 = arduino_values[3];
    if (p1 == p2 && p1 != 0) {
      counter++;
      imageNum++;
      delay(500);
      if (imageNum == 24) {
        stage = 5;
        imageNum = 47;
      }
      p1 = 0;
      p2 = 0;
    }
    if (p1 != p2 && p1 != 0 && p2 != 0) {
      imageNum++;
      delay(500);
      if (imageNum == 24) {
        stage = 5;
        imageNum = 47;
      }
      p1 = 0;
      p2 = 0;
    }
    break;

  case 3:
    if (p1 == 0 && arduino_values[0] == 0 && prev0 == 1) {
      p1 = 1;
      prev0 = arduino_values[0];
    }
    if (p1 == 0 && arduino_values[1] == 0 && prev1 == 1) {
      p1 = 2;
      prev1 = arduino_values[1];
    }
    if (p2 == 0 && arduino_values[2] == 0 && prev2 == 1) {
      p2 = 1;
      prev2 = arduino_values[2];
    }
    if (p2 == 0 && arduino_values[3] == 0 && prev3 == 1) {
      p2 = 2;
      prev3 = arduino_values[3];
    }

    prev0 = arduino_values[0];
    prev1 = arduino_values[1];
    prev2 = arduino_values[2];
    prev3 = arduino_values[3];
    if (p1 == p2 && p1 != 0) {
      counter++;
      imageNum++;
      delay(500);
      if (imageNum == 35) {
        stage = 5;
        imageNum = 47;
      }
      p1 = 0;
      p2 = 0;
    }

    if (p1 != p2 && p1 != 0 && p2 != 0) {
      imageNum++;
      delay(500);
      if (imageNum == 35) {
        stage = 5;
        imageNum = 47;
      }
      p1 = 0;
      p2 = 0;
    }
    break;

  case 4:
    if (p1 == 0 && arduino_values[0] == 0 && prev0 == 1) {
      p1 = 1;
      prev0 = arduino_values[0];
    }
    if (p1 == 0 && arduino_values[1] == 0 && prev1 == 1) {
      p1 = 2;
      prev1 = arduino_values[1];
    }
    if (p2 == 0 && arduino_values[2] == 0 && prev2 == 1) {
      p2 = 1;
      prev2 = arduino_values[2];
    }
    if (p2 == 0 && arduino_values[3] == 0 && prev3 == 1) {
      p2 = 2;
      prev3 = arduino_values[3];
    }
    prev0 = arduino_values[0];
    prev1 = arduino_values[1];
    prev2 = arduino_values[2];
    prev3 = arduino_values[3];
    if (p1 == p2 && p1 != 0) {
      counter++;
      imageNum++;
      delay(500);
      if (imageNum == 46) {
        stage = 5;
        imageNum = 47;
      }
      p1 = 0;
      p2 = 0;
    }
    if (p1 != p2 && p1 != 0 && p2 != 0) {
      imageNum++;
      delay(500);
      if (imageNum == 46) {
        stage = 5;
        imageNum = 47;
      }
      p1 = 0;
      p2 = 0;
    }
    break;

  case 5:
    frameCounter = (frameCounter + 1) % 60;

    if (frameCounter == 1) {
      imageNum++;
    }

    if (imageNum == 56) {
      imageNum = 56 + counter / 2;
      if (sound1.isPlaying() == true) {
        sound1.stop();
        sound2.play();
      }
      stage = 6;
    }
  }
  image(images[imageNum], 0, 0, 1440, 900);
}

void getSerialData() {
  while (serialPort.available() > 0) {
    String in = serialPort.readStringUntil( 10 );  // 10 = '\n'  Linefeed in ASCII
    if (in != null) {
      print("From Arduino: " + in);
      String[] serialInArray = split(trim(in), ",");
      if (serialInArray.length == NUM_OF_VALUES_FROM_ARDUINO) {
        for (int i=0; i<serialInArray.length; i++) {
          arduino_values[i] = int(serialInArray[i]);
        }
      }
    }
  }
}

Disassembly

Midterm Project: The Tree of Fate

The Tree of Fate – Savanna Peng – Andy Garcia 

 

Context & Significance

Comparing our project to one of the other interaction projects that I have researched previously in this class, I can draw connections between our user-testing version of the project and the glass door that has a pull handle but is supposed to be pushed. From the user testing session, many of our players didn’t understand to pluck the flowers instead of catching the flowers when they fell. This relates to the misleading door handle as both send mixed signals to the audience which can direct them to respond to the project in a way that they aren’t supposed to. The parallel between these two design errors triggered my understanding of interaction in a deeper way as I now understand how interaction can be straightforward to the designers but not the audience, and that the goal of interaction is to be able to deliver the correct message to the player in the most simple and effective form. 

One thing that marks our project apart from the others we saw in class is that it is one of the few interaction art pieces, instead of interaction games, and that also portrays a message behind it. Taking inspiration from Sylvia Plath’s famous passage about a fig tree, our project delivers a message to not be greedy when making decisions in life and to make swift decisions before they all slip away. Though these interactive art pieces did not exist previously, our take on this project’s inspiration, the fig tree passage, was to simplify the numerous fate choices into just five choices and to showcase them as flowers instead of figs. We made these decisions to simplify the interaction process, and because we thought that this would match our standards of aesthetics better. In the development process of this project, my contributions were on the technical side: coding and wiring. The intended audience of this project could be Sylvia Plath fans/readers as it is a physical project of a metaphor that she includes in her writings, or just anyone who finds this project visually appealing. 

Conception & Design

My understanding of how the users were going to choose their fate was by simply pulling the flowers off the board, hence why we made the flower stems longer to stick out of the board and also included the word “pluck” in the instructions. I also wanted a “formal” way to begin the interaction and my understanding of how my users would react to a button fit this criteria the best, in comparison to any other reaction-documenting mechanism, like a slider. One major change that we enacted after beginning to build this project was changing the tree from 3D to 2D. At first, we wished to build a 3D model of the tree with cardboard and wooden dowels. However, after receiving feedback and further consideration of where the wires would go and how stable this tree would be, we decided to make this tree on a board/front of a box and hide all the wires behind the board within the box. 

Original sketchInitial production of a 3D treeRevision to a 2D tree board

The first form we decided to use was electromagnetic sensors when brainstorming this project because its ons and offs are easy to control with code while also the flower on top can be “forcefully” pulled off even when the magnet is still on. Next, we decided to add LEDs behind every flower to make the five flower choices stand out more and act as a visual guide of whether or not the choices are still available. We decided to use tissue paper to make the flower petals as it is light, pretty, and thin, allowing the LEDs to shine through. We initially wanted to use the bottom of plastic bottles for the flower petals as it is clear and already resemble the shape of a flower. However, we opted for tissue paper because we considered that plastic might be too heavy.

Fabrication & Production

One of the most significant steps in my production process that led to many failures and successes was keeping track of pin numbers. My project had many circuits and it eventually became confusing to dig through piles of wires to figure out what pin connects to which wire and sensor or LED. Ensuring that there is a clear record as to which sensor and LED corresponds to which pin number and also keeping consistency with that while coding and developing the project would have saved me much more time and frustration. Wiring soldering was a new skill I developed while doing this project as I have only had one experience with this prior. After soldering wires, I learned that it is crucial to wrap electrical tape around the exposed wires to not cause a short circuit. We caused a short circuit in an LED on the first day, which broke the LED in half. My partner also soldered the positive and negative sides wrong, which was a pain to figure out after the wires were wrapped in tape and a lesson for us to pay closer attention to the positives and negatives before doing anything.  

Developing the code was probably the most difficult part of the project as I am completely unfamiliar with coding. One thing that helped so much with the organization of both the code and my understanding of the logic behind the code was separating the code into different stages. For example, having this 

 if (stage == 0) {
    startButtonState = digitalRead(buttonPin);
    if (startButtonState == 1) {
      Serial.println("Pressed");
      startTime = millis();
      stage = 1;
    } 

instead of this

// Serial.print("Released after ");
    //Serial.println(millis() - startTime);

    //digitalWrite(electroMagnetPin1, HIGH);  //Switch Electromagnet ON=

    //buttonState1 = digitalRead(2);
    //Serial.println(buttonState1);

    //if (buttonState1 == HIGH) {
    //digitalWrite(ledPin1, HIGH);

    //}

    // delay(10000);

    // digitalWrite(electroMagnetPin1, LOW);  //Switch Electromagnet OFF
    // buttonState1 = digitalRead(7);
    // Serial.println(buttonState1);

    // if (buttonState1 != HIGH) {
    //   digitalWrite(ledPin1, LOW);
    // } 

Separating the code into different stages helped me to see clearly which part of the code is the “if” and what are the results and/or “elses” that come from the different reactions that the audience could give. It also helped a lot to divide stage 0 with the rest of the stages to set up the code and program before actually running anything, which contributes to what I mentioned above about knowing which pin matches which sensor or LED. 

The way that my partner and I split up the work for this project was that I did the coding and wiring and she did the physical arts and building. As I do not know much about wiring and coding, this project was a challenge and a huge learning process for me but thankfully I figured it out with the help of learning assistants and professors. When I was done editing the code after every work session, I would message the code to my partner and give her a to-do list for when she came into the studio. During user testing, we found that our project still had a lot to develop as the instructions/message was unclear and that the project itself needed improvement on the visual aesthetics. After this session, we added blinks to the LED, randomized in the timing of which flower would fall first, and clarified the instructions poem by adding specific words like “pluck” and “only one flower”.  I added blinking to the LED lights after the start button is pressed to indicate that the clock is ticking because, after user-testing, I understood that users did not feel an urgency to react after pressing the start button. Before having this LED blink, it was ambiguous that there isn’t an unlimited amount of time to make your decision. We also found that our users were confused as to what to do with the flowers and eventually began to discover the order of the flowers falling. Additionally, I created a box that stuck to the board for stability and to hide the wires and added a front panel to catch the flowers that were initially falling onto the floor as the board itself was not stable, there were lots of wires exposed to the audience, and that it was a hassle to catch/pick up the flowers every time they fell.

Full circuits

Circuit diagram of electromagnetic sensors
https://github.com/ima-nyush/Interaction-Lab/tree/main/Tutorials/Electromagnet

Conclusions

The goals of this project are to create a visually aesthetic interactive art piece and deliver a similar message to what Sylvia Plath delivered in her book, which is to make your decisions in a timely and “grateful” manner. Our project aligns with my definition of interaction as it encourages communication and delivers messages between the audience and the project. However, it doesn’t align with my definition of interaction enough as the message could be confusing or easily misinterpreted by some people, and the interaction might have been too short as it is a one-time decision. Ultimately, my audience didn’t respond to my project in the exact manner that I expected: some were trying to catch the flowers from falling, some didn’t read the instructions carefully before beginning, and some didn’t know to place the flowers into the “place here” box, etc. If I had all the time in the world to work on this project, some improvements I would implement are adding many more flowers and LEDs to increase the number of choices available, making the “place here” box more dramatic and eye-catching, adding sound effects to indicate the timer and wins/losses, and adding LEDs around each flower to show which fate the user ends up with if they successfully choose and place that one into the box.  

From all of the setbacks and failures that I have encountered during this project, I believe the biggest value I learned from this is that projects like these take lots of planning and patience. At first, our ideas weren’t realistic (at least for our skill level) and we had to quickly simplify our plans so that we could implement them. I also learned that for these projects to work, lots of patience is required in each part of the process. Thankfully, in the end, this project turned out successfully and people were able to interact with it the way that we planned (kind of, I hope).

Final code:

//boolean gameStart = false;
int stage = 0;
//led and magnet 1
int ledPin1 = 13;
int electroMagnetPin1 = 9;  //This is the output pin on the Arduino uno
//led and magnet 2
int ledPin2 = 12;
int electroMagnetPin2 = 10;  //This is the output pin on the Arduino uno
//led and magnet 3
int ledPin3 = 4;
int electroMagnetPin3 = 11;  //This is the output pin on the Arduino uno
//led and magnet 4
int ledPin4 = 3;
int electroMagnetPin4 = 7;  //This is the output pin on the Arduino uno
//led and magnet 5
int ledPin5 = 8;
int electroMagnetPin5 = 6;  //This is the output pin on the Arduino uno
//button and button state
int buttonPin = 2;
int startButtonState = 0;
//light sensor value
int sensorVal = 0;
int val;
//time variabes
long startTime = -1;  // stopped by default
//led booleans
boolean led1 = true;
boolean led2 = true;
boolean led3 = true;
boolean led4 = true;
boolean led5 = true;
// random magnet times
int randTime1 = random(5000, 12000);
int randTime2 = random(5000, 12000);
int randTime3 = random(5000, 12000);
int randTime4 = random(5000, 12000);
int randTime5 = random(5000, 12000);

void setup() {
  Serial.begin(9600);
  // pinmode flower 1
  pinMode(ledPin1, OUTPUT);
  pinMode(electroMagnetPin1, OUTPUT);
  // pinmode flower 2
  pinMode(ledPin2, OUTPUT);
  pinMode(electroMagnetPin2, OUTPUT);
  // pinmode flower 3
  pinMode(ledPin3, OUTPUT);
  pinMode(electroMagnetPin3, OUTPUT);
  // pinmode flower 4
  pinMode(ledPin4, OUTPUT);
  pinMode(electroMagnetPin4, OUTPUT);
  // pinmode flower 5
  pinMode(ledPin5, OUTPUT);
  pinMode(electroMagnetPin5, OUTPUT);


  //pinmode button
  pinMode(buttonPin, INPUT);

  //Sets that pin as an output
  digitalWrite(ledPin1, HIGH);
  digitalWrite(electroMagnetPin1, HIGH);  //Switch Electromagnet ON=
  digitalWrite(ledPin2, HIGH);
  digitalWrite(electroMagnetPin2, HIGH);  //Switch Electromagnet ON=
  digitalWrite(ledPin3, HIGH);
  digitalWrite(electroMagnetPin3, HIGH);  //Switch Electromagnet ON=
  digitalWrite(ledPin4, HIGH);
  digitalWrite(electroMagnetPin4, HIGH);  //Switch Electromagnet ON=
  digitalWrite(ledPin5, HIGH);
  digitalWrite(electroMagnetPin5, HIGH);  //Switch Electromagnet ON=
}


void loop() {

  if (stage == 0) {
    Serial.println("start");
    startButtonState = digitalRead(buttonPin);

    if (startButtonState == 1) {
      Serial.println("Pressed");
      startTime = millis();
      stage = 1;
    }
  }

  if (stage == 1) {
    Serial.println("stage 1");

    sensorVal = analogRead(A0);

    if (millis() % 1000 > 500) {
      if(led1 == true){
        digitalWrite(ledPin1, HIGH);
      }
      if(led2 == true){
      digitalWrite(ledPin2, HIGH);
      }
      if(led3 == true){
      digitalWrite(ledPin3, HIGH);
      }
      if(led4 == true){
      digitalWrite(ledPin4, HIGH);
      }
      if(led5 == true){
      digitalWrite(ledPin5, HIGH);
      }
    } 
    else {
      digitalWrite(ledPin1, LOW);
      digitalWrite(ledPin2, LOW);
      digitalWrite(ledPin3, LOW);
      digitalWrite(ledPin4, LOW);
      digitalWrite(ledPin5, LOW);
    }

    if (millis() - startTime > randTime1){
      digitalWrite(ledPin1, LOW);
      digitalWrite(electroMagnetPin1, LOW);
      led1 = false;
    }
    if (millis() - startTime > randTime2) {
      digitalWrite(ledPin2, LOW);
      digitalWrite(electroMagnetPin2, LOW);
      led2 = false;
    }
    if (millis() - startTime > randTime3) {
      digitalWrite(ledPin3, LOW);
      digitalWrite(electroMagnetPin3, LOW);
      led3 = false;
    }
    if (millis() - startTime > randTime4) {
      digitalWrite(ledPin4, LOW);
      digitalWrite(electroMagnetPin4, LOW);
      led4 = false;
    }
    if (millis() - startTime > randTime5) {
      digitalWrite(ledPin5, LOW);
      digitalWrite(electroMagnetPin5, LOW);
      led5= false;
    

      Serial.println(sensorVal);
      if (sensorVal < 750) {
        // val = map(val, 0, 1023, 0, 1023);
        // Serial.println(val);
        stage = 2;
      }
    }
  }

  if (stage == 2) {
    Serial.println("stage 2");
    digitalWrite(ledPin1, HIGH);
    digitalWrite(electroMagnetPin1, HIGH);
    digitalWrite(ledPin2, HIGH);
    digitalWrite(electroMagnetPin2, HIGH);
    digitalWrite(ledPin3, HIGH);
    digitalWrite(electroMagnetPin3, HIGH);
    digitalWrite(ledPin4, HIGH);
    digitalWrite(electroMagnetPin4, HIGH);
    digitalWrite(ledPin5, HIGH);
    digitalWrite(electroMagnetPin5, HIGH);
  }
}

Disassembly

Disassembling the project