Categories
Interaction Lab

Hungry Pacman — Calista — Andy

Hungry Pacman — Calista — Andy

Context and Significance

We drew inspiration from a Wall Ball game, which is a fun easy backyard game to get the ball to find its way through randomly scattered holes to reach the top hole. I reckon this project is interactive because it keeps the participants engaged in the whole process. It aligns with my definition of interaction: a conversational and communication process between two or more people, where ideas and emotions ( in this case joy and happiness) are actively exchanged, enabling both parties to discover new meanings and create new things together. This is also what we would like to convey in our own project. We hope our participants can enjoy and have fun when playing with our project.

 

We adopted the game rule, but instead of remaking the Wall Ball game, we added new concepts and features, taking it to a new level. We added buzzer, stepper motors and sensors to optimize user experience and enhance game feedback. We also changed it to a two-player game, because we hope our users can collaborate with each other to solve the challenges. Our project is designed for people who seek relaxation from their busy workdays and enjoy laughing out loud with their friends while tackling a silly or impossible challenge (depends on their gaming skills 🙂

Conception and Design

Based on our narrative where players need to feed the hungry Pacman with “food,” we decided to use a ping pong ball as the “food” and craft the device’s body out of cardboard. This way, we can cut a hole to serve as Pacman’s mouth.

First-version of cardboard. Later recut because this was cut too much, making the game too difficult and the cardboard prone to bending

In terms of the usage of Arduino, we imagined users controlling the ball container’s movement by adjusting the height of two ropes on both sides. If they want the ball to go sideways, they need to make the rope on one side shorter and the other side longer, while being careful not to tilt too much. Therefore, we carefully considered and ultimately decided to use two sliders as the most suitable sensor for user control. We also once thought of changing the slider to other sensors that were more fun, but that made the game almost impossible because it couldn’t be accurately controlled, so we ended up going back to the original design. 

To hold the ball securely, we first experimented with cardboard, but it often tipped over. Andy came to our rescue with a V-shaped piece of wood, which proved to be an ideal solution. We later carved it into the shape of Pacman, which not only aligned /with our theme but also ensured it wasn’t too heavy for the stepper motors to handle. 

The changing process of the wood piece

Fabrication and Production
First, we began by designing the cardboard, which served as the map for our game. Next, we focused on the mechanism. Renna came up with the creative idea of using a straw to replace the pulley, considering that the material is easy to access and process. After that we designed our circuits as the diagram below.

circuits diagram

building the circuits 

We followed Andy’s suggestion to use two separate Arduino for two stepper motors, simplifying the coding process. We made sure that our fabrication and coding process is done alternatively. Additionally, I suggested incorporating a buzzer to play the Pacman music, enhancing the immersive atmosphere of the game. While I took on more responsibility for the coding aspect, Renna focused on fabrication. Throughout the entire process, we worked closely together and ensured effective communication. We also thanks our professor Andy a lot for his help, for example, when we couldn’t think of how to secure our stepper motors, he kindly suggested us to make use of the clamp:

This winding method is also a solution that we are proud to have come up with together

In terms of the technical part, I’d like to briefly go through our code (refer to the appendix). Our Arduino sketch controls a stepper motor based on the input from a potentiometer (A0) and plays a melody on a buzzer triggered by a press sensor (A1). The value read from A0 determines the direction and speed of the stepper motor. If the value falls within 0-300 or 700-1023, the stepper motor is set to move in either clockwise or counterclockwise direction at speed 600. If the value is in the middle, the motor stops.

During the user test, we recognized many things that we can improve. At that time, we did not have this board, so if you stand in front of it, you can see the mess behind through the hole. Therefore, we added this inclined board after the user test. I sketched out this idea:

 

In this way, the ball could be caught and rolled to the front and trigger the sensor after falling, thus effectively avoiding the trouble of picking up the ball and playing music manually.

 

Conclusions

In conclusion, our project, “Hungry Pacman,” aimed to create an interactive gaming experience that engaged participants in collaborative gameplay while providing moments of joy and relaxation. Our project results largely aligned with our definition of interaction as a conversational exchange between participants, where ideas and emotions are actively shared. Users got to strategize, communicate, and problem-solve together. Ultimately, our audience interacted positively with our project, showing enthusiasm and enjoyment during gameplay. In this project I not only familiarized myself with all the techniques but also learned how to solve problems through teamwork.

The final version!

There are still many things that we can improve in the future, so that we can create even more memorable experiences for our players.

  1. We could further distinguish the response between winning and losing the game, which could create a more immersive game experience. It’s hard to do because it’s already very difficult to add more sensors to our circuit as we don’t have F/M cables of enough length.
  2. We may also make the stepper remember its position at the very beginning and go back to that position whenever the game is restarted. We couldn’t figure out the code, because the rope can stop anywhere when the game breaks, so even if we count the number of steps needed to go from top to bottom, it still doesn’t help.

Disassembly

 

Appendix

  1. the full code

the main Arduino file: (the other Arduino only have part of the code that controls the stepper motor)

// based on ConstantSpeed example
#include <AccelStepper.h>
#include "pitches.h"

int DIR_PIN = 2;
int STEP_PIN = 3;
int EN_PIN = 4;
int value;
int press;

AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);

// notes in the melody:
int melody[] = {
NOTE_C3, NOTE_C4, NOTE_G3, NOTE_E3, NOTE_C4, NOTE_G3, NOTE_E3, 0, NOTE_CS3, NOTE_CS4, NOTE_GS3, NOTE_F3, NOTE_CS4, NOTE_GS3, NOTE_F3, 0, NOTE_C3, NOTE_C4, NOTE_G3, NOTE_E3, NOTE_C4, NOTE_G3, NOTE_E3, 0, NOTE_C3, NOTE_D3, NOTE_E3, NOTE_F3, NOTE_G3, NOTE_A3, NOTE_B3, NOTE_C4,NOTE_C4
};


// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4,
8,8,8,8,8,8,4,1,1,
};


void setup() {

// Enable the stepper driver by setting the EN pin to LOW
pinMode(EN_PIN, OUTPUT);
digitalWrite(EN_PIN, LOW);

stepper.setMaxSpeed(1000);
Serial.begin(9600);

}

void loop() {

value = analogRead(A0);
press = analogRead(A1);
Serial.println(press);

if (value > 0 && value < 300) {
stepper.setSpeed(600);

} else if (value >= 300 && value < 700) {
stepper.setSpeed(0);

} else if (value >= 700 && value < 1023) {
stepper.setSpeed(-600);
}

stepper.runSpeed();

if (press>50) {

/**
* A buzzer that play the Pacman melody.
* This was adapted from a the tutorial found here:
* https://docs.arduino.cc/built-in-examples/digital/toneMelody/
*/

for (int thisNote = 0; thisNote < 32; thisNote++) {

// to calculate the note duration, take one second divided by the note type.
int noteDuration = 1000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);

// to distinguish the notes, set a minimum time between them.
// the note's duration + 30% seems to work well:
int pauseBetweenNotes = noteDuration * 0.80;
delay(pauseBetweenNotes);
// stop the tone playing:
noTone(8);
}
}
}

in the pitches.h file:

/*************************************************
Public Constants
*************************************************/

#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
#define NOTE_A1 55
#define NOTE_AS1 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_CS2 69
#define NOTE_D2 73
#define NOTE_DS2 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_FS2 93
#define NOTE_G2 98
#define NOTE_GS2 104
#define NOTE_A2 110
#define NOTE_AS2 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_CS3 139
#define NOTE_D3 147
#define NOTE_DS3 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_FS3 185
#define NOTE_G3 196
#define NOTE_GS3 208
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_CS4 277
#define NOTE_D4 294
#define NOTE_DS4 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_FS4 370
#define NOTE_G4 392
#define NOTE_GS4 415
#define NOTE_A4 440
#define NOTE_AS4 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_CS5 554
#define NOTE_D5 587
#define NOTE_DS5 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_FS5 740
#define NOTE_G5 784
#define NOTE_GS5 831
#define NOTE_A5 880
#define NOTE_AS5 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_CS6 1109
#define NOTE_D6 1175
#define NOTE_DS6 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_FS6 1480
#define NOTE_G6 1568
#define NOTE_GS6 1661
#define NOTE_A6 1760
#define NOTE_AS6 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_CS7 2217
#define NOTE_D7 2349
#define NOTE_DS7 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_FS7 2960
#define NOTE_G7 3136
#define NOTE_GS7 3322
#define NOTE_A7 3520
#define NOTE_AS7 3729
#define NOTE_B7 3951
#define NOTE_C8 4186
#define NOTE_CS8 4435
#define NOTE_D8 4699
#define NOTE_DS8 4978

Reference:

“DIY Wall Ball Game | DIY Backyard Summer Game | DIY Game.” YouTube, uploaded by Kelley, 13 May 2023, https://www.youtube.com/watch?v=TruZ5ZxAUKo

 

Leave a Reply

Your email address will not be published. Required fields are marked *