Olex
Olex

Reputation: 1656

Cocos2d. Sprite to dissapear

everyone! I have sprite moving by action, what have health bar (progress bar). When the value of health bar will equal zero, sprite should stop and dissappear from the scene. Any ideas how to make this?

Thanks, Alex.

Upvotes: 0

Views: 98

Answers (1)

Cameron
Cameron

Reputation: 671

You could use a bar image, and change the x-scale according to the sprites health. When health is zero set it to invisible. You can find how to do all this stuff in the CCSprite class reference

Upvotes: 1

Related Questions