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 / determining position in a racing game

Author
Message
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 16th Jul 2005 10:53 Edited at: 16th Jul 2005 10:53
Ok after I finish the current project I am working on (which will be soon). I am going to try a racing game. I was wondering however, how to determine what position your in since the levels will not be straight they will have curves in them.

[Edit] This is in DBP

Formerly known as SFLM.
Pastry Like Dood
19
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 16th Jul 2005 13:04
I think this should be it, set up you car or whatever your going to use to race as an object (duh) and then try the following command;



SET CAMERA TO OBJECT ORIENTATION
This command will set the camera to the same direction as the specified 3d object. The object number must be an integer value.

--OR--

You might try the SET CAMERA TO FOLLOW command....



Set camera to follow might work better since it tracks the car or whatever is racing...
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 16th Jul 2005 18:07
Antidote,

You should be manipulating the values within variables, and then placing and orientating the car with those values. In doing this, you can always find the car's position and angles of rotation by referencing the variables.

However, if using some other means of positioning and rotating the car, by searching the help files included with DarkBasic(which you should always do FIRST when seeking for a type of command) you would have stumbled upon the following commands:

OBJECT POSITION X()
OBJECT POSITION Y()
OBJECT POSITION Z()

OBJECT ANGLE X()
OBJECT ANGLE Y()
OBJECT ANGLE Z()


Remember, always search the help files first.


+NanoBrain+
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 16th Jul 2005 22:41 Edited at: 16th Jul 2005 22:42
OK, let me refraise what I was asking help for. I know how to position the objects and everything but what i was asking was position in the race. Like in first place. since the tracks do not go in straight lines I can't say



Instead I have to do some kind of waypoint system. However, I was hoping that someone could assist me with another way if it is possible.

Formerly known as SFLM.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Jul 2005 22:50
Well I would setup 2 systems. One holds the value of how far each car moves in the forward direction each loop and compare these to get a rough estimate of who is where (remember to subtract when driving the wrong direction on the track) and use another system of actual distance from the finish line when on the final straight away.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 17th Jul 2005 02:27
i'd just do it with little checkpoints everywhere..

Your signature has been erased by a mod because it's larger than 600x120...

Login to post a reply

Server time is: 2024-09-23 23:31:32
Your offset time is: 2024-09-23 23:31:32