Hey, I m writing game for iPhone, using cocos2d framework.
I have 100 sprites and I want to run on them the same animation. Do I have to create 100 separate actions for each sprite, or can I create one action and use it on every sprite?
Hey, I m writing game for iPhone, using cocos2d framework.
I have 100 sprites and I want to run on them the same animation. Do I have to create 100 separate actions for each sprite, or can I create one action and use it on every sprite?
你们总是能够使用<条码>id采取行动,然后指定一种行动。 和
id myAction = [CCMoveBy actionWithDuration:0.2f position:myPoint];
id mySecondAction = [CCRotateBy actionWithDuration:0.2f angle:myAngle];
id actionSequence = [CCSequence actions: myAction, mySecondAction, nil];
然后通过你所有的间谍活动并附上行动。 如果你有一个阵列,那么编码>方法中的<代码>就会更快。
for (CCSprites mySprites in myArray) {
//attach actions to sprites code here
}
我所遵循的一种方法是,我从间谍类中创造出一个等级,并在分类初始阶段分配行动。
例如,我不得不生产10-100件敌方 sp。
Ill 造成来自CC Sprite的一类敌机。
职能
+(void)initwithParamters:(CCPoint)spwanPoint frames:(NSString *)plist{
mummyActor *tempInstance =[mummyActor spriteWithWatever suites ur reqirment];
//do all stuff here
//load actions
return tempInstance;
}
//other methods to call actions or access mutators
当我需要制造这些敌人时,我制造了NNSMuTableArray敌人。
在按照游戏适用各种道路勘察或规则时,我可接触这些阵列的每一物体。
为贫穷的美国人提供服务,但这是我迄今在不问任何人的情况下开展工作的最佳方式;
everyone, I made a shooting game just like 1942(classic shooting game),but here s the question, FPS drops to 5~6 when the fighter shoot out a straight line of bullet,about 7~8 bullets in the screen,...
I am using AtlasSpriteManager and AltasSprite to create frame by fram animation with 1 one file. I wanna write something that at first show a simple picture, without any animation and for example when ...
I have 4 images and a background. I already about to animate the image to move accordingly. But the back ground is not moving. I am not sure how to make the background move accordingly to the movement ...
@implementation Level @synthesize doors, rooms; - (id) init { self = [super init]; if (self != nil) { rooms = [[NSMutableArray alloc] init]; doors = [[NSMutableArray alloc] init]; ...
I need to create some compound sprites that will all move and rotate together. Since it s possible to change the position and rotation of an AtlasSpriteManager I ve been trying to subclass so I can ...
I am really stuck on this. My application is in landscape view and on one screen i wanted my instructions image to be scrollable. I have added this image as a sprite. First i tried to get scroll ...
I m making slow but steady progress with a Cocos2d game, but I m stuck creating moving platforms. The main character needs physics and collision detection, and is therefore a chipmunk shape/body. I ...
I m working on a game like Rodents Revenge, just to point out where I m coming from with this question. I m using the cocos2d game engine aswell... I have a layer that contains about 168 blocks, ...