Targeting all subclassed CCSprites (cocos2d)

Posted by Joethemonkey101 on Stack Overflow See other posts from Stack Overflow or by Joethemonkey101
Published on 2010-12-27T22:50:09Z Indexed on 2010/12/27 22:54 UTC
Read the original article Hit count: 88

Filed under:
|
|

I'm working on a method to end the level, but to do so, I have to see that all of the enemy character have been killed. If my enemies are CCSprites, how do I make a method that detects if all of them are dead? I'm tracking their health with an int called enemyHp. For example, this is an if statement I made to remove the enemy if (enemy.enemyHp <= 0) {

To recap - I want to make a method that detects when all enemies have been killed.

Thanks

© Stack Overflow or respective owner

Related posts about methods

Related posts about cocos2d