I have just started working with cocos2d and box2d for iOS SDK, and have a few problems. I got the templates working, and got the test app (the one where you click the screen and a box with a random letter appears) to compile.
My first problem is that I can't figure out how to get a blank template. Is there a quick way to do this when I begin a new app?
My second problem is that I can't figure out how to just simply change the color of an object. I can define something like this:
b2BodyDef bodyDef;
bodyDef.type = b2_dynamicBody;
bodyDef.position.Set(p.x/PTM_RATIO, p.y/PTM_RATIO);
b2Body *body = world->CreateBody(&bodyDef);
b2CircleShape circle;
circle.m_radius = .5f;//These are mid points for our 1m box
b2FixtureDef fixtureDef;
fixtureDef.shape = &circle;
fixtureDef.density = 1.0f;
fixtureDef.friction = 0.1f;
fixtureDef.restitution = 0.3f;
body->CreateFixture(&fixtureDef);
But is there a simple way to make something a certain color?
Final question: does this sample app have the accelerometer-gravity enabled?
Thanks!