Multi-Health variables

  • Hey everybody , kinda new to construct and the forums.

    i have been looking around for a while to a solution to this problem.

    i am trying to create a metroid esc game and i can't quite figure out how to create the ever increasing number of health bars ( tanks), i've created the player's health with a variable and limited it and then created a power up that activates the second health variable but i cant figure out how to tell the system that i want it to take the health from the second health variable and then the first , it ends up taking form both instead.

    if anybody could give me just a guide to creating this kind of system or

    just advice on it i would be grateful

    Thanks.

    apologize if this is a stupid easy to fix problem by the way.

  • Could you increase your max health with each tank, then display it visually as different health pools? Is there a gameplay difference (such as attacks can only empty out one tank and no more)? If not, this may be the easiest solution.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you could explain your problem in terms of C2 objects/plugins, it may be easier to understand what exactly it is you're trying to do.

    If you're trying to interact with two different instances of one object, like a sprite, you need to use two different conditions. One condition that selects your player, and another that selects your tank.

    Think of events+conditions like putting objects into a basket. Whatever action you run will change all of the object instances that are in the basket at that time. So use sub-events and more conditions to divide the basket up until you have the exact object you want to act on. Selecting by UID is pretty good but requires a tiny bit of overhead in order to manage it. Or you can select by nearest, or overlap, or a bunch of other ways to get only the object you want.

    Peace.

  • ok the first suggestion seems to have worked well , thanks to both of you for the help this will defiantly help in future :).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)