A Flash Developer Resource Site

1. circumference?...

I'm trying to figure out how to place a bullet mc at the tip of my gun depending on its rotation...?

2. x = circle's center + cos( angle ) * radius;
y = circle's center + sin( angle ) * radius;
ps: circumference is the length of a circle's perimeter.

3. I've set it up like this...

ammo._x = _root.gun._x + Math.cos(_root.gun._rotation) * 50;
ammo._y = _root.gun._y + Math.sin(_root.gun._rotation) * 50;

and it's not working correctly? what did I do wrong?

the guns x and y would be the center, and the gun is 50 pixels long so 50 would be the radius right?

4. MovieClip's _rotation property is in degrees, not radians. So you need to convert to radians:
radians = degrees * pi / 180

5. oh snap thats right ty ty!
works perfectly!

6. I think tangent would be better to use. and use ATAN2() to get degrees

Posting Permissions

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

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap