SlideShare a Scribd company logo
2011/6/25   1
2011/6/25   2
2011/6/25   3
2011/6/25   4
2011/6/25   5
2011/6/25   6
2011/6/25   7
2011/6/25   8
2011/6/25   9
2011/6/25   10
2011/6/25   11
2011/6/25   12
2011/6/25   13
2011/6/25   14
2011/6/25   15
2011/6/25   16
2011/6/25   17
2011/6/25   18
2011/6/25   19
2011/6/25   20
2011/6/25   21
2011/6/25   22
2011/6/25   23
/        .::::::::::::::::::::::::;;:;;::,                        ::::
                      l        ,       rj,r    '"'"'"                   l :::::::
                           Y                                                      ,! :::::::
                           |                                                                ::::::::
                           | __                 --                                i::::,r
              `'' -                '               ´           ,                   }::;! , .
                                                 """"´                                             L_
                                   /                                                i          ,        /|                     r
            ≡ -           ´        ,,.._                                      i             't-'        | ,               ,r
            , yx=''"                   {       ,-                         ;             l                '    r       '
                                               `--                                      /!                        `
                   _,, -                             ''                                 ;                                 `
            -''"_,, -''"                                               ;;'         ,'          /
            -''"                               `          ''       ;;;;' ,'
2011/6/25                                                                                                                          24
                                           /                             _ =
#import “YourScene.h”

            [[CCDirector sharedDirector] replaceScene: [YourScene scene]];

2011/6/25                                                                    25
#import “YourScene.h”
              id transition = [CCTransitionFade transitionWithDuration:0.5f
            scene:[YourScene scene];
              [[CCDirector sharedDirector] replaceScene:transition];



2011/6/25                                                                     26
-(void) registerWithTouchDispatcher{
              [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self
            priority:0 swallowsTouches:YES];
            }




2011/6/25                                                                      27
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
              //
                return YES;
            }
2011/6/25                                                                       28
-(id) init{
              if( (self=[super init])) {
                 // create and initialize a Label
                 CCLabelTTF *label = [CCLabelTTF labelWithString:@"Hello World" fontName:@"Marker
            Felt" fontSize:64];

                  // ask director the the window size
                  CGSize size = [[CCDirector sharedDirector] winSize];

                  // position the label on the center of the screen
                  label.position = ccp( size.width /2 , size.height/2 );

                  // add the label as a child to this Layer
                  [self addChild: label];

                  self.isTouchEnabled = YES;
                }
                return self;
            }

            -(void) registerWithTouchDispatcher{
              [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0
            swallowsTouches:YES];
            }

            - (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
              id transition = [CCTransitionFade transitionWithDuration:0.5f scene:[YourScene scene];
              [[CCDirector sharedDirector] replaceScene:transition];
              return YES;
            }
2011/6/25                                                                                              29
CCSprite sprite = [CCSprite spriteWithFile:@”sprite.png”];
            //
                 sprite.position = ccp(100, 100); //
                 [self addChild:sprite]; //        Sprite




2011/6/25                                                                     30
// 240, 160   3           Action
            id move = [CCMoveTo actionWithDuration:3 position:ccp(240, 160)];
            // 2       360        Action
            id rotate = [CCRotateBy actionWithDuration:2 angle:360];
            // 4             127              Action
            id fade = [CCFadeTo actionWithDuration:4 opacity:127];
            //        Action   Sequence
            CCSequence* sequence = [CCSequence actions:move, rotate, fade, nil];
            // Sequence Sprite
            [sprite runAction:sequence];


2011/6/25                                                                          31
2011/6/25   32
2011/6/25   33
2011/6/25   34
2011/6/25   35
2011/6/25   36
2011/6/25   37
2011/6/25   38
2011/6/25   39
2011/6/25   40
2011/6/25   41

More Related Content

PDF
GLT Vol.15 yamaguchiintlab-J
KEY
서비스디자인 스터디 도로명주소
PDF
BDD revolution - or how we came back from hell
PDF
Flex入門
PDF
Web Hooks On Pbwiki
PDF
LAMP_TRAINING_SESSION_1
PDF
Urban Sprawl - European vision
PDF
Let jQuery Rock Your World
GLT Vol.15 yamaguchiintlab-J
서비스디자인 스터디 도로명주소
BDD revolution - or how we came back from hell
Flex入門
Web Hooks On Pbwiki
LAMP_TRAINING_SESSION_1
Urban Sprawl - European vision
Let jQuery Rock Your World

Similar to cocos2d入門 (11)

PDF
在iOS平台上用Cocos2D做开发 | iOS独立开发者 秦春林
PDF
Kinect勉強会 Vol.3 -ぼくのかんがえた最強のNUI-
PDF
Arc of developer part2
PDF
Advanced iOS
PDF
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
PDF
Core What?
PDF
Of class2
KEY
Grand centraldispatch
KEY
Agile Iphone Development
KEY
cocos2で始める iPhoneゲーム開発入門
PDF
Creating physics game in 1 hour
在iOS平台上用Cocos2D做开发 | iOS独立开发者 秦春林
Kinect勉強会 Vol.3 -ぼくのかんがえた最強のNUI-
Arc of developer part2
Advanced iOS
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
Core What?
Of class2
Grand centraldispatch
Agile Iphone Development
cocos2で始める iPhoneゲーム開発入門
Creating physics game in 1 hour
Ad

More from Kohki Miki (20)

PDF
watchOS 2でゲーム作ってみた話
PDF
cocos2d-consoleでパッケージ管理
PDF
エターナらないゲーム開発
PDF
ゲームコミュニティサミット2014に参加してきた話
PDF
ゲームコミュニティサミット2014「*いどのなかにいる*」
PDF
札幌ゲーム製作者コミュニティKawaz「いどのなかにいる」
PDF
Kawaz Hipchat超入門
PDF
Kawaz Third Impact
PDF
Decksetがよかった話
PDF
Unite Japanに参加してきた話
PDF
nomad-cliの紹介
PDF
cocos2d-x 3.0 + C++11で始めるゲーム開発超入門
PDF
VOXCHRONICLE企画草案
PDF
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
KEY
Kawaz的jQuery入門
PDF
Kobold2Dで始めるゲーム開発
PDF
【TDDBC2.1】やる夫で学ぶTDD
KEY
はてな技術勉強会 #4LT「札幌ゲーム制作者コミュニティKawaz」について
KEY
はてなインターンシップ2011、ワークショップ発表プレゼン
KEY
PyGame入門
watchOS 2でゲーム作ってみた話
cocos2d-consoleでパッケージ管理
エターナらないゲーム開発
ゲームコミュニティサミット2014に参加してきた話
ゲームコミュニティサミット2014「*いどのなかにいる*」
札幌ゲーム製作者コミュニティKawaz「いどのなかにいる」
Kawaz Hipchat超入門
Kawaz Third Impact
Decksetがよかった話
Unite Japanに参加してきた話
nomad-cliの紹介
cocos2d-x 3.0 + C++11で始めるゲーム開発超入門
VOXCHRONICLE企画草案
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
Kawaz的jQuery入門
Kobold2Dで始めるゲーム開発
【TDDBC2.1】やる夫で学ぶTDD
はてな技術勉強会 #4LT「札幌ゲーム制作者コミュニティKawaz」について
はてなインターンシップ2011、ワークショップ発表プレゼン
PyGame入門
Ad

Recently uploaded (20)

PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPT
Teaching material agriculture food technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Spectroscopy.pptx food analysis technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Teaching material agriculture food technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

cocos2d入門

  • 10. 2011/6/25 10
  • 11. 2011/6/25 11
  • 12. 2011/6/25 12
  • 13. 2011/6/25 13
  • 14. 2011/6/25 14
  • 15. 2011/6/25 15
  • 16. 2011/6/25 16
  • 17. 2011/6/25 17
  • 18. 2011/6/25 18
  • 19. 2011/6/25 19
  • 20. 2011/6/25 20
  • 21. 2011/6/25 21
  • 22. 2011/6/25 22
  • 23. 2011/6/25 23
  • 24. / .::::::::::::::::::::::::;;:;;::, :::: l , rj,r '"'"'" l ::::::: Y ,! ::::::: | :::::::: | __ -- i::::,r `'' - ' ´ , }::;! , . """"´ L_ / i , /| r ≡ - ´ ,,.._ i 't-' | , ,r , yx=''" { ,- ; l ' r ' `-- /! ` _,, - '' ; ` -''"_,, -''" ;;' ,' / -''" ` '' ;;;;' ,' 2011/6/25 24 / _ =
  • 25. #import “YourScene.h” [[CCDirector sharedDirector] replaceScene: [YourScene scene]]; 2011/6/25 25
  • 26. #import “YourScene.h” id transition = [CCTransitionFade transitionWithDuration:0.5f scene:[YourScene scene]; [[CCDirector sharedDirector] replaceScene:transition]; 2011/6/25 26
  • 27. -(void) registerWithTouchDispatcher{ [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES]; } 2011/6/25 27
  • 28. - (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{ // return YES; } 2011/6/25 28
  • 29. -(id) init{ if( (self=[super init])) { // create and initialize a Label CCLabelTTF *label = [CCLabelTTF labelWithString:@"Hello World" fontName:@"Marker Felt" fontSize:64]; // ask director the the window size CGSize size = [[CCDirector sharedDirector] winSize]; // position the label on the center of the screen label.position = ccp( size.width /2 , size.height/2 ); // add the label as a child to this Layer [self addChild: label]; self.isTouchEnabled = YES; } return self; } -(void) registerWithTouchDispatcher{ [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES]; } - (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{ id transition = [CCTransitionFade transitionWithDuration:0.5f scene:[YourScene scene]; [[CCDirector sharedDirector] replaceScene:transition]; return YES; } 2011/6/25 29
  • 30. CCSprite sprite = [CCSprite spriteWithFile:@”sprite.png”]; // sprite.position = ccp(100, 100); // [self addChild:sprite]; // Sprite 2011/6/25 30
  • 31. // 240, 160 3 Action id move = [CCMoveTo actionWithDuration:3 position:ccp(240, 160)]; // 2 360 Action id rotate = [CCRotateBy actionWithDuration:2 angle:360]; // 4 127 Action id fade = [CCFadeTo actionWithDuration:4 opacity:127]; // Action Sequence CCSequence* sequence = [CCSequence actions:move, rotate, fade, nil]; // Sequence Sprite [sprite runAction:sequence]; 2011/6/25 31
  • 32. 2011/6/25 32
  • 33. 2011/6/25 33
  • 34. 2011/6/25 34
  • 35. 2011/6/25 35
  • 36. 2011/6/25 36
  • 37. 2011/6/25 37
  • 38. 2011/6/25 38
  • 39. 2011/6/25 39
  • 40. 2011/6/25 40
  • 41. 2011/6/25 41

Editor's Notes