Fixed the Sprite / World / Group body issue. So invaders now works again, as do the new examples.

This commit is contained in:
photonstorm
2014-02-03 04:09:45 +00:00
parent 3488880956
commit 28f71ed86d
4 changed files with 61 additions and 39 deletions
+2
View File
@@ -300,5 +300,7 @@ function render() {
{
game.debug.renderPhysicsBody(aliens._container.children[i].body);
}
game.debug.renderPhysicsBody(player.body);
}
+10 -5
View File
@@ -114,7 +114,9 @@ function createAliens () {
}
*/
bob = aliens.create(48, 50, 'invader');
bob = game.add.sprite(32, 32, 'invader');
// bob = aliens.create(48, 50, 'invader');
bob.debug = true;
@@ -145,8 +147,9 @@ console.log('descend');
function update() {
aliens.x += 1;
// bob.body.velocity.x = 100;
// aliens.x += 1;
bob.body.velocity.x = 100;
// bob.body.velocity.y = 100;
// Scroll the background
// starfield.tilePosition.y += 2;
@@ -325,7 +328,9 @@ function render() {
for (var i = 0; i < aliens._container.children.length; i++)
{
game.debug.renderPhysicsBody(aliens._container.children[i].body);
// game.debug.renderPhysicsBody(aliens._container.children[i].body);
}
game.debug.renderPhysicsBody(bob.body);
}