Сollision object

Get help using Construct 2

Post » Thu Dec 25, 2014 7:26 pm

I have 3 sprite, which overlap each other, we can say they are the same width and X is the same. There are bullet sprite. I made a condition that the collision ("on collision") With any of these sprites (one event through "or") Bullet destroyed and taken away from the Live variable 35.
So, if the bullet hits the point of overlap of the 3 sprites, then the variable will be taken away three times the number is 105.
Can somehow fix it?
Tried and family to do all the sprites and check for collision with the family, does not help. Just trying to make a variable that is set to 0 when the bullet collides with sprites and after some time it becomes equal to 1, and that only when variable = 1, only consuming 35 did not help. Tried to make and through Overlapping and Trigger Once, all also did not work.
Can I somehow fix it and make that would take up only 35 in each collision, and no matter how many bullet grazed sprites?
B
3
Posts: 8
Reputation: 193

Post » Thu Dec 25, 2014 11:30 pm

try "pick top instance" as a condition with the collision.

What's the point of the game?

You can fix it also by disabling collisions for all overlapping sprites for like 0.2 seconds when a bullet collides with one of them.
You can also put the condition inside a groupe and disable the group for 0.2 seconds on collision.


Also i advise puttin those overlapping sprites in a family instead of using OR statements and try with trigger once.


The best wat is to post your commented capx tho
B
9
S
3
G
1
Posts: 128
Reputation: 1,116

Post » Thu Dec 25, 2014 11:41 pm

@Uniform you can't combine On collision with Trigger once because On collision already triggers only once per collision.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Dec 25, 2014 11:47 pm

codah wrote:@Uniform you can't combine On collision with Trigger once because On collision already triggers only once per collision.


right codah. Is overlapping+trigger once or just on collision
B
9
S
3
G
1
Posts: 128
Reputation: 1,116

Post » Fri Dec 26, 2014 12:17 am

C2 will let you do Is Overlapping + trigger once but then that's like On Collision

edit: I take it back, looks like overlapping + trigger once is your answer @alexheg

try this
collision_test.capx
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Fri Dec 26, 2014 2:57 pm

codah
Thank you, it helped.
It is a pity that another problem still remained. The problem is that I have 2 copies of the enemy with the private variable "Lives". And if I do so as in the screenshot, then life is taken away from both in contact with only one, with generally unknown as it is taken away, the double-triple number...

Image
B
3
Posts: 8
Reputation: 193

Post » Sat Dec 27, 2014 7:42 am

You need to do further picking to isolate a single Enemy. Something like Enemy(0) or picking top instance, or similar.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: Apollo14, MaujDeveloper and 3 guests