xxxxxxxxxx
96
function setup() {
createCanvas(400, 400);
}
var i=0
var x=0
var j=0
var y=0
var circlePosX=0
var circlePosY=0
var rad=50
function draw() {
background(0)
i = i + 0.5
if (i % 10!=0){
stroke(255,0,0)
for (x=0; x<width; x+=20){
line(0,x,x,x)
}
}
else{
stroke(0,0,255)
for (x=0; x<width; x+=10){
line(x,0,x,x)
}
}
if (i % 10!=0){
stroke(255,0,0)
for (x=0; x<width; x+=20){
line(x,0,x,x)
}
}
else{
stroke(0,0,255)
for (x=0; x<width; x+=10){
line(0,x,x,x)
}
}
j = j + 0.5
if (i % 10!=0){
stroke(0,255,0)
for (y=0; y<height; y+=20){
line(y,height,y,y)
}
}
else{
stroke(255,255,0)
for (y=0; y<height; y+=10){
line(y,height,y,y)
}
}
if (j % 10!=0){
stroke(0,255,0)
for (y=0; y<height; y+=20){
line(height,y,y,y)
}
}
else{
stroke(0,255,255)
for (y=0; y<height; y+=10){
line(y,height,y,y)
}
}
fill(255,0,127)
noStroke()
fill(random(0,255), random(0,255),random(0,255))
circlePosX =mouseX
circlePosY=mouseY
circle(circlePosX, circlePosY ,rad)
}