Jump to content

Add life to a sprite ?


Nikow
 Share

Recommended Posts

Hi !

 

I'm creating a space shooter, and i would like the asteroids can't be explode with only one shoot..

 

So, how could i assign differents life values to my sprites (asteroids sprites) ti make them destructables at differents points ?

 

Thank you !

Link to comment
Share on other sites

It depends on how you're creating your sprites, but I'm pretty sure sprites have a health property you can modify and decrement when they're shot using the damage method.

 

If not, you might have to derive your own Asteroid sprite class and mixin the Health component.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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