mirror of
https://github.com/photonstorm/phaser
synced 2024-12-01 00:49:41 +00:00
CollideObjects now handles the total setting and returning.
This commit is contained in:
parent
916e59ceb9
commit
0ee93393e3
3 changed files with 6 additions and 10 deletions
|
@ -4,11 +4,7 @@ var Collide = function (object1, object2, collideCallback, processCallback, call
|
||||||
if (processCallback === undefined) { processCallback = null; }
|
if (processCallback === undefined) { processCallback = null; }
|
||||||
if (callbackContext === undefined) { callbackContext = collideCallback; }
|
if (callbackContext === undefined) { callbackContext = collideCallback; }
|
||||||
|
|
||||||
this._total = 0;
|
return this.collideObjects(object1, object2, collideCallback, processCallback, callbackContext, false);
|
||||||
|
|
||||||
this.collideObjects(object1, object2, collideCallback, processCallback, callbackContext, false);
|
|
||||||
|
|
||||||
return (this._total > 0);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = Collide;
|
module.exports = Collide;
|
||||||
|
|
|
@ -4,6 +4,8 @@ var CollideObjects = function (object1, object2, collideCallback, processCallbac
|
||||||
var object1isArray = Array.isArray(object1);
|
var object1isArray = Array.isArray(object1);
|
||||||
var object2isArray = Array.isArray(object2);
|
var object2isArray = Array.isArray(object2);
|
||||||
|
|
||||||
|
this._total = 0;
|
||||||
|
|
||||||
if (!object1isArray && !object2isArray)
|
if (!object1isArray && !object2isArray)
|
||||||
{
|
{
|
||||||
// Neither of them are arrays - do this first as it's the most common use-case
|
// Neither of them are arrays - do this first as it's the most common use-case
|
||||||
|
@ -36,6 +38,8 @@ var CollideObjects = function (object1, object2, collideCallback, processCallbac
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return (this._total > 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = CollideObjects;
|
module.exports = CollideObjects;
|
||||||
|
|
|
@ -4,11 +4,7 @@ var Overlap = function (object1, object2, overlapCallback, processCallback, call
|
||||||
if (processCallback === undefined) { processCallback = null; }
|
if (processCallback === undefined) { processCallback = null; }
|
||||||
if (callbackContext === undefined) { callbackContext = overlapCallback; }
|
if (callbackContext === undefined) { callbackContext = overlapCallback; }
|
||||||
|
|
||||||
this._total = 0;
|
return this.collideObjects(object1, object2, overlapCallback, processCallback, callbackContext, true);
|
||||||
|
|
||||||
this.collideObjects(object1, object2, overlapCallback, processCallback, callbackContext, true);
|
|
||||||
|
|
||||||
return (this._total > 0);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = Overlap;
|
module.exports = Overlap;
|
||||||
|
|
Loading…
Reference in a new issue