cocos2d入門
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

cocos2d入門

  • 28,395 views
Uploaded on

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

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

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
28,395
On Slideshare
20,506
From Embeds
7,889
Number of Embeds
25

Actions

Shares
Downloads
109
Comments
1
Likes
19

Embeds 7,889

http://d.hatena.ne.jp 6,302
http://obc-fight.blogspot.jp 774
http://gigi-net.hatenadiary.com 373
http://webcache.googleusercontent.com 120
http://obc-fight.blogspot.com 87
http://iq3.jp 75
http://192.168.1.56 58
https://twimg0-a.akamaihd.net 21
url_unknown 17
http://flavors.me 14
http://translate.googleusercontent.com 10
https://twitter.com 6
http://www.slideshare.net 6
http://blog.iq3.jp 5
http://nakamura001.hatenablog.com 5
http://cache.yahoofs.jp 5
http://obc-fight.blogspot.kr 3
http://obc-fight.blogspot.fr 1
http://reader.freerss.net 1
http://obc-fight.blogspot.co.at 1
http://obc-fight.blogspot.it 1
http://twitter.com 1
https://si0.twimg.com 1
http://freerss.net 1
https://www.google.co.jp 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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

  • 1. 2011/6/25 1
  • 2. 2011/6/25 2
  • 3. 2011/6/25 3
  • 4. 2011/6/25 4
  • 5. 2011/6/25 5
  • 6. 2011/6/25 6
  • 7. 2011/6/25 7
  • 8. 2011/6/25 8
  • 9. 2011/6/25 9
  • 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]; // Sprite2011/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