GLBasic forum

Main forum => GLBasic - en => Topic started by: mentalthink on 2011-Mar-05

Title: Where is the tutorial or file formake a movement of a car in 2D ?¿
Post by: mentalthink on 2011-Mar-05
Hi sometime ago, I donwload a library or a code Snipet, about a physics car in 2D, view from top.
Now I search on all the forum, but I don´t rebenber the name, or where is it?¿, anybody can helpe about searching this file, becuase I want use in a project.

thanks for your help and time.

Kinds Regards,
Iván J
Title: Re: Where is the tutorial or file formake a movement of a car in 2D ?¿
Post by: backslider on 2011-Mar-05
this one?

http://www.glbasic.com/forum/index.php?topic=3652.msg26555#msg26555

It´s german, but it should be no problem to understand it. :P

cheers
Title: Re: Where is the tutorial or file formake a movement of a car in 2D ?¿
Post by: mentalthink on 2011-Mar-05
Hi Backslider, thanks for the info, well I don´t remenber well if was this file, sorry, becuase I remenber, but I´m not sure, the code was more long and have more physics properties. Well but for begin my tests, I think this go well.

Thanks again for your time and search, backslider.

Kinds Regards,
Iván J
Title: Re: Where is the tutorial or file formake a movement of a car in 2D ?¿
Post by: Moru on 2011-Mar-06
A first fix for that example would be to stop the car from turning while it's standing still :-)

Code (glbasic) Select

IF (auto_spd > 0.1 OR auto_spd < -0.1) THEN INC auto_dir, KEY(203) - KEY(205)



And to make the steering a bit more natural for reverse:
Code (glbasic) Select

IF (auto_spd > 0.1) THEN INC auto_dir, KEY(203) - KEY(205)
IF (auto_spd < -0.1) THEN INC auto_dir, KEY(205) - KEY(203)

Title: Re: Where is the tutorial or file formake a movement of a car in 2D ?¿
Post by: mentalthink on 2011-Mar-06
Thanks Moru, I stay probing the code, I hope can made I want to do, but in 3D I think is a bit more complex.

Kinds Regards,
Iván.
Title: Re: Where is the tutorial or file formake a movement of a car in 2D ?¿
Post by: erico on 2011-Mar-06
code is really well done, quite short, I was trying to come up with such a code too, but sin cos fries my mind... thanks  :)

I guess a little time ago someone did a really good code snipet about sprite dealing with polyvectors, it was full of functions and quite complete, may work for this too!

I guess the thread is this one:
http://www.glbasic.com/forum/index.php?topic=5095.0
does it help?
Title: Re: Where is the tutorial or file formake a movement of a car in 2D ?¿
Post by: mentalthink on 2011-Mar-06
Hi Erico, thanks for your explanation.

I look the code was you put, well, I think can help me in some movements of the camera, thanks a lot.

Kinds Regards,
Iván J.