How do I subtract enemy health seperately

Get help using Construct 2

Post » Sat Jun 27, 2015 12:53 am

Hi,

I make a game to spawn different enemy, enemy's health will decrease when it is on collision with character, but the problem is when the collision one decrease health as the well as others without collision with character, sorry for english is not well, someone knows how to solve this , please help

file: https://www.dropbox.com/s/sl6alheyr09do ... .capx?dl=0

thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Sat Jun 27, 2015 5:45 am

Hello friend, your code is working just fine. The enemy takes only 10 damage and the other enemies keep their full health. The problem is that all the EnemyHpBg change sizes. To avoid that you need to specify which HP bar you want to change, otherwise it will be applied to all of them.

Here, this shall work:
Image
B
17
S
7
Posts: 280
Reputation: 2,522

Post » Sat Jun 27, 2015 6:07 am

@RayKi thanks Rayki, my problem is like you said, so how to specify the HP bar? thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Sat Jun 27, 2015 7:36 am

Just do like I showed you on the image o-o
B
17
S
7
Posts: 280
Reputation: 2,522

Post » Sat Jun 27, 2015 7:36 pm

got it, thanks
B
11
S
3
Posts: 172
Reputation: 1,178


Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 23 guests