I don't want the corners of a square part of a collision

Get help using Construct 2

Post » Thu Jan 15, 2015 2:04 am

If two square objects are touching corners, they are considered colliding. I don't want that.
squares.png


I only want them to be considered colliding, if they are side by side.
squares2.png


How do I do that? Thank you.
You do not have the required permissions to view the files attached to this post.
B
7
S
2
Posts: 34
Reputation: 670

Post » Thu Jan 15, 2015 2:07 am

You can check their Y coordinates are equal and use that condition along with on collision. Same with X if you want them to stack.
B
62
S
20
G
56
Posts: 1,077
Reputation: 36,021

Post » Thu Jan 15, 2015 3:36 am

Hi Doomeyes,

Yes I think checking the coordinates is probably the answer.

I have made a very rough capx file, which only incorporates one side, a drag and drop to help with the idea based and only on on y so you need a lot more smarts in there, but it may help? That's if this is what you wanted as I was not quite sure :)

sidebyside.capx


Cheers
You do not have the required permissions to view the files attached to this post.
B
6
S
2
Posts: 38
Reputation: 567

Post » Thu Jan 15, 2015 5:05 am

Alternatively You can do this:
First adjust the collision poly so it looks like >> Image

Then set overlapping condition:
Image

If 4 side/direction are desired, change value 180 into 90 that represent angle variable. For more clarity how many loops must be iterate, add condition "For" and set value from 0 to 1 or 3.
Last edited by alextro on Thu Jan 15, 2015 5:36 am, edited 1 time in total.
ImageImage
B
114
S
51
G
24
Posts: 790
Reputation: 23,480

Post » Thu Jan 15, 2015 5:13 am

You could just change the collision polygon to not include the corners.
ImageImageImage
B
71
S
22
G
257
Posts: 3,790
Reputation: 142,696

Post » Thu Jan 15, 2015 5:15 am

Umm. That's a good idea blackhornet and probably what the poster is looking for. Didn't think of that :(
B
6
S
2
Posts: 38
Reputation: 567

Post » Thu Jan 15, 2015 6:27 am

The thing is, those two stages do not describe the problem properly. The question is, how they should react in between those stages? Depending on that, there can be different solutions.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Fri Jan 16, 2015 1:03 pm

Thank you all for your help. I appreciate your time. I will play around with all of these and see which works best for what I am trying to do.
B
7
S
2
Posts: 34
Reputation: 670


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests