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    """  ...
#import “YourScene.h”            [[CCDirector sharedDirector] replaceScene: [YourScene scene]];2011/6/25                  ...
#import “YourScene.h”              id transition = [CCTransitionFade transitionWithDuration:0.5f            scene:[YourSce...
-(void) registerWithTouchDispatcher{              [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self          ...
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{              //                return YES;            }2...
-(id) init{              if( (self=[super init])) {                 // create and initialize a Label                 CCLab...
CCSprite sprite = [CCSprite spriteWithFile:@”sprite.png”];            //                 sprite.position = ccp(100, 100); ...
// 240, 160   3           Action            id move = [CCMoveTo actionWithDuration:3 position:ccp(240, 160)];            /...
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
Upcoming SlideShare
Loading in...5
×

cocos2d入門

28,321

Published on

サンプルゲーム『かわずたんたたき!』の紹介と、cocos2dによるゲーム開発入門です

Published in: Technology, Business
1 Comment
19 Likes
Statistics
Notes
No Downloads
Views
Total Views
28,321
On Slideshare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
111
Comments
1
Likes
19
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "cocos2d入門"

    1. 1. 2011/6/25 1
    2. 2. 2011/6/25 2
    3. 3. 2011/6/25 3
    4. 4. 2011/6/25 4
    5. 5. 2011/6/25 5
    6. 6. 2011/6/25 6
    7. 7. 2011/6/25 7
    8. 8. 2011/6/25 8
    9. 9. 2011/6/25 9
    10. 10. 2011/6/25 10
    11. 11. 2011/6/25 11
    12. 12. 2011/6/25 12
    13. 13. 2011/6/25 13
    14. 14. 2011/6/25 14
    15. 15. 2011/6/25 15
    16. 16. 2011/6/25 16
    17. 17. 2011/6/25 17
    18. 18. 2011/6/25 18
    19. 19. 2011/6/25 19
    20. 20. 2011/6/25 20
    21. 21. 2011/6/25 21
    22. 22. 2011/6/25 22
    23. 23. 2011/6/25 23
    24. 24. / .::::::::::::::::::::::::;;:;;::, :::: l , rj,r """ l ::::::: Y ,! ::::::: | :::::::: | __ -- i::::,r ` - ´ , }::;! , . """"´ L_ / i , /| r ≡ - ´ ,,.._ i t- | , ,r , yx=" { ,- ; l r `-- /! ` _,, - ; ` -"_,, -" ;; , / -" ` ;;;; ,2011/6/25 24 / _ =
    25. 25. #import “YourScene.h” [[CCDirector sharedDirector] replaceScene: [YourScene scene]];2011/6/25 25
    26. 26. #import “YourScene.h” id transition = [CCTransitionFade transitionWithDuration:0.5f scene:[YourScene scene]; [[CCDirector sharedDirector] replaceScene:transition];2011/6/25 26
    27. 27. -(void) registerWithTouchDispatcher{ [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES]; }2011/6/25 27
    28. 28. - (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{ // return YES; }2011/6/25 28
    29. 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. 30. CCSprite sprite = [CCSprite spriteWithFile:@”sprite.png”]; // sprite.position = ccp(100, 100); // [self addChild:sprite]; // Sprite2011/6/25 30
    31. 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. 32. 2011/6/25 32
    33. 33. 2011/6/25 33
    34. 34. 2011/6/25 34
    35. 35. 2011/6/25 35
    36. 36. 2011/6/25 36
    37. 37. 2011/6/25 37
    38. 38. 2011/6/25 38
    39. 39. 2011/6/25 39
    40. 40. 2011/6/25 40
    41. 41. 2011/6/25 41
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×