I am trying to display an animation of an square and at the same time to display the coordinates of the mouse when the user moves the mouse.

i figured out the part of the animation of the square but don't know why the it doesn't display the mouse coordinates

Please help

Code:
window.onload=function(){

var ctx = demo.getContext('2d');

var animObjects = [];
var animObjects2 = [];
var e = new MouseEvent(ctx);

animObjects.push(new anim(ctx, 0, 90, 80,80, 'yellow', 3, 3));
animObjects2.push(new MouseEvent(ctx,event));


loop();

function MouseEvent(ctx,evt){
    this.evt = evt;
    function writeMessage(demo, message) {
            ctx.clearRect(0, 0, demo.width, demo.height);
            ctx.font = '18pt Calibri';
            ctx.fillStyle = 'black';
            ctx.fillText(message, 10, 25);
    }

    function getMousePos(demo, evt) {
            var rect = demo.getBoundingClientRect();
            return {
              x: evt.clientX - rect.left,
              y: evt.clientY - rect.top
            };
    }
     this.clickReporter = function(evt){
            var mousePos = getMousePos(demo, evt);
            var message = 'Mouse position: ' + mousePos.x + ',' + mousePos.y;
            console.log(message);
            writeMessage(demo, message);
    }
}
function loop() {   
    ctx.clearRect(0, 0, demo.width, demo.height);
    for(var i = 0, ao; ao = animObjects[i]; i++) {
        ao.update();
    }
    demo.addEventListener('mousemove', e.clickReporter, false);
    requestAnimationFrame(loop);
}


function anim(ctx, x, y, XSize,YSize, color, dx, dy) {
    var me = this;
    
    this.x = x;
    this.y = y;
    this.XSize = XSize;
    this.XSize = XSize;
    this.color = color;
    this.dx = dx;
    this.dy = dy;
    
    var bool = 0;
    
    this.update = function() {
        
        if (me.x < 0 || me.x > ctx.canvas.width-80){
            me.dx = -me.dx;
        }
        if (me.y < 0 || me.y > ctx.canvas.height-80){
            me.dy = -me.dy;
        }
        
        me.x += me.dx;
        me.y += me.dy;        
        render();
    }
    function render() {
        ctx.beginPath();
        ctx.rect(me.x, me.y, me.XSize, me.XSize);
        ctx.closePath();
        ctx.fillStyle = me.color;
        ctx.fill();
    }
    return this;
}
}