SlideShare une entreprise Scribd logo
1  sur  41
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

Contenu connexe

Similaire à cocos2d入門 (6)

TDD Boot Camp 札幌 2.0
TDD Boot Camp 札幌 2.0TDD Boot Camp 札幌 2.0
TDD Boot Camp 札幌 2.0
 
¿Cómo de sexy puede hacer Backbone mi código?
¿Cómo de sexy puede hacer Backbone mi código?¿Cómo de sexy puede hacer Backbone mi código?
¿Cómo de sexy puede hacer Backbone mi código?
 
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装からcocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
 
रियो डी जनेरियो
रियो डी जनेरियोरियो डी जनेरियो
रियो डी जनेरियो
 
Open Cv Tutorial Ii
Open Cv Tutorial IiOpen Cv Tutorial Ii
Open Cv Tutorial Ii
 
Open Cv Tutorial Ii
Open Cv Tutorial IiOpen Cv Tutorial Ii
Open Cv Tutorial Ii
 

Plus de Kohki Miki

Decksetがよかった話
Decksetがよかった話Decksetがよかった話
Decksetがよかった話
Kohki Miki
 
VOXCHRONICLE企画草案
VOXCHRONICLE企画草案VOXCHRONICLE企画草案
VOXCHRONICLE企画草案
Kohki Miki
 
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
Kohki Miki
 
【TDDBC2.1】やる夫で学ぶTDD
【TDDBC2.1】やる夫で学ぶTDD【TDDBC2.1】やる夫で学ぶTDD
【TDDBC2.1】やる夫で学ぶTDD
Kohki Miki
 
はてなインターンシップ2011、ワークショップ発表プレゼン
はてなインターンシップ2011、ワークショップ発表プレゼンはてなインターンシップ2011、ワークショップ発表プレゼン
はてなインターンシップ2011、ワークショップ発表プレゼン
Kohki Miki
 

Plus de Kohki Miki (20)

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

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

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

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n