/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://tafe.sketchpad.cc/sp/pad/view/ro.qkE3KXVRkxX/rev.241
*
* authors:
* Jesus Cuauhtemoc
* Cindy Putri Rahardjo
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
//Still trying to figure out why the songs doesn't work here and why all of
//the texts are misplaced out of sudden e_______e;;
import ddf.minim.*;
AudioPlayer player;
Minim minim;
boolean button = false;
int x = 150;
int y = 255;
int w = 50;
int h = 20;
void setup(){
size(420,300,P2D);
background(255);
smooth();
ellipseMode(CENTER);
rectMode(CENTER);
}
void draw(){
if (button){
stroke(0);
fill(252,255,160);
rect(300,100,150,100);
String s = "Hello! Welcome to Cybear world! Click on the buttons on the left side and enjoy the music! Click STOP button to stop the music!";
fill(0);
text(s,245,65,100,100);
textSize(17);
textAlign(CENTER);
stroke(0);
fill(252,246,160);
rect(300,200,150,100);
String t = "(✿'u') DO IT~";
fill(0);
text(t,230,190,140,160);
} else {
background(255);
//changing BG
stroke(255);
fill(219,243,mouseY);
rect(25,0,30,600);
rect(85,0,30,600);
rect(145,0,30,600);
rect(205,0,30,600);
rect(265,0,30,600);
rect(325,0,30,600);
rect(385,0,30,600);
//hands & feet
stroke(255);
fill(193,156,119);
rect(125,160,20,50);
rect(175,160,20,50);
ellipse(135,220,20,20);
ellipse(165,220,20,20);
//body
stroke(255);
fill(227,mouseX,110);
rect(125,135,20,20);
rect(175,135,20,20);
rect(150,150,50,100);
rect(135,210,20,20);
rect(165,210,20,20);
//shirt
stroke(255);
fill(255);
rect(150,130,30,30);
//ears & head
stroke(255);
fill(193,156,119);
ellipse(120,75,30,30);
ellipse(180,75,30,30);
ellipse(150,100,70,70);
//eyes
stroke(0);
fill(46,39,32);
ellipse(130,100,10,10);
ellipse(170,100,10,10);
//mouth area
stroke(255);
fill(216,194,133);
ellipse(150,115,35,30);
//nose
stroke(255);
line(155,125,150,110);
line(145,125,150,110);
stroke(255);
fill(46,39,32);
ellipse(150,110,18,10);
}
//button
stroke(0);
fill(160,246,255);
rect(x,y,w,h);
String a= "Press Me!";
fill(0);
textSize(10);
text(a,127,250,width,height);
fill(49,167,255);
rect(50,200,40,40);
fill(255,49,149);
rect(50,130,40,40);
fill(255,176,49);
rect(50,60,40,40);
//stop button
fill(0);
rect(50,260,40,30);
String p="Stop";
fill(255);
text(p,38,255,35,20);
}
void mousePressed() {
if (mouseX > x-30 && mouseX < x+w-30 && mouseY > y-10 && mouseY < y+h-10) {
button = !button;
}
if (mouseX > 30 && mouseX < 70 && mouseY > 20 && mouseY < 80)
{ minim = new Minim(this);
player = minim.loadFile("http://uploads3.mp3songurls.com/1346501.mp3",2048);
player.play();
}
if (mouseX > 30 && mouseX < 70 && mouseY > 180 && mouseY < 220)
{ minim = new Minim(this);
player = minim.loadFile("http://uploads3.mp3songurls.com/1346502.mp3",2048);
player.play();
}
if (mouseX > 30 && mouseX < 70 && mouseY > 110 && mouseY < 150)
{ minim = new Minim(this);
player = minim.loadFile("http://uploads3.mp3songurls.com/1346500.mp3",2048);
player.play();
}
if (mouseX > 30 && mouseX < 70 && mouseY > 240 && mouseY < 270)
{ player.close();
minim.stop();
}
}