Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Math.Distance
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Prognosis




PostPosted: Sat Jan 21, 2006 7:46 pm   Post subject: Math.Distance

Im making a program about lazer-sphere colision, and I think i need to use Math.Distance. only problem is that when i put it into turing, it says " 'Distance' is not in the export list of Math". Could someone please tell me why this isnt working.. i have version 4.04c
Thanks.
Sponsor
Sponsor
Sponsor
sponsor
Rasta Fella




PostPosted: Sat Jan 21, 2006 7:52 pm   Post subject: (No subject)

If I am correct Math.Distance is not supported in 4.04. That's the only thing I can think of according to your posted error.
Prognosis




PostPosted: Sat Jan 21, 2006 7:55 pm   Post subject: (No subject)

ok, well i really wanna know how to do this then.

for example
say there is a dot and a oval on the screen going in random directions, how do I find out if this collide?
Delos




PostPosted: Sat Jan 21, 2006 9:15 pm   Post subject: (No subject)

[sigh]. This is one of the reasons why using built in Functions without knowing how they work can mess people up. Math.Distance() is not a complicated piece of code. In fact, chances are that you already know exactly how to make it yourself, and if your version of Turing doesn't support it, then that's exactly what you'll be doing.
Math.Distance() is nothing more than Pythagorus' Theorem. Work along that method of thinking, and you'll have your problems solved in no time.

Additionally, check out the [Tuts] section on collision detection (Circular in particular) for furthur details.
Saad85




PostPosted: Sat Jan 21, 2006 9:36 pm   Post subject: (No subject)

heres the formula..

sqrt((x1-x2)**2+(y1-y2)**2)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: