hello i want to make a side way car game but i am struggling with the suspension i want the physics behaviours to feel like the second example at the link below
<font color=red>emanueleferonato DOT com/2009/04/06/two-ways-to-make-box2d-cars/</font>
i downlanded some example and behaviors in tutorial section but no luck until i find out that i need a prismatic joint so i tried to ("hack") the official physics behaviours by adding this code i just figured out:
var B2PrismaticJointDef = function( bA , bB , anchorA , anchorB , axis) {//me
[code]
?this.type = B2Joint.e_revoluteJoint ;
?this.localAnchorA = new B2Vec2() ;
?this.localAnchorB = new B2Vec2() ;
?this.localAxisA = new B2Vec2();//me
?this.userData = null ;
?if( bA !== undefined ){this.bodyA = bA ;}
?if( bB !== undefined ){this.bodyB = bB ;}
?if( anchorA !== undefined){this.localAnchorA.SetV(anchorA) ;}
?if( anchorB !== undefined){this.localAnchorB.SetV(anchorB) ;}
if( axis !== undefined ){this.localAxisA.SetV(axis) ;}//me
?
?//me
?this.enableLimit=false;
?this.enableMotor=false;
?this.lowerTranslation=0.0;
?this.maxMotorForce=0.0;
?this.motorSpeed=0.0;
?this.referenceAngle=0.0;
?this.upperTranslation=0.0;
?//me
};
B2RevoluteJointDef.prototype.Initialize = function (bA, bB, anchor,axis) {
?this.bodyA = bA;
?this.bodyB = bB;
?this.localAnchorA = this.bodyA.GetLocalPoint(anchor);
?this.localAnchorB = this.bodyB.GetLocalPoint(anchor);
?this.referenceAngle = this.bodyB.GetAngle() -this.bodyA.GetAngle();
this.localAxisA = this.bodyA.GetLocalAxis(axis);
};
Box2D.Dynamics.Joints.b2PrismaticJointDef = b2PrismaticJointDef ;
in runtime.js
"still also need to add some code to the edit.js"
<img src="smileys/smiley18.gif" border="0" align="middle" />
WEL it didnt work <img src="smileys/smiley19.gif" border="0" align="middle" /> what am i doing wrong please help me evry one<img src="smileys/smiley9.gif" border="0" align="middle" />
ps:excuse my english and thank you in advance