Final Project Report

Unlock Nostalgia – Victoria Chen – Rudi

With the preparatory research and the essay, I was able to understand that I want to base my final project around targeting depression and stress by creating the emotion of nostalgia. I was able to do research on various types of interactions the user could have with a project, and ended up coming to a conclusive idea that was outside of the research ideas and essay. Tina and I decided to build off of our midterm project, and keep the idea of the ice cream truck. We wanted more interactivity this time, so we wanted to a make a game where they could have a special controller. The controller would resemble how the item is controlled in the game, and the mold for the game screen is a new renovated ice cream truck to bring back nostalgic feelings. During user testing, we have different people give out various suggestions. At the time, we only had our game coded, and explained the idea. Below is a picture of the notes that I took during the user testing period. For all of the 4 main feedbacks, we were able to adapt our final project based off of it, and received better feedback on improvements.

For our project, our hardest part was coming up with the game design. We found a code to a game that we thought would suit really well to our final project, and downloaded it to our laptops. The both of us went home and adjusted the code to see how it would work based on our liking. At the end, I ended up editing the code, and making it unique towards us. Although I was able to change the concepts of the game and the visuals, I was having a hard time with the sensor. Tina was in charge of the laser cutting design and the sensor part of the code. With her math skills, she was able to calculate how to add rotation and such to the sensor. We used an ultrasound sensor for our project so the distance of the wooden bear and the sensor would control the movement of the bear on the screen. We wanted to also add a light sensor, but we did not include it because we both agreed that the lights would take attention off of the main part of the project, which is the sensor controlled game. The ultrasound sensor was perfect as the measurement of distance lined up really well with the flying bear inside the game.

Our goal was to bring back a feeling of nostalgia and I believe that we achieved our goal through our project. We incorporated music and visuals that remind others of childhood, like songs and crayon drawings. The audience’s response was also just how we expected it to be as they worked the sensor correctly, and they seemed to like the project, which is the main purpose of bringing happy emotions. My project aligns with my definition of interaction: communication between the user and the project. The user is able to communicate the actions of the bear as well as attraction towards unlocking memories. The project moves the bear according to the user’s control and displays memory icons based on their score. If I had more time I would improve the sensor and make it more realistic, but I really like how the project is now. Our failures in coding made us more persistent in working hard and it taught us more if statements. The success taught us the reward of hard work.

This project is friendly de-stressing game that aims at depressed and anxious teenagers who experienced similar childhoods. They should be able to feel that nostalgia again and bring themselves back to a place of happiness.

 

The Code in Arduino:

//Ultrasound plane game
//by Yoruk for Instructables

//send commments to Yoruk16_72 AT yahoo DOT fr

//20 07 14 : main code

/*

 Wiring : 
 Vcc -> to Arduino 5v
 Trig -> Arduino pin 3
 Echo -> Arduino pin 2
 GND -> to Arduino GND 
 
 */


//settings

int echoPin= 2;
int triggerPin= 3;
unsigned long pulsetime = 0;
unsigned distance =0;
unsigned OldDistance =0;

void setup (){
  pinMode (echoPin, INPUT);
  pinMode (triggerPin, OUTPUT);
  Serial.begin(9600);  
}

void loop(){

  //compute the distance. Thanks for the ready-made code examples !!
  digitalWrite(triggerPin, LOW);
  delayMicroseconds(100);
  digitalWrite(triggerPin, HIGH);
  delayMicroseconds(100);
  digitalWrite(triggerPin, LOW);
  pulsetime = pulseIn(echoPin, HIGH);
  distance = pulsetime / 58;
  delay(10);


  //sent the value only if it's a new value
  if (OldDistance != distance) {

    Serial.println(distance); 

    OldDistance = distance;
  }

  delay(50);  // wait 0.1 s between each measure
}

The Code in Processing:

//Ultrasound bear, a game with a bear and an ultrsound sensor (but

//by Yoruk for Instructables

//send commments or questions to Yoruk16_72 AT yahoo DOT fr


//19 07 14 : initial code
//20 07 14 : it works with arduino !!
//07 07 15 : picture for the bear and for the rainbow
//06 12 15 : score system with the iceCream


int i, j; 
boolean keyPressed = false;
int Score ;
float DistancebeariceCream;


float Hauteur; //en Y
float Angle;
int DistanceUltra;
int IncomingDistance;
//float Pas; //pour deplacements X

float iceCreamX;
float iceCreamY;

float rainbowX ;  //for X position




String DataIn; //incoming data on the serial port

//5 a 32 cm


float [] CloudX = new float[6];
float [] CloudY = new float[6];

//vitesse constante hein


PImage Cloud;
PImage iceCream;
PImage bear;
PImage rainbow;



// serial port config
import processing.serial.*; 
Serial myPort;    
import processing.sound.*;
SoundFile sample;


