Object doesn't support method
<p>I'm trying to run the following code, but get an error in the gameLoop function saying: JavaScript runtime error: Object doesn't support property or method 'update'.</p>

<p>I'm a beginning JavaScript programmer. Can you spot what is wrong with this code?</p>

<pre><code>function Core(context) {
    this.context = context;
    this.fps = 500;
    this.sprite = new Sprite();
}

Core.prototype.run = function() {
    setInterval(this.gameLoop, this.fps); // &lt;&lt;&lt;&lt; PROBLEM
}

Core.prototype.gameLoop = function () {
    this.update();
    this.draw();
}

Core.prototype.update = function () {
    this.sprite.x += 50;
    this.sprite.y += 50;
}

Core.prototype.draw = function () {
    this.context.clearRect(0, 0, 300, 300);
    this.context.fillRect(this.sprite.x, this.sprite.y, 50, 50);
    this.context.fillText('x: ' + this.sprite.x + ' y: ' + this.sprite.y, 10, 250);
}
</code></pre>
