检查矩形AS3之间的碰撞

wyy*_*wyy 0 collision-detection actionscript-3

什么是检查2个矩形之间的碰撞的快速方法,然后您有矩形坐标,如:

红色矩形:A1(x1,y1),B1(x2,y2).

蓝色矩形:A2(x3,y3),B2(x4,y4).

在此输入图像描述

小智 5

你检查矩形类链接到AS3 Doc

相交点(toIntersect:矩形):矩形

如果toIntersect参数中指定的Rectangle对象与此Rectangle对象相交,则将交集区域作为Rectangle对象返回.

相交(toIntersect:矩形):布尔

确定toIntersect参数中指定的对象是否与此Rectangle对象相交.