Computer Drawing

Video of the computer drawing

Screenshot of the computer drawing
function setup() {
	createCanvas(500, 500)
	background(0, 0, 0)
	linex = 0;
	liney = 0;
}

function draw() {
	if( linex <= width){
		linex++
	}else{
	linex = 0
		if(liney <= height){
		liney = liney + 100
		}else{
			liney = 0
		}
  }
	strokeWeight(2)
	stroke(random(255),random(255),random(255))
	line( mouseX , mouseY, linex, liney)
	if(mouseX >= mouseY){
	ellipse(mouseY, mouseX, 20, 20)
	strokeWeight(height/ mouseX)
	fill(random(255) , random(255), random(255))
	rect(mouseX, mouseY, 20 , 20)
 }
	if(mouseX <= mouseY){
		ellipse(mouseY, mouseX, 20, 20)
		strokeWeight(height/ mouseY)
		fill(random(255) , random(255), random(255))
		rect(mouseX, mouseY, 20 , 20)
	}
	
	
 
}

Leave a comment