开发者

What is the exact difference between both the hitTest methods

What is the exact difference between mc1.hitTest(mc2) and mc1.hitTest(开发者_StackOverflow社区mc2._x,mc2._y,true)


The first one just uses bounding rectangles to determine a hit, while the second, uses the shape/contour of an object to determine if the other is within (hits it) or not.

Regarding a way to 'detect a collision which will occur in the future', if the velocity of your object is constant, you should be able to.

Seb Lee-Delisle has two interesting posts on this:

  • Predictive collision detection techniques
  • Predicting circle line collisions

HTH


1st one takes MovieClip as its single parameter, and the second one takes two Numbers and a Boolean.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