Hi there @garcai, and thanks for sharing your code!
Your additions look pretty good to me; I think it is great that you making your own thing from my example!
I don’t really have time to go through and assess all your additions in detail, but this doesn’t mean you shouldn’t send me your code — I am always happy to see what people have created with the help of my courses. If there were a couple of specific items you wanted feedback on, I could maybe help you with those.
The logic is a little odd here; I could probably have come up with a more elegant solution here, but I remember finding it difficult to come up with something that worked, quickly The problem was around the fact that array items don’t have a specific index to identify them, and it is not easy to just delete one anywhere in the array. There is probably a better way.
What i did was move the evil circle collision detection to the bouncing balls and remove the ball from the array as below.
It ‘seems’ to work, but is there a case that it could be a problem?
Ball.prototype.collisionDetect = function collisionDetect() {
// eviCircle collisionDetection
let dx = this.x - evilCircle.x;
let dy = this.y - evilCircle.y;
let distance = Math.sqrt(dx * dx + dy * dy);