katetem / cakejs

Automatically exported from code.google.com/p/cakejs
0 stars 0 forks source link

How to do hit test with Cake.js #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am making a mini game with cake.js and I have to do some hit test to detect, 
for example, collision of two rectangles.

I don't know if cake.js has been built in with such features, or i have to 
implement my own versions?

Original issue reported on code.google.com by robi...@gmail.com on 22 Oct 2010 at 6:21

GoogleCodeExporter commented 9 years ago
Hit testing will have to be implemented independently. 
CanvasNode.getBoundingBox() can be used to retried a drawables bounding box at 
any point that may be a good start for hit testing. Past that, you will have to 
implement your own logic. I've had some success with JS versions of Box2D, 
although it can have surprising overhead...

Original comment by crgod...@gmail.com on 6 Feb 2012 at 4:55