• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
cocos2d for i Phoneの紹介
 

cocos2d for i Phoneの紹介

on

  • 3,939 views

2011/7/15に福井で開催されたiPhoneアプリ開発者勉強会の発表スライドです。

2011/7/15に福井で開催されたiPhoneアプリ開発者勉強会の発表スライドです。
http://atnd.org/events/16933

Statistics

Views

Total Views
3,939
Views on SlideShare
3,855
Embed Views
84

Actions

Likes
9
Downloads
1
Comments
0

3 Embeds 84

http://iq3.jp 78
http://blog.iq3.jp 5
http://webcache.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    cocos2d for i Phoneの紹介 cocos2d for i Phoneの紹介 Presentation Transcript

    • cocos2d for iPhone
    • • cocos2d iPhone&iPad• cocos2d – – – RPG•• Game Center•••
    • cocos2d for iPhone• 2D• Objective-C•• – MIT • OK OK
    • cocos2d••
    • • – – OpenGL• – – –• – – –• –
    • • – –
    • //CCScene* scene = [CCScene node];//CCLayer* background = [MyBGLayer node];[scene addChild: background];CCLayer* mainlayer = [MyMainLayer node];[scene addChild: mainlayer];//// (0,0)CCSprite* playersprite = [CCSprite spriteWithFile:@”Player.png”];[mainlayer addChild: playersprite];
    • • Parallax•• →
    • //CCParallaxNode* paraNode = [CCParallaxNode node];[paraNode addChild:spriteSky z:1 parallaxRatio:CGPointMake(0.5f, 0) positionOffset:topOffset];[paraNode addChild:spriteMountain z:2 parallaxRatio:CGPointMake(1, 0) positionOffset:midOffset];[paraNode addChild:spriteTree z:4 parallaxRatio:CGPointMake(3, 0) positionOffset:downOffset];
    • •••••
    • // (100,200) 3CCMoveTo* move = [CCMoveTo actionWithDuration:3 position:CGPointMake(100,200)];[myNode runAction:move];//CCMoveTo* move = [CCMoveTo actionWithDuration:3 position:CGPointMake(100,200)];CCEaseInOut* ease = [CCEaseInOut actionWithAction:move rate:4];[myNode runAction:ease]//CCRotateBy* rotateBy = [CCRotateBy actionWithDuration:2 angle:360];//CCRepeatForever* repeat = [CCRepeatForever actionWithAction:rotateBy];[myNode runAction:repeat];//CCSequence* sequence = [CCSequence actions: at1, at2, at3, nil];[myNode runAction:sequence];
    • •• http://www.youtube.com/watch ?v=zMCKQl5uSYw•••
    • Particle Designer($7.99)
    • // plistCCParticleSystem* particle =[CCParticleSystemQuad particleWithFile:@”particle1.plist”];//CGSize winSize = [[CCDirector sharedDirector]winSize];particle.position = CGPointMake( winSize.width/ 2, winSize.height / 2 );[myLayer addChild:particle z:1 tag:1];
    • • 1••
    • Zwoptex• plist•
    • // plistCCSpriteFrameCache* frameCache =[CCSpriteFrameCachesharedSpriteFrameCache];[frameCache addSpriteFramesWithFile: @”texture-atlas1.plist”];//CCSpriteFrame* sprite = [frameCachespriteFrameByName:@”sprite1.png”];
    • •• –•
    • Tiled Map Editor
    • //CCTMXTiledMap* tileMap = [CCTMXTiledMaptiledMapWithFile:@”tilemap.tmx”];[myLayer addChild:tileMap z:-1 tag:1]
    • • box2d chipmunk••• box2d C++ chipmunk C
    • •••//[[CCDirector sharedDirector] pause];//[[CCDirector sharedDirector] resume];
    • •• cocos2d –
    • cocos2d1. main appDelegate2. appDelegate 1. EAGLView 2. Director [Direcotor sharedDirector]; EAGLView director 3. runWithScene [director runWithScene: firstScene]; ※ scene
    • • Layer• Layer CCTouchDispatcher• UIKit [[CCDirector sharedDirector] convertToGL:touchLocation];
    • // Layerself.isTouchEnabled = YES;self.isAccelerometerEnabled = YES;// Layer-(void) ccTouchesBegan: (NSSet *)touches withEvent:(UIEvent *)event-(void) accelerometer:(UIAccelerometer *)accelerometerdidAccelerate:(UIAcceleration *)acceleration
    • • update –1 60 1 update 60• update• n
    • // update[self scheduleUpdate];-(void) update:(ccTime)delta { //}// interval update[self schedule:@selector(myUpdate1:)interval :0.1f];-(void) myUpdate1:(ccTime)delta { // 0.1}
    • #import “SimpleAudioEngine.h”[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@”bgm.mp3” loop:YES][[SimpleAudioEngine sharedEngine] playEffect:@”se01.caf”];※ mp3
    • cocos2d iPhone&iPad• – – –•• amazon