So I have this javascript code:
var sim = new function()
{
...
...
...
this.Tick = function ()
{
var currTime = Date.now();
var elapsedMS = currTime - this.lastUpdateTime;
this.Update(elapsedMS);
this.Render();
this.lastUpdateTime = currTime;
};
this.Run = function()
{
this.tickIntervalId = setInterval(this.Tick, 1000/60); //Update at 60 fps
};
Getting the following error: Uncaught ReferenceError: Update is not defined.
Anybody know what's causing this?