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.

DarkBASIC Discussion / Distances

Author
Message
AlexI
20
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 5th Mar 2005 02:24
distance commands are there any or anything. i have a third person game i want it so that when you come with in .... of the object it makes something happen.
my two objects are

player 1001 (its a helecopter)
1006 enemy helecopter

something like this
if (what do i put here) then .......................
bibz1st
22
Years of Service
User Offline
Joined: 2nd Jan 2003
Location:
Posted: 5th Mar 2005 03:39
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 5th Mar 2005 04:25
Yeah, distance is teh square root of the difference in x/y/z values squared.

eg

sqrt ( dx^2 + dy^2 + dz^2 )

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
AlexI
20
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 6th Mar 2005 03:03 Edited at: 6th Mar 2005 03:04
idea
i could just do something like.
[i] if object position(my object) x > (distace) then ..........
if object position(my object) y > (distace) then ..........
if object position(my object) z > (distace) then ........

Login to post a reply

Server time is: 2025-05-23 19:20:44
Your offset time is: 2025-05-23 19:20:44