 keep track of mouse events, and it will pass those events to the added objects. The easiest way is to call <code>space.bindMouse()</code>, which will listen to common mouse events, and then pass the information into your object's callback function <code>onMouseAction</code>. Like this:</p>
<pre><code class="language-javascript">var bot = {
    animate: function(time, fs, context) {
        //...
    },

    onMouseAction: function(type, x, y, evt) {
        // Code to track mouse actions will go here
    }