xxxxxxxxxx
27
function setup() {
createCanvas(400, 400);
strokeWeight(10);
noFill();
}
var hit = false;
function draw() {
background(255);
rect(200, 200, 100, 150);
circle(mouseX, mouseY, 100);
hit = collideRectCircle(200, 200, 100, 150, mouseX, mouseY, 100);
//stroke(hit ? color('yellow') : 0);
//print('colliding?', hit);
if(hit){
stroke('red');
}else{
stroke('yellow');
}
}