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
+4 -3
View File
@@ -25,7 +25,7 @@
function create() {
player = game.add.sprite(400, 500, 'ship');
// player.anchor.setTo(0.5, 0.5);
player.anchor.setTo(0.5, 0.5);
aliens = game.add.group();
@@ -33,13 +33,14 @@
{
for (var x = 0; x < 10; x++)
{
aliens.create(x * 48, y * 64, 'alien');
aliens.create(x * 48, y * 50, 'alien');
}
}
aliens.x = 100;
aliens.y = 50;
var tween = game.add.tween(aliens).to({x: 200}, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
var tween = game.add.tween(aliens).to({x: 200}, 3000, Phaser.Easing.Linear.None, true, 0, 1000, true);
tween.onComplete.add(descend, this);
}