Monday, December 15, 2014

The Final day!

The final project--I wish I was able to more carefully treat the box so you could see the painting I did, I also wish I could have treated the controller I would have wanted to do more with that.

People enjoying our game.

Yay! Look how much fun they are having!

They are having so much fun!

Painting and Polishing




First we tried to find, like, Tupperware or some type of box that was the right size for our arduino and circuit board, but no such luck. So we decided on the measure for the box and went Pro Build in Madison to get the wood for out custom box. We used Masonite because of it was both sturdy and easy to change and paint. We also bought wood glue, and got a little Tupperware to be the extension of our reset button. I applies gesso to all the wood to make it easier to paint. we got very cheap wood cutting supplies from Shopko but it was still very difficult to make clean cuts. When I got the box just as the wood, it was very rough. 


To clean up the edges I used tape around all of the edges and then put gesso over everything very thickly so the that it would be hard to tell where the tape was and have smoother edges.
At first I was planning to paint it all black with red and blue lines to emulate the lines on the design, but instead I really like a dark blue and black texture. 
I tried a couple more complex designs on the button--at first I was going to draw the two head-- and then just one head and it really just ended up looking better and just oh-so-press-able if I left it more simple and just wanted it to feel like a button. I wanted to to look a bit like the top piece of the rock-em-sock-em robot head--and incorporated the little circles like on the robots.

I was really happy with the box after I was done with it, I wish I could have put it all together so that I could treat the top and back edges with the tape too to have it smooth and nice-looking.


Programming


Early Programming test:


Final code:
PImage Rbody, Rhead, Rstick, Rarm, Rpunch, Barm, Bbody,Bhead,Bstick,Bpunch, background;
import processing.serial.*;
import cc.arduino.*;


Arduino arduino;
int ledPin1 = 11;
int ledPin2 = 10;
int ledPin3 = 9;
int ledPin4 = 6;
int ledPin5 = 5;
int ledPin6 = 3;
int fillVal1 = 255;
float health1 = 500;
float health2 = 500;
int butPin1 = 8;
int butPin2 = 7;
int butPin3 = 4;
int prevBut1 = 0;
int prevBut2 = 0;
int prevBut3 = 0;


void setup()
{
size(1000,600);

arduino = new Arduino(this, Arduino.list()[0], 57600);
arduino.pinMode(ledPin1, Arduino.OUTPUT);
arduino.pinMode(ledPin2, Arduino.OUTPUT);
arduino.pinMode(ledPin3, Arduino.OUTPUT);
arduino.pinMode(ledPin4, Arduino.OUTPUT);
arduino.pinMode(ledPin5, Arduino.OUTPUT);
arduino.pinMode(ledPin6, Arduino.OUTPUT);
arduino.pinMode(butPin1, Arduino.INPUT);
arduino.pinMode(butPin2, Arduino.INPUT);
arduino.pinMode(butPin3, Arduino.INPUT);


background = loadImage("Background.png");
image(background,-95,-62);
Rpunch = loadImage("Rpunch.png");
Bhead = loadImage("Bhead.png");
Rhead = loadImage("Rhead.png");
Bpunch = loadImage("Bpunch.png");
Rarm = loadImage("Rarm.png");
Barm = loadImage("BArm.png");

}

void draw ()
{
println(health1);
println(health2);
//println(pmouseX,pmouseY);
//println("First Pin is" + arduino.digitalRead(butPin1));
// println("Second Pin is" +arduino.digitalRead(butPin2));
println("Second Pin is" +arduino.digitalRead(butPin3));


checkHit();


/*
image(Rpunch,235,180);
image(Bpunch,350,180);
image(Rarm,235,225);
image(Barm,430,225);
*/
if(health1 <= 500 && health1 >= 320){
arduino.analogWrite(ledPin1, fillVal1);
arduino.analogWrite(ledPin2, 0);
arduino.analogWrite(ledPin3, 0);
image(Rhead,260,75);

}
else if(health1 <= 319 && health1 >= 160){
arduino.analogWrite(ledPin1, 0);
arduino.analogWrite(ledPin2, fillVal1);
arduino.analogWrite(ledPin3, 0);
image(Rhead,260,75);
}
else if(health1 <= 159 && health1 >= 1){
arduino.analogWrite(ledPin1, 0);
arduino.analogWrite(ledPin2, 0);
arduino.analogWrite(ledPin3, fillVal1);
image(Rhead,260,75);
}
else if(0 >= health1 ){
thread("blink2");
image(Rhead,260,20);
}

if(health2 <= 500 && health2 >= 320){
arduino.analogWrite(ledPin4, fillVal1);
arduino.analogWrite(ledPin5, 0);
arduino.analogWrite(ledPin6, 0);
image(Bhead,575,50);
}
else if(health2 <= 319 && health2 >= 160){
arduino.analogWrite(ledPin4, 0);
arduino.analogWrite(ledPin5, fillVal1);
arduino.analogWrite(ledPin6, 0);
image(Bhead,575,50);
}
else if(health2 <= 159 && health2 >= 1){
arduino.analogWrite(ledPin4, 0);
arduino.analogWrite(ledPin5, 0);
arduino.analogWrite(ledPin6, fillVal1);
image(Bhead,575,50);
}
else if(0 >= health2){
thread("blink1");
image(Bhead,575,10);
}

}
void blink1(){

arduino.analogWrite(ledPin4, fillVal1);
arduino.analogWrite(ledPin5, fillVal1);
arduino.analogWrite(ledPin6, fillVal1);
delay(500);
arduino.analogWrite(ledPin4, 0);

arduino.analogWrite(ledPin6, 0);

arduino.analogWrite(ledPin5, 0);
delay(500);


}
void blink2(){

arduino.analogWrite(ledPin1, fillVal1);
arduino.analogWrite(ledPin2, fillVal1);
arduino.analogWrite(ledPin3, fillVal1);
delay(500);
arduino.analogWrite(ledPin1, 0);

arduino.analogWrite(ledPin2, 0);

arduino.analogWrite(ledPin3, 0);
delay(500);


}

