I've been working on a segment of code for the past few days now for a game, somethings wrong, but I can't tell what.
I have a line drawn between two mc's, and based on how the length of that line changes (it's rotated from mc2 to mc1), I want the distance between the two to change as well.
so...
mc2
|\
|..\c
|....\
|......\mc1
when "c" changes, mc1 should move accordingly.
What am I doing wrong?
-or-Code:for (j; j<1; j++) { var a = mc1._y - foot2._y; var b = mc1._x - foot2._x; var c = Math.sqrt(a*a+b*b); } c = mc2._height; a = c*Math.sin(point); b = Math.sqrt(c*c-a*a); mc1._x = mc2._x+b; mc1._y = mc2._y+a;
can you tell me a better, entirely different way of doing this?




Reply With Quote