The game is supposed to allow the user to click and place circles within the panel. If they overlap or are out of bounds, it's not supposed to draw a circle. The code I have so far allows the user to place circles, but when I attempt to overlap them it freezes. Can anyone please tell me what I'm doing wrong and point me in the right direction?
Here is the section of code so far that handles this:
protected void handleMouseClick(MouseEvent e) {
clickX = e.getX();
clickY = e.getY();
disk = new Disk(clickX, clickY, radii[diskCount], DiskColor.values()[diskCount % 15]);
disks[diskCount] = disk;
for(int i = 0; i < disks.length; i++) {
if(disks[i].overlaps(disk) == true) {
diskCount++;
repaint();
}
diskCount+=0;
repaint();
}
}