At 6/13/06 04:21 PM, xWELSHxDRAGONx wrote:
distance between 2 movie clips
gap = Math.sqrt(Math.pow(mc1._x-mc2._x,2)+Math.p
ow(mc1._y-mc2._y,2))
and now the a.i.
if(gap<200){
gotoAndPlay(watever)
}
That doesn't seem to be working for me, I had to change it up to fit my game and this is the end code I got, but the only thing working is the else statement.
onClipEvent (enterFrame) {
gap = Math.sqrt(Math.pow(Lee._x-Gaara._x,2)+Math
.pow(Lee._y-Gaara._y,2));
}
onClipEvent (enterFrame) {
if(gap<200){
gotoAndPlay(1);
}
else gotoAndStop(2);
}