I've been working all weekend to come up with a formula for this, and I 
realize now I probably should have gone ahead with that third semester of 
calculus.

Here's the problem. I have one main sprite that floats around the screen. I 
also have 44 other sprites scattered around the screen, each confined to an 
area about 100 x 100.

I want the floating sprite to exert sort of a planetary gravity effect on 
the other sprites. As the floating sprite approaches a fixed sprite, that 
fixed sprite should start moving towards the floating sprite, but stay 
within its 100 x 100 rectangle. Ideally, the closer the floating sprite 
gets, the more the stationary sprite should be attracted--i.e., the faster 
it should move.

The reverse should happen, too--as the floating sprite moves away, the 
fixed sprites should follow, but slower and slower as the floater moves 
farther away. At some point--probably when the floater is about 200 pixels 
away--the fixed sprite will drift back to its original location (that 
part's already done).

So, does somebody have a formula to do this? If it's in lingo form, great. 
If not, I can convert it easily.

Cordially,
Kerry Thompson
Sr. Interface Engineer
Learning Network


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to