摘要: 1. /*看小球是否重叠*/ public boolean isCircleOverlapping(Ball otherBall) { final float dy = otherBall.mY - mY; final float dx = otherBall.mX - mX; final float distance = dy * dy + dx * dx;//两小球间的距离 return (distance < ((2 * mRadiusPixels) * (2 *mRadiusPixels)))//如果距离小于半径的两倍并且不是碰撞后离开的状态,即重叠 // avoid jitte 阅读全文
posted @ 2011-07-05 14:22 lxmanutd 阅读(680) 评论(0) 推荐(0) 编辑