void checkHit(){

// println("button state is " + prevBut1);
image(background,-95,-62);
image(Barm,430,225);
image(Rarm,235,225);

if (arduino.digitalRead(8) == 1){
image(background,-95,-62);
image(Rarm,235,225);
image(Bpunch,350,180);
if (arduino.digitalRead(8)!= prevBut1){

health1-=5;
}

}
prevBut1 = arduino.digitalRead(8);


if (arduino.digitalRead(7) == 1){
image(background,-95,-62);
image(Barm,430,225);
image(Rpunch,235,180);
if( arduino.digitalRead(7)!= prevBut2){

health2-=5;

}
prevBut2 = arduino.digitalRead(7);
}

if (arduino.digitalRead(4) == 1){

if( arduino.digitalRead(4)!= prevBut3){

health1 = 500;
health2 = 500;

}
prevBut2 = arduino.digitalRead(4);
}



}

Rigging up the LEDs




Design Phase

I created all the art assets in Illustrator--overall time probably took about 10 hours or so. I used photos on the Internet for reference. I'm really satisfied with how the design came out. I made the two parts of the arm separate in case we needed to move them but at first we were just going to have one image of the arm bent and rotate it, but that made the character look like he was punching himself in the face. So I gave Colin the heads, the arm extended and the arm bent for each as separate parts and everything else was able to just be a background image. I made nice health bars to possible use, but since we the arduino output displaying health, on-screen health display would have rendered the LED set-up as pointless. I also hoped that when it was reset we could have it say "Fight!" or ready, set fight, but we didn't end up using them in the final thing. 

Idea Phase




When I met with Colin on that day that we all got together to show our toys and what they do I told Colin that his toys kinda looked like controllers and with four buttons on each controller you could have some kind of fighting game with left, right, punch, duck. Like rock em sock em robots! After the mad scramble for groups I ended up with Colin and Kaitlin and the plan was to make rock em sock em robots where I did the art, Colin would be in charge of programming and Kaitlin would do the hardware and help out wherever needed. Yay! We had our plan.

Monday, November 10, 2014

Research--BB

This toy is an a game, toy, and educational tool all in one. The groundwork for using toys to help children read goes way back.
There are several toys that are dubbed "educational", however some toys are intentionally created to teach children something, and other things are incidentally educational, such as something that children move around to help them develop fine motor skills.

Leapfrog--the company that created my toy, was born in 1994. The founder, Mike Wood, was trying to find a way to help his own child read and he want his child to be excited about reading.
The first leap frog was the leap pad released in 1999. LeapFrog releases the Leapster: 
 
The first learning game hand-held. My toy was born out of need for more simple, take-everywhere-you-go educational object. Thus--the twist and shout Phonics was born!


Diagram--BB


Wiimote Disassembly - Patrick 'Bizkit' Annett












The Wii mote has been a huge change in gaming since the additions of more than two buttons, and Nintendo has always been on the forefront of gaming technology.  With the introduction of the home gaming system to the current Wii U gaming system Nintendo has tried many different types of controllers. From the square NES controller to the Tablet used on the Wii U, They like to try different types of technology with their controllers. They have made controllers from a tri-winged system to the GameCube controller, but one of the most unique was the Wii mote. 

           This controller was designed off of the original design of a flash gun to look at screen locations and to make one that was able to use an RF system Nintendo decided to look into how computer mice work. This allowed them to gain a huge knowledge base on how to design the RF system used to make it not have a cord attached to the console, and be able to track location on the screen. Although this was a really key part of the device it’s not the only unique part of this controller.

            The next big addition to this controller was an accelerometer, which allowed tracking to do so much more. This also allowed the controller to track its specific location and be used in the games they were designing.  By doing so they also took gaming to a new level and help break into a new style of gaming that helped accelerate the casual games that come on mobile devices. The concept for using this device also came from the tracking methods used in computer mice to find locations.
             
   Overall the device is very unique for a controller and has allowed gaming to expand in a much different way, this has also allowed technology to take advantage of this and make unique ideas based on the expanded area this controller makes. This also did make it a bit more dangerous but has been used in really unique ways.