I've got some bullet code that is dependent upon the rotation.  However, my 
results are backwards; meaning, I have to invert my results to get the 
bullet to move at the right angle.  Granted, it works, but I feel 
uncomfortable since I don't understand why it's backwards.  Anyone explain 
why, or give me a better algo?

// my ship
var theRadians:Number = Math.atan2((_y - goodGuy._y), (_x - goodGuy._x));
var theDegrees:Number = theRadians * 180 / Math.PI;
_rotation = theDegrees;

// the bullet code
var deltaX:Number = targetX - _x;
var deltaY:Number = targetY - _y;
var angle:Number = p_shipFiring._rotation;
angle = angle * Math.PI / 180;
theX = speed * Math.cos(angle);
theY = speed * Math.sin(angle);
// only works if I invert...???
theX *= -1;
theY *= -1;

Thanks if you can help!

--JesterXL 

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to