forums

TNT Basic Forums > Programming Q&A
trace
< Last Thread     Next Thread >
Author
Thread        Post A Reply

06-01-2004 05:04

Posted by:
puffin

Click Here to Email puffin   Find more posts by puffin

if you've ever used a graphing calculator then you're probably familier with the trace function. basically it allows you to move a little pointer thing along a curve. so my question is, how would i write my own trace function? i want to make a sonic type game. thanks in advance.

06-01-2004 13:36

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

If you have the curve as a function, it would make things easy. Just allow the user to change the x value with left and right, and input the x value into the function to find the y value.

06-01-2004 22:32

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

I've got an idea. You can store in a data command a series of points and the type of curve it takes to get to each one; for example, there's a point at (0,0) and then you use the right half of an upside down parabolic curve to connect it to the next point at (5,2), etc. Actually you would need to use three points so there is only one equation that would fit them, but do you know what I'm trying to get at?

06-01-2004 23:10

Posted by:
puffin

Click Here to Email puffin   Find more posts by puffin

yeah, i follow. my problem is adding natural looking physics to it. there's an interdependence between the x and y axis here. for example, rolling backwards down a hill moves you downward with the force of gravity but it also moves you, let's say to the left. i haven't done much tinkering with it, so i could just be making it out to be more complicated then it is. i'll write up a little test with an exponential curve and adding gravity to see how it does.

06-01-2004 23:43

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

Oh, good point. Well, you could try solving the same equation for both x and y.

06-02-2004 12:42

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

Have you thought of using MOAN as a simpler solution? This way, ou have absolute control over the object's pre-defined path and the movement can still look natural.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.