How do I Destroy Both Colliding Objects

Get help using Construct 2

Post » Fri Dec 15, 2017 11:12 pm

I am trying to make borders on a sprite to keep the player inside of it. The borders are 4 separate objects and when they collide, they must destroy themselves. So if 2 of that object are next to each other, the player should be able to walk between objects, but not outside of them, like if you were mining, you cant go outside the mine because there is a solid, but of you destroy more, you can walk more. If you have a more efficient way of doing what I am trying to do, please tell me :D (Even if it means I need to start over).
Owner of Kdot Development.
https://kdotdev.weebly.com
B
15
S
6
G
1
Posts: 64
Reputation: 1,777

Post » Sat Dec 16, 2017 3:09 am

Sorry, I'm not sure I understand.
These 4 objects - are they like 4 walls in a room, and player can walk between these walls?
Or are they like 4 invisible boxes attached to the player from each side, used to detect collisions?

Which objects do you want to destroy and when?
It would also help a lot if you share your capx.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
18
S
9
G
158
Posts: 2,364
Reputation: 84,330

Post » Sat Dec 16, 2017 8:53 pm

So, there is one object and the player cannot leave it, like a wall. But if it adds more "territory" the player can walk between the two objects. The two objects when placed next to each other adds on to the "territory". The objects have their own borders but what I want is: When two objects go next to each other, the border between them disappear so the player may walk in both. Like: If you are restricted to one area, but you earn more area, you can walk more places. I hope this makes sense.
Owner of Kdot Development.
https://kdotdev.weebly.com
B
15
S
6
G
1
Posts: 64
Reputation: 1,777

Post » Sat Dec 16, 2017 8:54 pm

|--------------|
|--------------| +
|--------------|
|__________|

|--------------|
|--------------| =
|--------------|
|__________|

|-----------------------------|
|-----------------------------|
|-----------------------------|
|_____________________|
Owner of Kdot Development.
https://kdotdev.weebly.com
B
15
S
6
G
1
Posts: 64
Reputation: 1,777

Post » Sat Dec 16, 2017 8:56 pm

The borders stick off of the objects a little but, so when another border touches, they destroy both of the borders, thus allowing the player to walk through the border to the other territory.
Owner of Kdot Development.
https://kdotdev.weebly.com
B
15
S
6
G
1
Posts: 64
Reputation: 1,777

Post » Sat Dec 16, 2017 9:06 pm

Image

I want it so I cant pass through the stone, but when two of those objects are touching, then you can pass through the side they are touching.

Oh, and here is the CAPX: https://www.dropbox.com/s/zbt0pzhdtz48oiv/Hide.capx?dl=0 Dont mind all the animation stuff, just look in the Borders Group in the Event Sheet.

Sorry for the multiple comments :)
Owner of Kdot Development.
https://kdotdev.weebly.com
B
15
S
6
G
1
Posts: 64
Reputation: 1,777

Post » Sun Dec 17, 2017 4:59 am

Ok, try this:
https://www.dropbox.com/s/ak58r1s91gkd9 ... .capx?dl=0

Is this what you are trying to make? You can add more yellow sprites during the game, extending the area. Just position then exactly next to the existing yellow sprite, without gaps.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
18
S
9
G
158
Posts: 2,364
Reputation: 84,330

Post » Sun Dec 17, 2017 1:12 pm

This is pretty much what I am looking for :D. Thank You! I will now try to implement this into my game.
Owner of Kdot Development.
https://kdotdev.weebly.com
B
15
S
6
G
1
Posts: 64
Reputation: 1,777

Post » Sun Dec 17, 2017 1:28 pm

Owner of Kdot Development.
https://kdotdev.weebly.com
B
15
S
6
G
1
Posts: 64
Reputation: 1,777

Post » Sun Dec 17, 2017 2:09 pm

Set acceleration and deceleration to 10000 for sharper controls.
Also you should probably remove Platform behavior, since you are using 8-Direction.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
18
S
9
G
158
Posts: 2,364
Reputation: 84,330

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests