Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work with Sprites #6

Open
RichieLoco opened this issue Oct 3, 2014 · 4 comments
Open

Doesn't seem to work with Sprites #6

RichieLoco opened this issue Oct 3, 2014 · 4 comments

Comments

@RichieLoco
Copy link

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
Copy link
Author

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

@olsn
Copy link
Owner

olsn commented Oct 6, 2014

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.

@RichieLoco
Copy link
Author

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

@MRechtien-zz
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants