cocos2d
 ElectroMaster   cocos2d   Tips
@ajinotataki

               xionchannel software

• http://xionchannel.no-ip.org/~xionchannel/
  index_j.html

•       CG

•
• Cubing Timer

• Solid Dots

• ElectroMaster
•

•

•

•
[self schedule:@selector(   :)];

CCScene     CCNode
[sprite numberOfRunningActions]

 0
•

•

•

•

•
cocos2d


• CCMoveBy, CCMoveTo

•
cocos2d

 •

 •

 • NSArray
     copy
//
+ (NSArray*) loadAnimPatternWithOffset:(CGPoint)offset {

   CCTexture2D *texture =

   
   [[CCTextureCache sharedTextureCache] addImage:@"all_texture.png"];


   NSString *act[] = { @"front",@"back",@"left",@"right" };

   NSMutableArray *tmp_anim_seq = [NSMutableArray array];


   for(int x = 0; x < 4; x++) {

   
   NSMutableArray *animFrames = [NSMutableArray array];

   
   for(int y = 0; y < 2; y++) {

   
   
   CCSpriteFrame *frame =

   
   
   
   [CCSpriteFrame frameWithTexture:texture

   
   
   
   
   
   
  
              rect:CGRectMake(

   
   
   
   
   
   
  
              
                                          
   32*x+offset.x+0.1,

   
   
   
   
   
   
  
              
                                          
   32*y+offset.y+0.1,

   
   
   
   
   
   
  
              
                                          
   31.8,

   
   
   
   
   
   
  
              
                                          
   31.8)

   
   
   
   
   
   
  
            offset:CGPointZero];

   
   
   [animFrames addObject:frame];

   
   }

   
   CCAnimation *animation =

   
   
   [CCAnimation animationWithName:act[x] delay:0.2f frames:animFrames];

   
   CCAnimate *animate =

   
   
   [CCAnimate actionWithAnimation:animation restoreOriginalFrame:NO];

   
   [tmp_anim_seq addObject:animate];

   }

   return tmp_anim_seq;
}
CCSequence *seq =

     [[allSeq objectAtIndex:num] copy];

[sprite stopAllActions];

[sprite runAction:

     CCRepeatForever actionWithAction:seq]];
•

•
•

•
cocos2d
• SimpleAudioEngine       SE



•                                          (
    )                 (                )

• CCLayer                  (CCSprite   )
             transform
SimpleAudioEngine             SE


• SimpleAudioEngine       cocosDension
                                   $250,000USD
                            $500
     (                )

• OpenAL                            (
         iPhoneSDK                          )
(            )

• ccConfig.h
    #define CC_COCOSNODE_RENDER_SUBPIXEL 0
    #define CC_SPRITESHEET_RENDER_SUBPIXEL 0

•                 (
             )

•
CCLayer
      transform




• CCSpriteSheet
CCSpriteSheet
•
       (    )

•



•   CCSpriteSheet   (
                        )
iPad
7/29

Cocos2dを使ったゲーム作成の事例