Cedric Posted June 21, 2015 Share Posted June 21, 2015 Hey everyone, I was following the "shoot m up: in an afternoon". But I'm using phaser 2.3.0 to do so.In the previous version of phaser there was an "eneny.damage(BULLET_DAMAGE);" function and that doesn'work or exists in 2.3.0.Also the "enemy.health -= 1;" doesnt work :/ How can I make a health/damage system in phaser 2.3.0 ? Thanks in advance Link to comment Share on other sites More sharing options...
Segger Posted June 22, 2015 Share Posted June 22, 2015 You could initialize your enemies with a health property when they're created and just kill() them when their health is <= 0 Link to comment Share on other sites More sharing options...
drhayes Posted June 22, 2015 Share Posted June 22, 2015 In Phaser 2.3.0 there's a Health component you can mix into the Sprites to add the health property and the damage method. Check out how Sprite does it. You could do that for your own sprites or just do it for all Sprites in your game. This kinda feels like a bug to me. Link to comment Share on other sites More sharing options...
Maks Posted June 22, 2015 Share Posted June 22, 2015 See https://github.com/photonstorm/phaser/issues/1739 Link to comment Share on other sites More sharing options...
Recommended Posts