Multi-Health variables

Get help using Construct 2

Post » Thu Sep 05, 2013 5:20 pm

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.
B
6
S
1
Posts: 51
Reputation: 525

Post » Thu Sep 05, 2013 10:29 pm

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.
B
17
S
4
G
4
Posts: 143
Reputation: 4,004

Post » Thu Sep 05, 2013 11:30 pm

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.
B
10
S
4
G
1
Posts: 58
Reputation: 1,420

Post » Fri Sep 06, 2013 2:10 pm

ok the first suggestion seems to have worked well , thanks to both of you for the help this will defiantly help in future :).
B
6
S
1
Posts: 51
Reputation: 525


Return to How do I....?

Who is online

Users browsing this forum: Colludium, David181, plinkie and 18 guests