Why do i get a crash with this code:
shipSprite = [CCSprite spriteWithFile:@"temp.png"];
cpBody* ship = cpBodyNew(200.0, INFINITY);
ship->p = cpv(150, 100);
cpSpaceAddBody(space, ship);
CGPoint verts[] = {
ccp(-50,-25),
ccp(-50, 25),
ccp( 50, 25),
ccp( 50,-25),
};
cpShape* shipShape = cpPolyShapeNew(ship, 4, verts, cpvzero);
shipShape->e = 0.8;
shipShape->u = 0.8;
shipShape->data = shipSprite;
shipShape->collision_type = 1;
cpSpaceAddShape(space, shipShape);