Lots of work on Group and also resolved the issue of the core game loop structure not being quite right.

This commit is contained in:
Richard Davey
2013-09-06 15:00:05 +01:00
parent 0c97e8e151
commit 822a2df289
9 changed files with 1003 additions and 344 deletions
+4 -1
View File
@@ -22,7 +22,7 @@ Phaser.Physics.Arcade = function (game) {
this.OVERLAP_BIAS = 4;
this.TILE_OVERLAP = false;
this.quadTree = null;
this.quadTree = new Phaser.QuadTree(this, this.game.world.bounds.x, this.game.world.bounds.y, this.game.world.bounds.width, this.game.world.bounds.height, this.maxObjects, this.maxLevels);
this.quadTreeID = 0;
// avoid gc spikes by caching these values for re-use
@@ -124,6 +124,9 @@ Phaser.Physics.Arcade.prototype = {
preUpdate: function () {
// Clear the tree
this.quadTree.clear();
// Create our tree which all of the Physics bodies will add themselves to
this.quadTreeID = 0;
this.quadTree = new Phaser.QuadTree(this, this.game.world.bounds.x, this.game.world.bounds.y, this.game.world.bounds.width, this.game.world.bounds.height, this.maxObjects, this.maxLevels);