Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
int CCPhysicsShape::getCollisionType(void)
{
    return (int)cpShapeGetCollisionType(m_shape);
}
Exemplo n.º 3
0
		cpCollisionType shape::collisionType( void ) {	return cpShapeGetCollisionType( this->m_shape );	}