Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在主场景中有一个精灵,在定位层上有另一个精灵(后者也在主场景中)。
我想检测它们之间的碰撞,但是图层上精灵的 boundingBox() 函数被父图层的位置偏移。
如何检测两个精灵之间的碰撞?
尝试这样的事情:
if(goog.math.Box.intersects(this.sprite1.getBoundingBox(), sprite2.getBoundingBox())){ //do something... }