I wanna get collision detection between AnimatedSprite which is Body of box2d and Shape.I'm using codes below.But it gives error. "walls" is a rectangle shape, "player" is animatedsprite.
scene.registerUpdateHandler(new IUpdateHandler() {
public void reset() { }
public void onUpdate(final float pSecondsElapsed) {
if(walls.collidesWith(player)) {
walls.setColor(1, 0, 0);
} else {
walls.setColor(0, 1, 0);
}
if(!mCamera.isRectangularShapeVisible(player)) {
walls.setColor(1, 0, 1);
}
}
});