Hi,
This is my third question today, sorry, but i have only this 3 questions that i dont find answer.
Now i need know how to make a pixel perfect collision detection.
Can anyone help me?
I see some very complex solutions, i think that have a simple to do it.
Can anyone give some examples, links, tutorials, source projects?
Thanks.
Wuhao
May 30, 2012, 7:40am
2
Can you provide an example where you want the pixel based collision detection be?
You can get my project here:
Android version:
http://www.prsolucoes.com/flyforcoins/flyforcoins-cocos2dx.apk
I want check player vs objects (the mill in my game)
save the texture transparent infomation and use it for collision detection;
Do you have an example or tutorial? Or a sample project about it?
Have a look at this:
http://www.gmtdev.com/blog/2011/08/19/how-to-use-box2d-for-just-collision-detection-with-cocos2d-x/
It’s using Box2D with the physics turned off, just the collision detection. You define collision areas with something like “VertexHelper”. Works a treat, is fast, see my game
Hi,
There is any utility to create the verts?
Ty.
Yeah there are a few, some cost cash now tho:
Vertexhelper: http://itunes.apple.com/ca/app/vertexhelper-pro/id411684411?mt=12
Physics editor (the trace feature): http://www.codeandweb.com/physicseditor
There are probably some free things, have a google.
Read the turtorial, it says in there too.
Hi,
I buy VertexHelper now.
Im trying create the verts, but when i use, i get exception here:
b2Assert(area > b2_epsilon);
See the screenshot (attached on post). All the verts that i create i got exception What im doing wrong?
Im using a sample verts from the cocos sample project and it works (the sample verts are from your link from gmtdev).
There is a logical structure for it? (the original size of my sprite is 149 x 236) on screenshot it is with zoom.
GMTDev
June 1, 2012, 4:40am
10
You have to go anti clockwise
Other test that doesnt works!
Look the error attached!
Wow!
Now i do it correct. I only translate your “clockwise”, i forgot the “anti”
Now it is working man, very thanks!
GMTDev
June 1, 2012, 4:54am
15
Cool, yeah, in the other direction.
Everything is working nice now!
thanks all.