title: Is it possible to create a custom event variable and pass it through click()?
body: <p>Currently have a game I am working on.</p>
  
  <p>When you manually click on a specific object, particles fly out where you click it by using the <code>event.clientX</code> and <code>event.clientY</code>.</p>
  
  <p>I am implementing a feature where you can create "workers" and set them at specific x,y coordinates that'll click every couple of seconds.</p>
  
  <p>Currently I am doing something like this:</p>
  
  <pre><code>let el = document.elementFromPoint( x, y )
  el.click()
  </code></pre>
  
  <p>But the downside to this is that it doesnt have an event attached to it containing the <code>x</code>, and <code>y</code> coordinates like a normal click event has. Is there a way to pass it along?</p>
  
  <p>EDIT:</p>
  
  <p>So lets say whenever you click on <code>div.square</code>, particles come out.</p>
  
  <p>I have a click event listener on <code>div.square</code> that looks something like this:</p>
  
  <pre><code>square.onclick = ( event ) =&gt; {
    create_particles( event )
  }
  </code></pre>
  
  <p>If I were to simulate a click by doing <code>click()</code>, <code>square.onclick</code> will fire but the <code>event</code> parameter would be empty. Is there a way to pass along those coordinates somehow?</p>