Where is the tutorial or file formake a movement of a car in 2D ?¿

Previous topic - Next topic

mentalthink

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

backslider


mentalthink

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

Moru

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)


mentalthink

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.

erico

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?

mentalthink

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.