xxxxxxxxxx
var expand
var clr
var expand2
var clr2
var posX
var posY
function setup() {
createCanvas(windowWidth, windowHeight)
background("#E7D8C9")
frameRate(15)
expand=0
clr=30
expand2=0
clr2=30
posX=100
posY=100
noFill()
strokeWeight(3)
frameRate(60)
}
function draw() {
background(231,216,201,15)
drawRipples()
drawRake()
if (mouseIsPressed){
drawRipples2()
}
}
function drawRipples(){
stroke(231-clr,216-clr,201-clr)
expand+=1
if(clr>0.2){
clr-=0.2
}
if (expand==200){
posX=random(width)
posY=random(height)
expand=0
clr=30
}
for (i=0;i<700;i+=70){
ellipse(posX,posY,i+expand)
}
}
function drawRipples2(){
push()
expand2+=2
if(clr2>0.2){
clr2-=0.2
}
if (expand2==170){
expand2=0
clr2=30
}
for (o=0;o<700;o+=70){
ellipse(mouseX,mouseY,o+expand2)
}
pop()
}
function drawRake(){
push()
fill(201,186,171)
noStroke()
ellipse(mouseX-40,mouseY-40,5)
ellipse(mouseX-20,mouseY-20,5)
ellipse(mouseX,mouseY,5)
ellipse(mouseX+20,mouseY+20,5)
ellipse(mouseX+40,mouseY+40,5)
pop()
}