How do I manage families instances

Get help using Construct 2

Post » Sat Feb 27, 2016 9:11 pm

hi guys, I have a enemy problem. If my player collides with 2 enemies in the same time ( enemies are in families), 2 lifes are subtracted, and two sound effects are played ( louder). But I would like only 1 life subracted... how can I do that ?
thanks
B
37
S
16
G
2
Posts: 447
Reputation: 4,865

Post » Sat Feb 27, 2016 9:16 pm

Should work (not tested)
You could use a timer. When colliding with enemy set the player to invincible - like old games where your player flashes for the next 2 seconds.

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Sat Feb 27, 2016 10:00 pm

You can pick instance 0. That will limit the actions to one enemy.
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Sun Feb 28, 2016 8:14 am

thanks to all.... how shall i manage the pck instance 0 ? sorry iam not so good in C2
B
37
S
16
G
2
Posts: 447
Reputation: 4,865

Post » Sun Feb 28, 2016 4:28 pm

Actually that doesn't work, so a variation of the temporarily-invincible idea, this will disable subsequent collisions, only for the duration of the same collision time-frame.
www.blackhornettechnologies.com/Constru ... sions.capx

Drag the green sprite over the red sprites. Just one will rotate. (If you keep trying they both will, but only because you aren't actually colliding at the same time, which is the correct behaviour).
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Mon Feb 29, 2016 8:24 pm

thanks 4 Ur help :)
B
37
S
16
G
2
Posts: 447
Reputation: 4,865


Return to How do I....?

Who is online

Users browsing this forum: lahbach and 27 guests