>Otherwise we couldn't hear if we dropped a coin out of the pocket, could we?

Actually, sound has more to do with the presence of an atmosphere than 
gravity ;-)

>    lDistance=sprite(me.spritenum).loc-sprite(fixedsprite).loc
>    sprite(me.spritenum).loc=sprite(me.spritenum).loc+100/lDistance

Interesting way of doing it--that actually yields the vector. It's a good 
approach, but I'll need to work to refine it, because it doesn't take into 
account negative numbers (points above or to the left of the floating 
sprite). If lDistance = point (-20, -20), it still evaluates to 0.

I've been tracking distance using good ol' Pythagoras:

   lDistanceH = lMyLocH - gCurH
   lDistanceV = lMyLocV - gCurV
   lDistance = sqrt(power(lDistanceH, 2) + power(lDistanceV, 2))

  That's already being calculated, because the fixed sprites also grow 
larger and brighter (blend increases) as the floater gets closer. That part 
works jes' fine.

I'm calculating the x and y distances separately so I can use those to 
figure out where the floater is (up, down, left, right). I can use those to 
adjust your formula accordingly.

>This way the me-sprite will move and accelerate towards the fixed sprite.

Actually, I'm doing the opposite. Imagine a small planet-sized object 
floating through an asteroid belt. Now imagine the asteroids are tethered 
to a fixed point in space by a giant rubber band. My floater is the planet, 
and the fixed sprites are the asteroids.

>due to Lingo's <sarcasm> magnificent numberjuggling </sarcasm>

Yes--reference my rant yesterday about -54 / 55 evaluating to 0.

>I mean really ugly! But ofcourse you already code that way, Kerry.

Ah, I see I'll have to stop posting my code to the list ;-) If you want 
elegant, Jakob's your man.

This has to be finished tomorrow, so I'll post my end result. It'll be 
ugly, but it'll work :-)

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