A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: need another pair of eyes

Threaded View

  1. #1
    file not found Captain_404's Avatar
    Join Date
    Apr 2006
    Posts
    457

    need another pair of eyes

    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?

    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;
    -or-

    can you tell me a better, entirely different way of doing this?
    Last edited by Captain_404; 08-08-2006 at 10:50 AM.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center