Hello, I am following the Coding Train 7.4 tutorial, if anyone has seen this, and I am unable to allow the program to recognize when I click inside the circles. In the video, the functions are formatted like this:
function mousePressed() {
for (let i = 0; i < bubbles.length; i++){
bubbles[i].clicked(mouseX, mouseY);
}
}
clicked(px,py) {
let d = dist(px, py ,this.x,this.y);
if (d < int(this.r/2)){
this.brightness = 255;
console.log("Clicked on bubble");
}
}
The system says I need to place a semicolon after clicked, but this is not correct. What is incorrect about clicked()? Do I need to use mouseClicked() instead?
To anybody reading this, I have resolved the issue. No assistance is needed.