mirror of
https://github.com/wassname/phaser.git
synced 2026-08-10 12:30:48 +08:00
Patched the QuadTree, now working a whole lot better but am worried it's still working out too many collisions.
This commit is contained in:
@@ -105,6 +105,31 @@ Phaser.Utils.Debug.prototype = {
|
||||
|
||||
},
|
||||
|
||||
renderQuadTree: function (quadtree, color) {
|
||||
|
||||
color = color || 'rgba(255,0,0,0.3)';
|
||||
|
||||
this.start();
|
||||
|
||||
var bounds = quadtree.bounds;
|
||||
|
||||
if (quadtree.nodes.length === 0)
|
||||
{
|
||||
this.context.strokeStyle = color;
|
||||
this.context.strokeRect(bounds.x, bounds.y, bounds.width, bounds.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < quadtree.nodes.length; i++)
|
||||
{
|
||||
this.renderQuadTree(quadtree.nodes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this.stop();
|
||||
|
||||
},
|
||||
|
||||
renderSpriteCorners: function (sprite, showText, showBounds, color) {
|
||||
|
||||
if (this.context == null)
|
||||
|
||||
Reference in New Issue
Block a user