How can I make multiple enemies on a scene?

cbowers428cbowers428 Member Posts: 176
edited November -1 in Working with GS (Mac)
I want to have numerous of the same actor but have different hp for each. How can I do this? When I kill one they all die for some reason.

Comments

  • GamersRejoiceGamersRejoice Member Posts: 817
    You need to have the actors hp tied to an self.attribute, then you can use the instance of each actor to change the hp for each one. (Double click on the actor in the preview window and edit the attribute.)
  • cbowers428cbowers428 Member Posts: 176
    i mean i want separate hp for each, like if one dies i want them to die independent of each other, should i do the same thing as u said anyway?

    thanks
  • GamersRejoiceGamersRejoice Member Posts: 817
    I believe if you unlock each actor and use them as instances they should behave independent from one another. I may be wrong... someone back me up on this one?
  • mza1979mmza1979m Member Posts: 27
    GamerRejoice is correct in the first post but not in the second. You can only add an attribute to the main prototype but not each instance. However, this will still achieve your desired result, cbowers428. Simply add a new attribute to the prototype, call it something like "Ship HP", then assign an initial value to it (whatever HP you want the enemy to start with). Now this attribute will be LOCAL to each instance you place in the scene, completely independent of all other instances. They will all have the same initial HP however. But with each hit they take, each one will independently decrease its own HP. The next part would be to simply place the necessary rules to decrease the HP, within the PROTOTYPE, not each instance. At no point will you need to unlock any of the prototypes. GameSalad will take care of the rest, simply because you placed the "Ship HP" attribute within the prototype (local), not on the main screen (public). I hope this helps. Please let us know if it works.
Sign In or Register to comment.