環境(box2d)内に4つの異なるタイプのオブジェクトがあり、各タイプのオブジェクトには複数のインスタンスがあり、すべてのCCSpriteの追加と操作を処理する最も効率的な方法を見つけたいと考えています。スプライトはすべて異なるファイルからのものであるため、各スプライトを作成してデータ構造(NSMutableArray)に追加するのが最善でしょうか、それとも各CCSpriteファイルが(オブジェクトのタイプごとに)異なっていてもCCSpriteBatchNodeを使用するのでしょうか?ありがとう。
@interface LevelScene : CCLayer
{
b2World* world;
GLESDebugDraw *m_debugDraw;
CCSpriteBatchNode *ballBatch;
CCSpriteBatchNode *blockBatch;
CCSpriteBatchNode *springBatch;
CCSprite *goal;
}
+(id) scene;
// adds a new sprite at a given coordinate
-(void) addNewBallWithCoords:(CGPoint)p;
// loads the objects (blocks, springs, and the goal), returns the Level Object
-(Level) loadLevel:(int)level;
@end