Howdy.
Im a new box2d user. And also a relatively new user of as3 (so far i just finished a game with a lot of complicated code like newbs).
But i have a question though.
Knowing that i use box2d 2.02:
How do i add friction to a circle shape since i understood for what i read that circle isnt affected by friction? so far my code for circle body and shape looks like this:
Code:
var ballSprite:Sprite=new Ball();
parent.addChild(ballSprite);
var ballShapeDef:b2CircleDef=new b2CircleDef();
ballShapeDef.radius=45/(2 * Vals.RATIO);
ballShapeDef.density=1.0;
ballShapeDef.friction=0.9;
ballShapeDef.restitution=0.3;
var ballBodyDef:b2BodyDef=new b2BodyDef();
ballBodyDef.position.Set(location.x/Vals.RATIO, location.y/Vals.RATIO);
var ballBody:b2Body;
ballBody=Vals.world.CreateBody(ballBodyDef);
ballBody.CreateShape(ballShapeDef);
ballBody.SetMassFromShapes();
ballBody.m_angularDamping=0.01;
var velocityVector:b2Vec2=new b2Vec2(initVel.x/Vals.RATIO, initVel.y/Vals.RATIO);
ballBody.SetLinearVelocity(velocityVector);
super(ballBody, ballSprite);
I mean my ball falls to the ground but it just goes on and rotate till it hits another body and then because of angular damping it ll slow a bit but still if it has the slightest movement going, it will continue to move.
Thanks for having the patience to read such insolent question.
