Collision-Detection-for-EaselJS icon indicating copy to clipboard operation
Collision-Detection-for-EaselJS copied to clipboard

Doesn't seem to work with Sprites

Open RichieLoco opened this issue 10 years ago • 4 comments

This works fine with images but not at all with Sprites. I'm just trying to get something working using Squares at the moment. Any plans to fix?

RichieLoco avatar Oct 03 '14 16:10 RichieLoco

I should also mention that I'm using checkRectCollision function. Not checkPixelCollision. Many thanks in advance!

RichieLoco avatar Oct 03 '14 16:10 RichieLoco

You'll have to be a little bit more specific than that - or even better post a jsfiddle with your issue.

The detection only works on loaded images - just in case you are using canvas-operations(draw rect) to create your object, this will not work.

olsn avatar Oct 06 '14 08:10 olsn

Morning, apologies for being rather vague... I was on the move and just wanted to get a message out quickly when I should have been more thorough. As you mentioned, I was drawing vector shapes (a rect, to be exact). I have actually managed to get it working though. Im busy at work at the moment, I'll go into depth on what I did change when I'm out of the office

RichieLoco avatar Oct 06 '14 08:10 RichieLoco

Hi, I'm actually using checkPixelCollision with sprites! It seems to work 'partly': without digging deep down the source - when checking against straight shapes it works very good indeed, but I have problems with rounded shapes. See attached files where the red-white "walls" are partly straight, partly rounded. The rounded areas do not (always) work when checking collision.

Markus

sceenshot

MRechtien-zz avatar Nov 20 '15 20:11 MRechtien-zz