how do i pin instances ?

Get help using Construct 2

Post » Sat Oct 07, 2017 6:44 pm

i am trying to pin a hp to every enemy. There are several instances of enemies, and several types, how do i pin one hp bar to every enemy on the layout, and how do i make them spawn together? (Note: i need all hp bars to be instances of one object, but enemies to be different objects, with several instances) For example i have 5 instances of enemy A and 4 instances of enemy B i need 9 instances of hp bar , each assigned to one enemy, and i want them to spawn together
B
8
Posts: 54
Reputation: 539

Post » Sat Oct 07, 2017 7:46 pm

But the enemies into a family. Then have an event 'on family created, create HP bar'.
B
48
S
19
G
87
Posts: 2,317
Reputation: 51,518

Post » Sat Oct 07, 2017 8:47 pm

Hey @Matei511!

Like @plinkie said above, the best way, in my opinion, would be a Family that includes all enemies and the following events:

Code: Select all
enemyFamily On Created
   enemyFamily spawn object hpBar at imagepoint("hp bar")
   hpBar pin to enemyFamily
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 717
Reputation: 3,996

Post » Sun Oct 08, 2017 7:11 am

plinkie wrote:But the enemies into a family. Then have an event 'on family created, create HP bar'.

@brunopalermo thanks a lot guys! Works like a charm!
B
8
Posts: 54
Reputation: 539


Return to How do I....?

Who is online

Users browsing this forum: adventurist, Google [Bot] and 63 guests