Happy Fathers Day!
// happy fathers day pa!
// thanks for helping me learn about being creative.
// thanks for being silly.
// thanks for teaching me that being nerdy is ok.
// thanks for being kind.
// thanks for being you.
// love you xxx
The code is below:
PImage webImg, webImg1;
int imgWidth = 100;
int imgHeight = 80;
int letterIndex=0;
char [] letters = {
'h', 'a', 'p', 'p', 'y', 'f', 'a', 't', 'h', 'e',
'r', 's', 'd', 'a', 'y'
};
//counter
long countLegs = 9;
//color array (all the colors of the raibow legs)
color[] colarray = {
color(246,27,210),
color(193,22,236),
color(22,79,236),
color(22,172,236),
color(22,236,222),
color(22,236,44),
color(208,236,22),
color(236,122,22),
color(236,44,22)};
void setup(){
size (600, 400);
// Load images from a web server
String url = "http://processing.beccarose.co.uk/wp-content/uploads/2015/04/smallUFO.png";
String url1 = "http://processing.beccarose.co.uk/wp-content/uploads/2015/04/smallUFO2.png";
webImg = loadImage(url, "png");
webImg1 = loadImage(url1, "png");
}
void draw(){
noCursor(); // don't show curser -this is not good for browser
if (mousePressed == true){ //if mouse pressed change imgage and make flash
randomLegs();
}
else {
normLegs();
}
counter();
}
///////////////////////////////
// make loads of random legs //
///////////////////////////////
void randomLegs() {
background (60, 39, 200);
int col;
col = colarray[(int)random(0,8)];
for(int i= 0; i= letters.length) {
letterIndex =0;
}
//col++;
countLegs = countLegs+1;
}
image (webImg1, mouseX-40, mouseY-40);
}
//////////////////////////
// default leg position //
//////////////////////////
void normLegs (){
background(60, 39, 200);
image (webImg, mouseX-40, mouseY-40);
}
//////////////////////////////////////////
// count number of legs and display text//
//////////////////////////////////////////
void counter() {
textSize(12);
fill(255);
text("happy fathers day...", 10, height-30);
text("press for the dance to begin!", 10, height-10);
}