Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Car Turning

Author
Message
Tv Xxx
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 11th Dec 2007 00:45
Hi and Thanks In Advance.

I'm Having Trouble At The First Step Of My Car Game "Car-Struction", I Have Done Acceleration and Deceleration But Turning Won't Work. So Heres My Code ...



And Also I Have Attached A .Zip Version Including The Car Model.

Yours Tv

<a href = "http://tv_xxx.freespaces.com"><img src="http://signatures.mylivesignature.com/54485/257/30DD50C00B13CFA0CA5A1A58A2D175CD.png"></a>

Attachments

Login to view attachments
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 11th Dec 2007 02:27 Edited at: 11th Dec 2007 12:43
The Speed# thing is the right idea for acceleration + deceleration. The thing is that you aren't taking into consideration the car's rotation when moving. The Z axis never changes no matter which way the car is facing. As a result, your rotating of the car object doesn't do anything for the car's directional movement. You may want to have a look at the following commands:

MOVE OBJECT object, distance

NewXValue(Current X Position, angle, distance)

NewYVAlue(Current Y Position, angle, distance) <--- Won't help much with your current situation...

NewZValue(Current Z Position, angle, distance)

Those commands all take into consideration an object's angle when doing movement. NewXValue, NewYValue (again it might not be helpful at this time) and NewZValue return values and should be used together. Let me know if you need any help. Just write any of those commands and press F1 on it for help.

Good luck

Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 11th Dec 2007 04:19
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 11th Dec 2007 04:24 Edited at: 11th Dec 2007 14:35
@Sixty Squares

Are these commands in the DarkBasic Professional package?

edit:

Ok. I found them. It seems I have wasted a lot of time doing all of my own motion tracking.


Whatever...
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 11th Dec 2007 12:43
@Dabbler: I believe so, I use them all the time.

Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 11th Dec 2007 14:55
@Tv Xxx

I made the following substitution in your code:



It seems to work better this way.


Whatever...

Login to post a reply

Server time is: 2024-11-25 10:00:17
Your offset time is: 2024-11-25 10:00:17