//preparation
void setup() 
{

  myPort = new Serial(this, "/dev/cu.usbmodem1101", 9600);
  
    //myPort = new Serial(this, Serial.list()[2], 9600); 

    //myPort.bufferUntil(10);   //end the reception as it detects a carriage return

    frameRate(30); 

    fullScreen();
    rectMode(CORNERS) ; //we give the corners coordinates 
    noCursor(); //why not ?
    textSize(16);

    Hauteur = 300; //initial bear value


    Cloud = loadImage("cloud.png");  //load a picture
    iceCream = loadImage("mint ice cream.png");  
    bear = loadImage("flying bear.png");  //the new bear picture

    rainbow = loadImage("rainbow.png");  //some rainbow
    
  sample = new SoundFile(this, "ice cream truck trap remix.mp3");
    sample.play();
    

    //int clouds position
    for  (int i = 1; i <= 5; i = i+1) {
        CloudX[i]=random(1000);
        CloudY[i]=random(400);
    }


    Score = 0;
}


//incoming data event on the serial port
void keyPressed(){
  if(key == ' '){
    keyPressed = true;
  }
}



void serialEvent(Serial p) { 
    DataIn = p.readString(); 
    // println(DataIn);

    IncomingDistance = int(trim(DataIn)); //conversion from string to integer

    println(IncomingDistance); //checks....

    if (IncomingDistance>1  && IncomingDistance<100 ) {
        DistanceUltra = IncomingDistance; //save the value only if its in the range 1 to 100     }
    }
}

PFont font;
//main drawing loop
void draw() 
{
  if(keyPressed == false){
    background(255,255,255);
    text("PRESS SPACE TO BEGIN", 330, 300);
     PImage img;
     img = loadImage("intro.png");
     image(img, 0,0,2700,1650);
    
  }
  if(keyPressed == true){
    background(232, 227, 255);
    fill(112, 96, 185 );



    //rect(0, 580, 800, 600); //some rainbow

    //new rainbow : 

    for  (int i = -2; i <= 4; i = i+1) {  //a loop to display the rainbow picture 6 times

        image(rainbow, 448*i  + rainbowX, 840, 448, 116);  // 224 58 : picture size
    }

    //calculates the X rainbow translation. Same formulae than the iceCream
    rainbowX = rainbowX  -  cos(radians(Angle))*10;

    if (rainbowX < -448) {  //why 224 ? to have a perfect loop
        rainbowX=448;
    }


    textSize(16);
    text(Angle, 10, 30); //debug things...
    text(Hauteur, 10, 60); 


    //new part : check the distance between the bear and iceCream and increase the score
    DistancebeariceCream = sqrt(pow((400-iceCreamX), 2) + pow((Hauteur-iceCreamY), 2)) ;

    if (DistancebeariceCream < 40) {
        //we hit the iceCream   
        Score = Score+ 1;

        //reset the iceCream position
        iceCreamX = 1500;
        iceCreamY = random(600);
    }

    //here we draw the score
    text("Score :", 200, 30); 
    text( Score, 260, 30); 

if(Score >= 2){
  PImage img;
  img = loadImage("ice cream truck png.png");
  image(img, 50,0);
}
if(Score >= 3){
  PImage img;
  img = loadImage("candy.png");
  image(img, 660, 350, 250, 250);
}
if(Score >= 4){
  PImage img;
  img = loadImage("slide.png");
  image(img, 1000,150, 400, 350);
}
  




    Angle =50-DistanceUltra*10; //uncomment this line and comment the next one if you want to play with the mouse
    //Angle = DistanceUltra*5;  // you can increase the 4 value...



    Hauteur = Hauteur + sin(radians(Angle))*10; //calculates the vertical position of the bear

    //check the height range to keep the bear on the screen 
    if (Hauteur < 0) {
        Hauteur=0;
    }

    if (Hauteur > 600) {
        Hauteur=600;
    }

    TraceAvion(Hauteur, Angle);

    iceCreamX = iceCreamX - cos(radians(Angle))*10;

    if (iceCreamX < -100) {
        iceCreamX=900;
        iceCreamY = random(300);
    }

    //draw and move the clouds
    for  (int i = 1; i <= 5; i = i+1) {
        CloudX[i] = CloudX[i] - cos(radians(Angle))*(10+2*i);

        image(Cloud, CloudX[i], CloudY[i], 300, 200);

        if (CloudX[i] < -1500) {
            CloudX[i]=1500;
            CloudY[i] = random(600);
        }
    }

    image(iceCream, iceCreamX, iceCreamY, 100, 120); //displays the useless iceCream. 59 and 38 are the size in pixels of the picture
}
if(Score >= 5){
  background(255,255,255);
  textSize(30);
  text("YAY! You've unlocked all the memories!", 300, 300);
   PImage img;
     img = loadImage("outro.png");
     image(img, 0,0, 1800,1500);
    
}
}


void TraceAvion(float Y, float AngleInclinaison) {
    //draw the bear at given position and angle

    noStroke();
    pushMatrix();
    translate(400, Y);
    rotate(radians(AngleInclinaison)); //in degres  ! 

    scale(0.5);  //0.2 pas mal

    image(bear, -111, -55, 400, 600); // 223 110 : picture size



    popMatrix(); //end of the rotation matrix
}

Leave a Reply

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