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.
シーンに 20 個のスプライトがあります。1 つのスプライトを移動するときに、スプライトが触れていたものを取得したいと考えています。移動中のスプライトが触れたとき。
誰でもコードで私を助けることができますか?
使用できます、
for(int i = 0; i<20; i++) { CCSprite *currentSprite = (CCSprite *)[self getChildByTag:i+tagOffset]; if(CGRectIntersectsRect([movingSprite boundingBox],[currentSprite boundingBox])) { // current sprite touched Break; } }