How to have multiple enemies from the same spawner have individual healths?
TaylorH1
Member Posts: 8
I have a spawner producing enemies but Im not 100% on how to get each of them to have individual healths. Right now when I kill one it kills all of the enemies on screen.
Any help would be great! Thanks.
Answers
@TaylorH1 There is a tutorial on youtube for this , by Ash Jakcson
I hope it helps and good luck
@TaylorH1 - You can also check out my tutorials and templates on my site, some of them show how to spawn enemies of different health and different color, etc. - monkeyuncle.com
But, the basics are:
Create a integer called health in the enemy actor
Set health to floor(random(1,5)), which will give it varying health from 1-5
On collision with player or player laser (or whatever), have it deduct 1 from health
Add a rule that when health < 0, destroy the actor
I have a health bar demo in the Spare Code thread that does just this. I'm not able to search for it at the moment but let me know if you can't find it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Super big thanks guys!!! I think Ive got it the way I need it. but if not I'll let you know.