Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Stop collision from happening once alien has been shot at.


Recommended Posts

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


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...