From 490d232f48ce73a0c4f96bc7163a02d6b203a67f Mon Sep 17 00:00:00 2001 From: liabru Date: Sun, 7 Feb 2016 16:06:54 +0000 Subject: [PATCH] added default for delta parameter in Engine.update, closes #200 --- src/core/Engine.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/Engine.js b/src/core/Engine.js index 5040317f..33e76b2b 100644 --- a/src/core/Engine.js +++ b/src/core/Engine.js @@ -96,11 +96,12 @@ var Body = require('../body/Body'); * Triggers `collisionStart`, `collisionActive` and `collisionEnd` events. * @method update * @param {engine} engine - * @param {number} delta - * @param {number} [correction] + * @param {number} [delta=16.666] + * @param {number} [correction=1] */ Engine.update = function(engine, delta, correction) { - correction = (typeof correction !== 'undefined') ? correction : 1; + delta = delta || 1000 / 60; + correction = correction || 1; var world = engine.world, timing = engine.timing,