How do I apply variables to families correctly?

Get help using Construct 2

Post » Sun Feb 17, 2013 11:27 am

Right now I have this situation:

I have a family with 3 different types of sprites.
Each sprite has its own healthbar (not a family variable) which is ticking away slowly every second or so.
I now want to randomly spread them across several spawnpoints (works as intended).
The play now has to run from one character to the next, to fill up their healthbar. What happens now however is, that if I heal "Character01", EVERY "Character01" gets healed instead of only that one certain Character01.

While this makes totally sense, I don't get how I can make it work so I only heal that one certain Character01 and not the others.Suro2013-02-17 11:30:42
B
18
S
5
Posts: 22
Reputation: 2,346

Post » Sun Feb 17, 2013 2:53 pm

You need a condition to pick one particular Character01. Like you might use the pick nearest condition to heal the one nearest the player:
[code]
+Character01: Pick nearest to Player.X, Player.Y
   -> Heal Character01
[/code]
Or to heal the one the mouse is over:
[code]
+Mouse: Cursor is over object Character01
   -> Heal Character01
[/code]
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020


Return to How do I....?

Who is online

Users browsing this forum: emoticon, KeetonCat, makkancs, Matthew de and 28 guests