Okay,
car itself seems to work.
Now iam stuck at the steering.
Wheels(front wheels) turn left/right according to key input, no problems.

But sometimes they dont turn smoothly, they flip over.

This is my code:

Code:
function control_car()
{
	float max_angle = 0;
	float stear_control = 0;
	while(1)
	{
		stear_control = (key_d-key_a);
		max_angle += stear_control*20*time_step;
		max_angle = clamp(max_angle,-30,30);
		if(stear_control != 0)
		{
		phcon_setparams2(my.con_a,vector(max_angle,max_angle,0),nullvector,nullvector);	
		phcon_setparams2(my.con_b,vector(max_angle,max_angle,0),nullvector,nullvector);	
		}else{
		max_angle = max_angle*(1-0.5*time_step);
		if(abs(max_angle) < 1)
		{
			max_angle = 0;
		}	
		phcon_setparams2(my.con_a,vector(max_angle,max_angle,0),nullvector,nullvector);	
		phcon_setparams2(my.con_b,vector(max_angle,max_angle,0),nullvector,nullvector);	
		}
		temp.x = (key_w-key_s)*1000;
		phcon_setmotor(my.con_a,nullvector,vector(-temp.x,100,0),nullvector);
		phcon_setmotor(my.con_b,nullvector,vector(-temp.x,100,0),nullvector);
		phcon_setmotor(my.con_c,nullvector,vector(-temp.x,100,0),nullvector);
		phcon_setmotor(my.con_d,nullvector,vector(-temp.x,100,0),nullvector);	
		wait(1);
	}	
}



con_a is front_Left wheel
con_b fron right
con_c back left wheel
con_d back right wheel

MAybe someone can help me to get the steering working correct?


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development