I'm using Chipmunk-js for my game to be compatible with all devices.
I'm trying to move a sensor SegmentShape to detect collisions with it and act upon them, here's what im doing :
This is working for html5 but when i run it on iOS it stops working (the shape gets initialised but cannot be moved afterwards). Whats the way around this to make it compatible with iOS ?
Shapes that are added to a static body are static and their collision detection information is not automatically updated each frame.
You have two options:
1) Attach the shape to a rogue body, a non-static body that is not added to the space. The body's position and velocity won't be updated each frame unless you do it yourself, but the shape's collision detection information will.
2) Call one of the cp.spaceReindex*() functions to manually tell Chipmunk to update the shape's collision detection information.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/