At 11/17/12 10:31 PM, MarijuanaPenguin wrote:
Wait, I am confused, how does that get me the x/y coords? I feel like I am missing something really obvious.
that hekps because the bullets are on the same level as everything else, so there's no need for translating, digging around in clips, or parent and whatnot.
At 11/17/12 10:36 PM, MarijuanaPenguin wrote:
Actually, better idea. Does anyone know if it is possible to convert rotation to slope? I got everything to work but I need to make the bullets fly in the direction they are rotated. I know this can be done with trigonometry, but since I am in 9th grade, I did not learn that yet. Thanks.
trig is your best option. I got my GED instead of going to 10th grade, and went to Job Corps instead. I still use trig because it's useful.
(by the way, don't drop out. It's a pain to do it, and it's a pain afterword)
x and y to radians:
var rads:Number = Math.atan2(oldY - newY, oldX - newX);
radians to degrees:
var degrees:Number = rads * (180 / Math.PI)
degrees to radians:
var radians:Number = degrees / (180 / Math.PI)
radians to x and y:
var x:Number = Math.cos(rads);
var y:Number = Math.sin(rads);
I have these memorized.