Hey all,
So i am working on a game that constantly crashes without anything coming up in the logs other than the debugger info.
What im doing is loading an atlasSprite. Then adding a body with chipmunk using:
int num = 4;
cpVect butchVerts[] = {
cpv(-24,-24),
cpv(-24, 24),
cpv(24, 24),
cpv(24,-24),
};
body = cpBodyNew(1.0, cpMomentForPoly(1.0, num, butchVerts, cpv(0,0)));
body->p = player1Sprite.position;
cpSpaceAddBody(space, body);
cpShape *shape = cpPolyShapeNew(body, num, butchVerts, cpv(0,0));
shape->e = 0.0; shape->u = 1.0;
cpSpaceAddShape(space, shape);
and then running a scheduler thats my main loop:
[self schedule: @selector(mainLoop:) interval: 1.0 / 60.0];
The main loop is :
-(void) mainLoop: (ccTime) delta
{
body->p = player1Sprite.position;
}
after that i have my touches method to move the sprite
In the debugger if i hit continue it displays:
Program received signal: “EXC_BAD_ACCESS”.
it displays the sprite fine but right after that it freezes and crashes so i cant move the sprite
Any ideas?
Thanks
-Lars