Enemy Life Attribute...could be a problem?
![DaneVincent](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi Guys
I'm new to GS and Have been cramming Tutorials for about a week, i have just recently completed the George Collins Arcade Shoot em up Tutorial and have a question about the enemy health Attribute.
ie, you create a new attribute in Game lets say "Enemy Health" and assign a value of 100 etc.
now in the tutorial if your bullet hits the enemy it gets destroyed and the attribute is changed
Change Attribute / Game.Emeny Health - 50 "therefor meaning i essentially have 50hp left.
and then later on you have another statement that says if Enemy Health is =< 0, the You won Game Screen pops up.
perfect.
Now, if i have multiple instances of Enemy running across the stage and i manage to "destroy" one enemy by reducing
Game.Enemy Health to Zero rather than calling up the You Won Screen, will it affect the other Enemies on the Screen Globally, and destroy them all? or does it just affect the Instance?
I hope my explanation is understandable.
Thanks
Dane
I'm new to GS and Have been cramming Tutorials for about a week, i have just recently completed the George Collins Arcade Shoot em up Tutorial and have a question about the enemy health Attribute.
ie, you create a new attribute in Game lets say "Enemy Health" and assign a value of 100 etc.
now in the tutorial if your bullet hits the enemy it gets destroyed and the attribute is changed
Change Attribute / Game.Emeny Health - 50 "therefor meaning i essentially have 50hp left.
and then later on you have another statement that says if Enemy Health is =< 0, the You won Game Screen pops up.
perfect.
Now, if i have multiple instances of Enemy running across the stage and i manage to "destroy" one enemy by reducing
Game.Enemy Health to Zero rather than calling up the You Won Screen, will it affect the other Enemies on the Screen Globally, and destroy them all? or does it just affect the Instance?
I hope my explanation is understandable.
Thanks
Dane
Best Answer
-
developer6810 Posts: 139
If you don't want the you won screen to pop up, you should edit the instance of each enemy (even though there is a lock on it) to when enemy.health =< 0 destroy actor. You should then have a boss that doesn't come until the end by using a timer and saying after ... seconds spawn actor Boss and then when boss.health =< 0 destroy actor and change scene to you won.
Hope this helps!
Answers
sorry i think i got a bit side tracked with my explanation.
Ok lets say I have 5 Enemies on the Screen in a straight line and i kill one by reducing the Enemy.Health Attribute i created to 0,
Now the Actor "Prototype" "Enemy" has When Enemy.Health =< 0 Destroy, therefore all the instances inherit the same behavior/Rule.
so in my mind, if i destroy one actor "Instance" "Enemy" by reducing the Attribute Enemy.Health to 0 the other Enemy actors on the screen should be destroyed as well, therefor acting Globally. or does Game Salad Interpret Each Instance Individually Regardless of the fact that they share the same Attribute Enemy.Health
Sorry I would Test it but i don't have enough time, thus the questions.
Thanks again
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
thanks all for the reply's
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User