A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: physics problem

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Location
    Austin, TX
    Posts
    297

    physics problem

    Hi,
    I've got a projectile that's being affected by gravity, and it's destination is determined by crosshairs.
    Unfortunately, that means I can't just use simply the coordinates of the target and the launch point to determine the angle of launch, since if I did that, because of gravity, when the projectile reached the crosshairs in the horizontal direction, it would be below them in the vertical.

    one workaround was to move the crosshairs down to where the projectile was going to be, rather than where the mouse actually is, since the math seemed easier that way. That worked, but that left a large space at the top that the crosshairs couldn't reach, since while the mouse is at the top, the crosshairs are always below it.

    So instead, I'm trying to do it the normal way, trying to figure out what angle I'd have to shoot the projectile at in order for it to hit wherever my mouse is. Does anyone know how to do that? Each time I try to wrap my head around the math, I just get dizzy.

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center