title: Is there a way to make circular hitboxes in java?
body: <p>I'm trying to make a simple game, where you just have to hit some circles, and I was wondering if it is possible to make circular hitboxes instead of rectangular.</p>
  
  <p>This code is written in processing 3.5.1 btw...
  I've let some of the code out, basically, the code where I set up the main menu.</p>
  
  <pre><code>    //Random ellipse position
        int posx = (int)random(100, 1820);
        int posy = (int)random(100, 980);
  
      //Score count
          int score = 0;
  
      //Circlesize/Difficulty
            int circlesize = 100;
  
      //Hitbox
              float hitsize = 50;
  
  
      void setup(){
        size(1920,1080);
        background(255);
      } 
  
  
  
  void draw(){
  
      //What do to if the circle is pressed
       if(mousePressed &amp;&amp; mouseX &gt;= (posx - hitsize) &amp;&amp; mouseX &lt;= (posx + hitsize) &amp;&amp; mouseY &gt;= (posy - hitsize) &amp;&amp; mouseY &lt;= (posy + hitsize)){
  
        //Randomize next location for ellipse
           posx = (int)random(100,1820);
           posy = (int)random(100, 980);
  
        //Make a new ellipse
           background(255);
            fill(255, 0, 0);
             ellipse(posx, posy, circlesize, circlesize);
  
        //Add a point to score
           score ++;
       }
      }
  </code></pre>