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.
有人能告诉我如何在精灵上创建一个半径,以便另一个精灵在该半径内时可以攻击。任何教程/代码都会对我很有帮助。提前致谢。
ccpDistance从 sprite.position 到 otherSprite.position 为您提供两个精灵之间的距离。如果距离低于某个半径,则另一个精灵的位置在该半径内。
ccpDistance