Fixed the Body collide issues and optimised the process at the same time. Now the QuadTree appears to work perfectly as a result. Bonus!

This commit is contained in:
Richard Davey
2013-09-08 01:24:59 +01:00
parent bb5d8ca170
commit fe6664eac7
7 changed files with 116 additions and 44 deletions
+3 -3
View File
@@ -39,7 +39,7 @@
ship = game.add.sprite(400, 400, 'ship');
ship.body.collideWorldBounds = true;
ship.body.bounce.setTo(0.5, 0.5);
ship.body.bounce.setTo(1, 1);
}
@@ -64,14 +64,14 @@
}
game.physics.collideGroup(aliens);
// total = game.physics.overlap(ship);
total = game.physics.overlap(ship);
}
function render() {
game.debug.renderQuadTree(game.physics.quadTree);
game.debug.renderRectangle(ship.body.bounds);
game.debug.renderRectangle(ship.body);
// game.debug.renderText('total: ' + total.length, 32, 50);