static cpBool scorecollision(cpArbiter *arb, cpSpace *space, void *data) { cpShape** a = new cpShape*; cpShape** b = new cpShape*; cpArbiterGetShapes(arb, a, b); Ship* s = 0; Shell* sh = 0; if (cpShapeGetCollisionType(*a) == 1) { s = (Ship*)cpShapeGetUserData(*a); sh = (Shell*)cpShapeGetUserData(*b); } else { s = (Ship*)cpShapeGetUserData(*b); sh = (Shell*)cpShapeGetUserData(*a); } s->score -= 1; s->target->score += 2; listappend<Shell*>(rshell, nrshell, sh); return cpTrue; }
int CCPhysicsShape::getCollisionType(void) { return (int)cpShapeGetCollisionType(m_shape); }
cpCollisionType shape::collisionType( void ) { return cpShapeGetCollisionType( this->m_shape ); }