ios - Sprite Frame Animation Cocos2d 3.0 -


I am trying to create an animated sprite, they have lots of tutorials but they are all for Cocos 2D 2 X The name of my sprite sheet is flapboard page and Plist's name is flappbird.plist

I have this code but every time I crash it, it's in my init method

  // ------------------------------------ ------ ----------------------------- _player = [CCS Prakash Spit with Image Nominated: @ "Monster 1 Page"]; // your. The plist file comes from _player.position = ccp (self.contentSize.width / 28, self.contentSize.height / 2); _player.physicsBody = [With sycophysics body body: (CGRact) {CGPointZero, _player.contentSize} Corner: 0]; // 1 _player.physicsBody.collisionGroup = @ "Players Group"; _player.physicsBody.Type = CCFixixBodyTypeStatic; CCSpriteBatchNode * Batch node = [CCSpriteBatchNode batch nodewhitefile: @ "Monster 1Page"]; [Batch node adb: _player]; [Self linking child: batch node]; NSMutableArray * animFrames = [NSMutableArray array]; For (Int i = 1; i & lt; 5; i ++) {Sisisprintfrem * frame = [[Sisisprintfremkac Searsprofaifamakac] Spreetfremabaynam [Ansstiing Stringvet format: @ "Flaprdd% d pages", I]]; [Animated frame ad object: frame]; } CC animation * animation = [cc animation animationxsriteframes: antifreeze delay: 0.2f]; [_Player Action: [CCActionArvitationAction with Action: [CCActionAnnetAction with Animation: Animation]]]; [_physicsWorld addChild: _player]; // ------------------------------------------------ -----------------------  

at the beginning of your code

> Add the Phantom Sheet after itself. User Interface enabled = Yes

Add all this where the phantom will be

addSpriteFrameCache; addSpriteFramesCache; @ ">

  // Phantom encryption NSMutableArray * walkAnimFrames = [to NSMutableArray array]; (int i = 1; i & lt; = 7; ++ i) {[walkAnimFrames addObject: [[CCSpriteFrameCache sharedSpri teFrameCache] spriteFrameByName: [NSString stringWithFormat: @ "Monster% d.png", i]]] ;;} CCAnimation * walkAnim = [Sisianimeshn Animeshnakssraitfrems: walkAnimFrames delay: 0.1 F]; // Speed ​​which will frame // Micsstestest Phantom Want to add PNG = [CCSlight Practice with Image: @ "Monster 1Page"]; // Spit Monstest. Refine = CCP (self cross system size. With / 2, set content size. Heights / 2); // Repeat the Phantom Encryption CCActionAnmat * Animation Action = [CCActionAnnetAction with Animation: Walkenim]; CCActionRepeatForever * repeatingAnimation = [CCActionRepeatAutverActionWithActionActionActionAction]; // animation repeated repeated [monstest run action: recurrence animation]; // Add Sprite to this view [self addChild: monstertest];  

Hope this helps someone: D Cheers


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -