title: socket.io emit function server side only?
body: <p>I'm trying to develop a real time canvas game, i have some code that has the basic functionality i need but not using node or socket.io</p>
  
  <hr>
  
  <p>how would I emit this function to all clients?</p>
  
  <pre><code> function init()
      {
           numShapes = 10;
           shapes = [];
           drawScreen(); 
           ctx= canvas.getContext('2d'); 
           setInterval(draw,10);
           makeShapes();
      }
  </code></pre>
  
  <p><a href="https://jsfiddle.net/a9b3rm5u/5/" rel="nofollow">https://jsfiddle.net/a9b3rm5u/5/</a></p>
  
  <hr>
  
  <p>I am now trying to add a real time element but cannot understand socket.emit. How would I emit the balls from the server to all the clients? then use client side code for the click events? </p>