xxxxxxxxxx
var x,y,a,b,r1,g1,b1,u
var xSP,ySP
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
x=windowWidth/2
y=windowHeight/2
xSP=5;
ySP=5;
value=0
r1=random(30,120)
g1=random(50,200)
b1=random(130,255)
u=windowHeight/4
sound=loadSound('click-dry.mp3')
}
function draw() {
background(0,0,0);
noStroke()
//star
fill(((windowHeight-(mouseY)/5*4+(windowWidth/2-abs(windowWidth/2-mouseX))/5)/2)/4,0,0)
stroke(0,0,0)
strokeWeight(1)
rect(windowWidth/2-abs(windowWidth/2-mouseX),0,abs(windowWidth/2-mouseX)*2,mouseY)
//fill(255-(windowHeight-mouseY)/2,0,0)
//rect(0,windowHeight/8,windowWidth,windowHeight/8)
//fill(255-(windowHeight-mouseY)/3,0,0)
//rect(0,windowHeight/4,windowWidth,windowHeight/8)
//fill(255-(windowHeight-mouseY)/4,0,0)
//rect(0,windowHeight/8*3,windowWidth,windowHeight/8)
//trangles
noStroke()
fill(255,255,255)
triangle(windowWidth/8-30,windowHeight/4+50,windowWidth/8+30,windowHeight/4+50,windowWidth/8,u-10)
triangle(windowWidth/8*2-30,windowHeight/4+50,windowWidth/8*2+30,windowHeight/4+50,windowWidth/8*2,u-10)
triangle(windowWidth/8*6-30,windowHeight/4+50,windowWidth/8*6+30,windowHeight/4+50,windowWidth/8*6,u-10)
triangle(windowWidth/8*7-30,windowHeight/4+50,windowWidth/8*7+30,windowHeight/4+50,windowWidth/8*7,u-10)
stroke('white');
a=windowWidth/2-75+x/16
b=windowHeight/4+25+y/16
fill(0,0,0)
ellipse(windowWidth/2,windowHeight/4,windowWidth/4,windowWidth/4)
fill(255,255,255)
noStroke()
//arc(windowWidth/2,windowHeight/4+50,windowWidth/16,windowWidth/16-40,TWO_PI, PI)
//arc(windowWidth/2,windowHeight/4+51,windowWidth/16,windowWidth/16-40,PI, TWO_PI)
quad(windowWidth/2,windowHeight/4,windowWidth/2+75,windowHeight/4+50,windowWidth/2,windowHeight/4+100,windowWidth/2-75,windowHeight/4+50)
stroke(0)
fill(0,0,0)
ellipse(a,b,80,80)
fill(r1,g1,b1)
circle(x,y,50);
if(25>x){xSP=xSP*(-1);}
if(x>windowWidth-25){xSP=xSP*(-1)}
x=x-xSP
/////////////////////////////////////////////
//////////////////y//////////////////////
if(25>y){ySP=ySP*(-1)}
if(y>windowHeight-25){ySP=ySP*(-1)}
y=y-ySP
}
function mouseClicked(){
sound.play()
r1=random(30,120)
g1=random(50,200)
b1=random(130,255)
if(u===windowHeight/4){
u=windowHeight/4+110
}else{
u=windowHeight/4}
}