I’ve only been using flash for a short while and, before you dismiss this I have trawled forums in search of an answer to this question - maybe I missed something but I’m fairly sure I didn’t.
What I want to do is make a movieclip to point at another movieclip, not the mouse(there are plenty of tutorials for that). I have tried to use a number of formulas to solve this including:
bulletenemy1._rotation = (Math.asin(((bulletenemy1._y - car._y) / (Math.sqrt(((car._x - bulletenemy1._x) * (car._x - bulletenemy1._x)) + ((car._y - bulletenemy1._y) * (car._y - bulletenemy1._y))))))) * Math.PI / 180;
and
bulletenemy1._rotation = Math.atan2(_root.car._y - bulletenemy1._y, _root.car._x - bulletenemy1._x);
which haven’t worked.
I’m also trying to work out how to make a movieclip chase another and wondering what’s wrong with this piece of code:
r = 10/(((car._y - bulletenemy1._y) * (car._y - bulletenemy1._y)) + ((car._x - bulletenemy1._x) * (car._x - bulletenemy1._x)))
bulletenemy1._y += Math.sqrt((car._y - bulletenemy1._y) * r)
bulletenemy1._x += Math.sqrt((car._x - bulletenemy1._x) * r)
Any help or pointers is greatly appreciated and thanks in advance.