求大神教两个完全不规则的元件时间的碰撞检测。。
actionscript吧
全部回复
仅看楼主
level 2
z初电 楼主
假设元件a和b...求一个碰撞实例。。。
2015年03月01日 09点03分 1
level 3
给你这个例子
//拖动mca到mcb上,只要碰撞就重叠放置
mcx = mca_mc._x;
mcy = mca_mc._y;
mca_mc.onPress = function(){
this.startDrag(true);
}
mca_mc.onRelease = function(){
stopDrag();
if(this.hitTest(mcb_mc)){
//检测只要两个mc有交集,则返回true
this._x = mcb_mc._x;
this._y = mcb_mc._y;
} else {
this._x = mcx;
this._y = mcy;
}
}
2015年03月06日 07点03分 2
1