As I’ve posted this in about 3 other forums and no one else seems to have an answer for me, I’m hoping you guys might be able to help me out:
I’m adding a game-like element to my site, and it needs a small and (probably) simple little thing that I cannot for the life of me figure out.
I’m trying to create a little “rocket-launcher”-type MC. It “locks-on” to the mouse when the “missle” is loaded and “shoots” towards that point (it doesn’t dynamically follow the mouse, but locks on to the mouseX,Y when it’s generated). That part is a piece of cake. The tricky part is that I want the “missles” to arc (randomly at that) towards their destination point.
I’ve had no problems getting the missles to reach their destination in a straight line, but I’d love it if they could curve towards it. It probably involves lots of trigonometry, which I failed, hence my pleading for help all over teh intarweb.
So, to summarize:
- Missle is generated
1a)locks-on to mouseX,Y
2)missle goes towards endpoint but not directly, in an arc (if possible not a set arc but a random curve so it’s different every time)
3)missle reaches endpoint, fades out
You guys are probably the most qualified to figure this out for me, I’m not sure why I didn’t ask you first.
Anyhow, plaese please please tell me you have a solution for me.
cheers,
Bob LLama :puzzled: