At 6:02 PM -0700 9/17/2001, David Janik-Jones wrote:
>A while ago I was trying to figure out how to move an object in a angle
>direction. You were kind enough to supply the following which works
>perfectly *EXCEPT* it seems to move the object on the specified angle
>*MINUS* 90 degrees.
It just needs a minus sign. Here's a handler that asks for an angle
in degrees and a distance and moves a graphic accordingly:
on mouseDown
ask "What angle?"
if it is empty then exit mouseDown else put it into angleInDegrees
ask "How far?"
if it is empty then exit mouseDown else put it into distanceInPixels
put trunc(distanceInPixels * cos(angleInDegrees * pi/180)) into xDistance
put trunc(distanceInPixels * sin(angleInDegrees * pi/180)) into yDistance
move graphic "My Graphic" relative xDistance,-yDistance -- note minus sign
end mouseDown
--
Jeanne A. E. DeVoto ~ [EMAIL PROTECTED]
http://www.runrev.com/
Runtime Revolution Limited - Power to the Developer!