GourmetGorilla Posted May 8, 2015 Share Posted May 8, 2015 In the space invaders example, if instead of killing the alien you add it to a new group and change the sprite. The score does not increase when you shoot the now dead alien, but you CAN still shoot it. I think this is because the explosion is set up on the invader sprite (forEach(setUpInvader... explosions = game.add.group(); explosions.createMultiple(30, 'kaboom'); explosions.forEach(setupInvader, this);and setUpInvader :function setupInvader (invader) { invader.anchor.x = 0.5; invader.anchor.y = 0.5; invader.animations.add('kaboom');}i'm turning my deadAliens into flowers. But once I've done that, and put the deadAliens into a new group, you can still shoot at them because .... why? Is there some way I can just disable collision from happening once they've been shot at once? Link to comment Share on other sites More sharing options...
GourmetGorilla Posted May 9, 2015 Author Share Posted May 9, 2015 well, I tried this.sprite.overlap.stop(null, true);It didn't work Link to comment Share on other sites More sharing options...
loafer Posted May 11, 2015 Share Posted May 11, 2015 You can just set body.enable to false. Take a look at this example for the full code: http://phaser.io/examples/v2/arcade-physics/body-enable Link to comment Share on other sites More sharing options...
GourmetGorilla Posted May 11, 2015 Author Share Posted May 11, 2015 omg that was easy, thank you! Link to comment Share on other sites More sharing options...
Recommended Posts