PDA

Click to See Complete Forum and Search --> : Angles



restlessmedia
03-20-2002, 08:59 AM
Hello,

I am trying to find out how to get opposite trajectory angle to a randomly flying object (ball?).

Bascially when an object hits the wall of a movie, then I want to get the opposite angle to fire the ball back in the opposite direction.

Thanks,

PC

Lord_Nuri
03-20-2002, 10:33 AM
keep track of the object's last known position. From this, use the built-in math functions to get your angle. The math functions return either degrees or radians, so read the documentation to find out which functions to use.

ex:
to calculate incident angle, use
if hitting top wall: Math.arctan(change_in_y / change_in_x)


http://www.mindsolve.com/images/mindsolve.gif

Ed Mack
03-20-2002, 10:42 AM
http://board.flashkit.com/board/showthread.php?threadid=279907

Heres an answer :)