J'essaie de faire un sprite animate
en cocos2D
. Je crois que j'ai l'animation mis en place, mais comment puis-je dessiner le animating sprite
sur l'écran? Voici ce que j'ai:Animation dans Cocos2d.
id anim = [[[CCAnimation alloc] initWithName:@"char_walking" delay:1/12.0] autorelease];
[anim addFrame:@"run2.png"];
[anim addFrame:@"run1.png"];
[anim addFrame:@"run3.png"];
[anim addFrame:@"run4.png"];
[anim addFrame:@"run3.png"];
[anim addFrame:@"run1.png"];
id myAction = [CCAnimate actionWithAnimation:anim];
id repeating = [CCRepeatForever actionWithAction:myAction];
[character do:repeating];
character = [CCSprite spriteWithSpriteFrame:anim];
character.position = ccp(160, 240);
[self addChild:character];
Merci à l'avance, John
Ouais c'est ce que j'ai fait, je me sens stupide. – tallen11