pixels collision

Get help using Construct 2

Post » Fri Oct 27, 2017 7:15 am

Hi, what plugin give me option "collision pixel"? i dont need polygon sprite collision..

example

pixels "sprite A" collision pixels"sprite B" set value on "1"
B
10
S
4
G
1
Posts: 29
Reputation: 898

Post » Fri Oct 27, 2017 7:30 am

Not sure I understood your question.
If you want to compare two coordinates you can create this event:

Int(pixA.x)=Int(pixB.x)
Int(pixA.y)=Int(pixB.y)
System->Trigger once


Or do you mean you need to detect when two sprite images (not collision polygons) are collided?
I don't think it's possible.
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
17
S
9
G
126
Posts: 1,752
Reputation: 67,325

Post » Fri Oct 27, 2017 10:40 am

Bare minimum you'd need to be able to read individual pixels of an image. The canvas plugin is the only addon that provides that. Then it's a matter of using any old pixel perfect collision detection online. You can also find a few examples on the forum with a search.
B
94
S
33
G
128
Posts: 5,489
Reputation: 81,541

Post » Fri Oct 27, 2017 10:59 am

I should have said "it's not easily done" :)

@brair_user, why can't you use the collision polygon? If you need it for something else, then you can try this workaround:
Create an invisible clone of the sprite, Pin it to the main sprite, define correct collision polygon on the clone sprite and use it for collision detection.
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
17
S
9
G
126
Posts: 1,752
Reputation: 67,325

Post » Mon Nov 13, 2017 7:02 am

when i finish my project i show you:) then you maybe can help me. But Thanks for replay
B
10
S
4
G
1
Posts: 29
Reputation: 898


Return to How do I....?

Who is online

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