Car Physics

Posted By: Sorrowful

Car Physics - 06/22/12 12:38

Code:
VECTOR araba_git;

ENTITY* tekeronsol;
ENTITY* tekeronsag;
ENTITY* tekerarkasol;
ENTITY* tekerarkasag;

action tekeronsl()
{
  tekeronsol = me;	
  pXcon_setparams1(me,araba_git, NULL, NULL);
}
action tekeronsg()
{
  tekeronsag = me;	
  pXcon_setparams1(me,araba_git, NULL, NULL);
}
action tekerarkasl()
{
  tekerarkasol = me;	
  pXcon_setparams2(me,araba_git, NULL, NULL);
}
action tekerarkasg()
{
  tekerarkasag = me;	
  pXcon_setparams2(me,araba_git, NULL, NULL);
}

action araba_ac()
{
	player = me;
	pXent_settype(me,PH_RIGID,PH_BOX);
	pXcon_add(PH_WHEEL,tekerarkasag,my,0);
   pXcon_add(PH_WHEEL,tekerarkasol,my,0);
   pXcon_add(PH_WHEEL,tekeronsag,my,0);
   pXcon_add(PH_WHEEL,tekeronsol,my,0);
	while(1)
   { 
   pXcon_setwheel(tekeronsol,-5,0,0);
   pXcon_setwheel(tekeronsag,-5,0,0); 
   pXcon_setwheel(tekerarkasol,0,500,0);
   pXcon_setwheel(tekerarkasag,0,500,0);
   pXent_move(me,araba_git,nullvector);
   araba_git.x = (key_w-key_s)*40*time_step;
   araba_git.y = (key_a-key_d)*20*time_step;
   camera.x = me.x;
	camera.y = me.y - 300; 
	camera.z = 650; 
	camera.tilt = -10;
  	wait(1); 
  	}
}

function main()
{
	physX_open(); 
	video_mode = 9;
   video_screen = 1;
	level_load("BasGaza.wmb");
}





car is moving only,wheels do not move and is not mounted on wheels...
Posted By: Sorrowful

Re: Car Physics - 06/24/12 14:53

Help..
Posted By: 3run

Re: Car Physics - 06/24/12 14:54

Edit: use A8 car template
Posted By: Sorrowful

Re: Car Physics - 06/24/12 14:57

I want to learn with make...
Posted By: 3run

Re: Car Physics - 06/24/12 15:51

You can learn from it as well, and it will be much easier to learn from already working example. I've learned myself from it as well. There is no one will make up a demo with your script from scratch to test it and to find what you've done wrong. Believe me, the best way for you will be to learn from car template.
Posted By: Sorrowful

Re: Car Physics - 06/24/12 17:36

OK Thanks..
Posted By: painkiller

Re: Car Physics - 06/24/12 19:17

or take a look to the knightsonwheels.c sample
Posted By: Sorrowful

Re: Car Physics - 06/24/12 20:00

ent_create("vehicle_1.mdl",terrain_pos(NULL,300,0,30),knight_on_wheels);

vehicle_1.mdl where??
Posted By: 3run

Re: Car Physics - 06/24/12 20:05

It's taken from the ".wrs" archive. You won't be able to find it. Insert your own vehicle, and change the wheel positions.
Posted By: Sorrowful

Re: Car Physics - 06/24/12 20:41

OK.Thanks All.
© 2024 lite-C Forums